From 7a8a02f976b700934162303c3520a76507daf4fa Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Fri, 9 Aug 2019 15:08:08 +0200 Subject: [PATCH] CMSIS-DSP: Corrected Doxygen warnings. --- .../arm_matrix_example_f32.c | 1 - Include/arm_math.h | 61 ++++++++++--------- Source/CommonTables/arm_common_tables.c | 1 + Source/DistanceFunctions/arm_dice_distance.c | 14 ++--- .../arm_jensenshannon_distance_f32.c | 40 +++++++++--- .../arm_minkowski_distance_f32.c | 4 +- Source/SVMFunctions/arm_svm_linear_init_f32.c | 1 + .../SVMFunctions/arm_svm_linear_predict_f32.c | 6 +- .../arm_svm_polynomial_init_f32.c | 1 + .../arm_svm_polynomial_predict_f32.c | 6 +- Source/SVMFunctions/arm_svm_rbf_init_f32.c | 1 + Source/SVMFunctions/arm_svm_rbf_predict_f32.c | 6 +- .../SVMFunctions/arm_svm_sigmoid_init_f32.c | 1 + .../arm_svm_sigmoid_predict_f32.c | 6 +- Source/SupportFunctions/arm_barycenter_f32.c | 1 + Source/TransformFunctions/arm_dct4_init_f32.c | 5 +- Source/TransformFunctions/arm_dct4_init_q15.c | 4 +- Source/TransformFunctions/arm_dct4_init_q31.c | 5 +- 18 files changed, 98 insertions(+), 66 deletions(-) diff --git a/Examples/ARM/arm_matrix_example/arm_matrix_example_f32.c b/Examples/ARM/arm_matrix_example/arm_matrix_example_f32.c index 078b5472..9e0200bb 100644 --- a/Examples/ARM/arm_matrix_example/arm_matrix_example_f32.c +++ b/Examples/ARM/arm_matrix_example/arm_matrix_example_f32.c @@ -66,7 +66,6 @@ * * \par Block Diagram: * \par - * \image html matrixExample.gif * * \par Variables Description: * \par diff --git a/Include/arm_math.h b/Include/arm_math.h index 28ffdbf3..faf61c04 100644 --- a/Include/arm_math.h +++ b/Include/arm_math.h @@ -7002,6 +7002,7 @@ typedef struct /** * @brief SVM linear instance init function + * @param[in] S Parameters for SVM functions * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept @@ -7023,9 +7024,9 @@ void arm_svm_linear_init_f32(arm_svm_linear_instance_f32 *S, /** * @brief SVM linear prediction - * @param[in] *S points to an instance of the linear SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the linear SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ @@ -7037,6 +7038,7 @@ void arm_svm_linear_predict_f32(const arm_svm_linear_instance_f32 *S, /** * @brief SVM polynomial instance init function + * @param[in] S points to an instance of the polynomial SVM structure. * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept @@ -7065,9 +7067,9 @@ void arm_svm_polynomial_init_f32(arm_svm_polynomial_instance_f32 *S, /** * @brief SVM polynomial prediction - * @param[in] *S points to an instance of the polynomial SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the polynomial SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ @@ -7079,6 +7081,7 @@ void arm_svm_polynomial_predict_f32(const arm_svm_polynomial_instance_f32 *S, /** * @brief SVM radial basis function instance init function + * @param[in] S points to an instance of the polynomial SVM structure. * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept @@ -7102,9 +7105,9 @@ void arm_svm_rbf_init_f32(arm_svm_rbf_instance_f32 *S, /** * @brief SVM rbf prediction - * @param[in] *S points to an instance of the rbf SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the rbf SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ @@ -7115,6 +7118,7 @@ void arm_svm_rbf_predict_f32(const arm_svm_rbf_instance_f32 *S, /** * @brief SVM sigmoid instance init function + * @param[in] S points to an instance of the rbf SVM structure. * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept @@ -7140,9 +7144,9 @@ void arm_svm_sigmoid_init_f32(arm_svm_sigmoid_instance_f32 *S, /** * @brief SVM sigmoid prediction - * @param[in] *S points to an instance of the rbf SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the rbf SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ @@ -7168,9 +7172,9 @@ typedef struct /** * @brief Naive Gaussian Bayesian Estimator * - * @param[in] *S points to a naive bayes instance structure - * @param[in] *in points to the elements of the input vector. - * @param[in] *pBuffer points to a buffer of length numberOfClasses + * @param[in] S points to a naive bayes instance structure + * @param[in] in points to the elements of the input vector. + * @param[in] pBuffer points to a buffer of length numberOfClasses * @return The predicted class * */ @@ -7198,7 +7202,7 @@ uint32_t arm_gaussian_naive_bayes_predict_f32(const arm_gaussian_naive_bayes_ins * The max xm of the values if extracted and the function is computing: * xm + ln(exp(x1 - xm) + ... + exp(xn - xm)) * - * @param[in] *in points to an array of input values. + * @param[in] in points to an array of input values. * @param[in] blockSize number of samples in the input array. * @return LogSumExp * @@ -7212,10 +7216,10 @@ float32_t arm_logsumexp_f32(const float32_t *in, uint32_t blockSize); * * Vectors are containing the log of the samples * - * @param[in] *pSrcA points to the first input vector - * @param[in] *pSrcB points to the second input vector + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector * @param[in] blockSize number of samples in each vector - * @param[in] *pTmpBuffer temporary buffer of length blockSize + * @param[in] pTmpBuffer temporary buffer of length blockSize * @return The log of the dot product . * */ @@ -7229,7 +7233,7 @@ float32_t arm_logsumexp_dot_prod_f32(const float32_t * pSrcA, /** * @brief Entropy * - * @param[in] *pSrcA points to an array of input values. + * @param[in] pSrcA points to an array of input values. * @param[in] blockSize number of samples in the input array. * @return Entropy -Sum(p ln p) * @@ -7242,8 +7246,8 @@ float32_t arm_entropy_f32(const float32_t * pSrcA,uint32_t blockSize); /** * @brief Kullback-Leibler * - * @param[in] *pSrcA points to an array of input values for probaility distribution A. - * @param[in] *pSrcB points to an array of input values for probaility distribution B. + * @param[in] pSrcA points to an array of input values for probaility distribution A. + * @param[in] pSrcB points to an array of input values for probaility distribution B. * @param[in] blockSize number of samples in the input array. * @return Kullback-Leibler divergence D(A || B) * @@ -7257,8 +7261,8 @@ float32_t arm_kullback_leibler_f32(const float32_t * pSrcA * @brief Weighted sum * * - * @param[in] *in points to an array of input values. - * @param[in] *weigths weights + * @param[in] in points to an array of input values. + * @param[in] weigths weights * @param[in] blockSize number of samples in the input array. * @return Weighted sum * @@ -7272,9 +7276,9 @@ float32_t arm_weighted_sum_f32(const float32_t *in * @brief Barycenter * * - * @param[in] *in List of points - * @param[in] *in List of weights - * @param[out] *out Barycenter + * @param[in] in List of points + * @param[in] weights Weights of the points + * @param[out] out Barycenter * @param[in] nbVectors number of vectors * @param[in] vecDim Dimension of space * @return None @@ -7411,7 +7415,8 @@ float32_t arm_minkowski_distance_f32(const float32_t *pA,const float32_t *pB, in * * @param[in] pA First vector of packed booleans * @param[in] pB Second vector of packed booleans - * @param[in] numberOfBools Number of booleans + * @param[in] order Distance order + * @param[in] blockSize Number of samples * @return distance * */ diff --git a/Source/CommonTables/arm_common_tables.c b/Source/CommonTables/arm_common_tables.c index 4b49b341..7f7f79d0 100644 --- a/Source/CommonTables/arm_common_tables.c +++ b/Source/CommonTables/arm_common_tables.c @@ -48270,6 +48270,7 @@ const q15_t __ALIGNED(4) realCoefBQ15[8192] = { */ #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_DCT4_Q15_128) + const q15_t __ALIGNED(4) WeightsQ15_128[256] = { (q15_t)0x7fff, (q15_t)0x0, (q15_t)0x7ffd, (q15_t)0xfe6e, (q15_t)0x7ff6, (q15_t)0xfcdc, (q15_t)0x7fe9, (q15_t)0xfb4a, (q15_t)0x7fd8, (q15_t)0xf9b9, (q15_t)0x7fc2, (q15_t)0xf827, (q15_t)0x7fa7, (q15_t)0xf696, (q15_t)0x7f87, (q15_t)0xf505, diff --git a/Source/DistanceFunctions/arm_dice_distance.c b/Source/DistanceFunctions/arm_dice_distance.c index 1379c95b..34746977 100755 --- a/Source/DistanceFunctions/arm_dice_distance.c +++ b/Source/DistanceFunctions/arm_dice_distance.c @@ -36,6 +36,13 @@ * @{ */ +extern void arm_boolean_distance_TT_TF_FT(const uint32_t *pA + , const uint32_t *pB + , uint32_t numberOfBools + , uint32_t *cTT + , uint32_t *cTF + , uint32_t *cFT + ); /** * @brief Dice distance between two vectors @@ -46,13 +53,6 @@ * @return distance * */ -extern void arm_boolean_distance_TT_TF_FT(const uint32_t *pA - , const uint32_t *pB - , uint32_t numberOfBools - , uint32_t *cTT - , uint32_t *cTF - , uint32_t *cFT - ); float32_t arm_dice_distance(const uint32_t *pA, const uint32_t *pB, uint32_t numberOfBools) { diff --git a/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c b/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c index 6e808067..9dd47126 100755 --- a/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c +++ b/Source/DistanceFunctions/arm_jensenshannon_distance_f32.c @@ -37,6 +37,17 @@ */ +static inline double rel_entr(double x, double y) +{ + return (x * log(x / y)); +} + + +#if defined(ARM_MATH_NEON) + +#include "NEMath.h" + + /** * @brief Jensen-Shannon distance between two vectors * @@ -57,14 +68,6 @@ * */ -static inline double rel_entr(double x, double y) -{ - return (x * log(x / y)); -} - -#if defined(ARM_MATH_NEON) - -#include "NEMath.h" float32_t arm_jensenshannon_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize) { @@ -127,6 +130,27 @@ float32_t arm_jensenshannon_distance_f32(const float32_t *pA,const float32_t *pB #else +/** + * @brief Jensen-Shannon distance between two vectors + * + * This function is assuming that elements of second vector are > 0 + * and 0 only when the corresponding element of first vector is 0. + * Otherwise the result of the computation does not make sense + * and for speed reasons, the cases returning NaN or Infinity are not + * managed. + * + * When the function is computing x log (x / y) with x == 0 and y == 0, + * it will compute the right result (0) but a division by zero will occur + * and should be ignored in client code. + * + * @param[in] pA First vector + * @param[in] pB Second vector + * @param[in] blockSize vector length + * @return distance + * + */ + + float32_t arm_jensenshannon_distance_f32(const float32_t *pA,const float32_t *pB, uint32_t blockSize) { float32_t left, right,sum, result, tmp; diff --git a/Source/DistanceFunctions/arm_minkowski_distance_f32.c b/Source/DistanceFunctions/arm_minkowski_distance_f32.c index dfe5b34c..c682c1d8 100755 --- a/Source/DistanceFunctions/arm_minkowski_distance_f32.c +++ b/Source/DistanceFunctions/arm_minkowski_distance_f32.c @@ -42,8 +42,8 @@ * * @param[in] pA First vector * @param[in] pB Second vector - * @param[in] n Norm order (>= 2) - * @param[in] blockSize vector length + * @param[in] order Distance order + * @param[in] blockSize Number of samples * @return distance * */ diff --git a/Source/SVMFunctions/arm_svm_linear_init_f32.c b/Source/SVMFunctions/arm_svm_linear_init_f32.c index e1d3753d..49c215a5 100755 --- a/Source/SVMFunctions/arm_svm_linear_init_f32.c +++ b/Source/SVMFunctions/arm_svm_linear_init_f32.c @@ -47,6 +47,7 @@ /** * @brief SVM linear instance init function + * @param[in] S Parameters for the SVM function * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept diff --git a/Source/SVMFunctions/arm_svm_linear_predict_f32.c b/Source/SVMFunctions/arm_svm_linear_predict_f32.c index 66561262..3ae6d563 100755 --- a/Source/SVMFunctions/arm_svm_linear_predict_f32.c +++ b/Source/SVMFunctions/arm_svm_linear_predict_f32.c @@ -37,9 +37,9 @@ /** * @brief SVM linear prediction - * @param[in] *S points to an instance of the linear SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the linear SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ diff --git a/Source/SVMFunctions/arm_svm_polynomial_init_f32.c b/Source/SVMFunctions/arm_svm_polynomial_init_f32.c index 07b46f30..fdc11b7c 100755 --- a/Source/SVMFunctions/arm_svm_polynomial_init_f32.c +++ b/Source/SVMFunctions/arm_svm_polynomial_init_f32.c @@ -38,6 +38,7 @@ /** * @brief SVM polynomial instance init function + * @param[in] S points to an instance of the polynomial SVM structure. * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept diff --git a/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c b/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c index 2bbee7e8..07cff6af 100755 --- a/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c +++ b/Source/SVMFunctions/arm_svm_polynomial_predict_f32.c @@ -38,9 +38,9 @@ /** * @brief SVM polynomial prediction - * @param[in] *S points to an instance of the polynomial SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the polynomial SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ diff --git a/Source/SVMFunctions/arm_svm_rbf_init_f32.c b/Source/SVMFunctions/arm_svm_rbf_init_f32.c index ffbee3ae..2ed7017d 100755 --- a/Source/SVMFunctions/arm_svm_rbf_init_f32.c +++ b/Source/SVMFunctions/arm_svm_rbf_init_f32.c @@ -37,6 +37,7 @@ /** * @brief SVM radial basis function instance init function + * @param[in] S points to an instance of the polynomial SVM structure. * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept diff --git a/Source/SVMFunctions/arm_svm_rbf_predict_f32.c b/Source/SVMFunctions/arm_svm_rbf_predict_f32.c index 3cce8967..178114dc 100755 --- a/Source/SVMFunctions/arm_svm_rbf_predict_f32.c +++ b/Source/SVMFunctions/arm_svm_rbf_predict_f32.c @@ -37,9 +37,9 @@ /** * @brief SVM rbf prediction - * @param[in] *S points to an instance of the rbf SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the rbf SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ diff --git a/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c b/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c index a4878687..e9c39b92 100755 --- a/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c +++ b/Source/SVMFunctions/arm_svm_sigmoid_init_f32.c @@ -37,6 +37,7 @@ /** * @brief SVM sigmoid instance init function + * @param[in] S points to an instance of the rbf SVM structure. * @param[in] nbOfSupportVectors Number of support vectors * @param[in] vectorDimension Dimension of vector space * @param[in] intercept Intercept diff --git a/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c b/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c index 078bc282..ba3bab92 100755 --- a/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c +++ b/Source/SVMFunctions/arm_svm_sigmoid_predict_f32.c @@ -37,9 +37,9 @@ /** * @brief SVM sigmoid prediction - * @param[in] *S points to an instance of the rbf SVM structure. - * @param[in] vec_in pointer to input vector - * @param[out] *pResult decision value + * @param[in] S points to an instance of the rbf SVM structure. + * @param[in] in pointer to input vector + * @param[out] pResult decision value * @return none. * */ diff --git a/Source/SupportFunctions/arm_barycenter_f32.c b/Source/SupportFunctions/arm_barycenter_f32.c index 92fdf06f..ce1d959b 100755 --- a/Source/SupportFunctions/arm_barycenter_f32.c +++ b/Source/SupportFunctions/arm_barycenter_f32.c @@ -39,6 +39,7 @@ * * * @param[in] *in List of points + * @param[in] *weights Weights of the points * @param[out] *out Barycenter * @param[in] nbVectors number of vectors * @param[in] vecDim Dimension of space diff --git a/Source/TransformFunctions/arm_dct4_init_f32.c b/Source/TransformFunctions/arm_dct4_init_f32.c index 3fd70e92..42b9df0e 100644 --- a/Source/TransformFunctions/arm_dct4_init_f32.c +++ b/Source/TransformFunctions/arm_dct4_init_f32.c @@ -30,11 +30,10 @@ #include "arm_common_tables.h" /** - @ingroup DCT4_IDCT4 + @ingroup groupTransforms */ - -/** + /** @addtogroup DCT4_IDCT4 @{ */ diff --git a/Source/TransformFunctions/arm_dct4_init_q15.c b/Source/TransformFunctions/arm_dct4_init_q15.c index 3c551926..52ba8cc7 100644 --- a/Source/TransformFunctions/arm_dct4_init_q15.c +++ b/Source/TransformFunctions/arm_dct4_init_q15.c @@ -30,10 +30,10 @@ #include "arm_common_tables.h" /** - @ingroup DCT4_IDCT4 + @ingroup groupTransforms */ -/** + /** @addtogroup DCT4_IDCT4 @{ */ diff --git a/Source/TransformFunctions/arm_dct4_init_q31.c b/Source/TransformFunctions/arm_dct4_init_q31.c index f5cc78b5..954ebcf3 100644 --- a/Source/TransformFunctions/arm_dct4_init_q31.c +++ b/Source/TransformFunctions/arm_dct4_init_q31.c @@ -30,11 +30,10 @@ #include "arm_common_tables.h" /** - @ingroup DCT4_IDCT4 + @ingroup groupTransforms */ - -/** + /** @addtogroup DCT4_IDCT4 @{ */