arm_svm_rbf_init_f32.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* ----------------------------------------------------------------------
  2. * Project: CMSIS DSP Library
  3. * Title: arm_svm_rbf_init_f32.c
  4. * Description: SVM Radial Basis Function Instance Initialization
  5. *
  6. *
  7. * Target Processor: Cortex-M and Cortex-A cores
  8. * -------------------------------------------------------------------- */
  9. /*
  10. * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the License); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. #include "arm_math.h"
  27. #include <limits.h>
  28. #include <math.h>
  29. /**
  30. * @addtogroup groupSVM
  31. * @{
  32. */
  33. /**
  34. * @brief SVM radial basis function instance init function
  35. *
  36. * Classes are integer used as output of the function (instead of having -1,1
  37. * as class values).
  38. *
  39. * @param[in] S points to an instance of the polynomial SVM structure.
  40. * @param[in] nbOfSupportVectors Number of support vectors
  41. * @param[in] vectorDimension Dimension of vector space
  42. * @param[in] intercept Intercept
  43. * @param[in] dualCoefficients Array of dual coefficients
  44. * @param[in] supportVectors Array of support vectors
  45. * @param[in] classes Array of 2 classes ID
  46. * @param[in] gamma gamma (scikit-learn terminology)
  47. * @return none.
  48. *
  49. */
  50. void arm_svm_rbf_init_f32(arm_svm_rbf_instance_f32 *S,
  51. uint32_t nbOfSupportVectors,
  52. uint32_t vectorDimension,
  53. float32_t intercept,
  54. const float32_t *dualCoefficients,
  55. const float32_t *supportVectors,
  56. const int32_t *classes,
  57. float32_t gamma
  58. )
  59. {
  60. S->nbOfSupportVectors = nbOfSupportVectors;
  61. S->vectorDimension = vectorDimension;
  62. S->intercept = intercept;
  63. S->dualCoefficients = dualCoefficients;
  64. S->supportVectors = supportVectors;
  65. S->classes = classes;
  66. S->gamma = gamma;
  67. }
  68. /**
  69. * @} end of groupSVM group
  70. */