From b155ed0312ee4f3e5ef1122ad106d7317af3d5b4 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 17 Dec 2013 10:42:20 -0500 Subject: [PATCH] src/vecutils.*: remove cvec functions for clarity --- src/vecutils.c | 36 +++++-------- src/vecutils.h | 158 +-------------------------------------------------------- 2 files changed, 13 insertions(+), 181 deletions(-) diff --git a/src/vecutils.c b/src/vecutils.c index 78f3b770..8e49f96b 100644 --- a/src/vecutils.c +++ b/src/vecutils.c @@ -14,23 +14,20 @@ void TYPE ## _ ## OPNAME (TYPE ## _t *o) \ } \ } -#define AUBIO_OP_C_AND_F(OPNAME, OP) \ - AUBIO_OP(OPNAME, OP, fvec, data) \ - AUBIO_OP(norm ## _ ## OPNAME, OP, cvec, norm) \ - AUBIO_OP(phas ## _ ## OPNAME, OP, cvec, phas) +#define AUBIO_OP_C(OPNAME, OP) \ + AUBIO_OP(OPNAME, OP, fvec, data) -AUBIO_OP_C_AND_F(exp, EXP) -AUBIO_OP_C_AND_F(cos, COS) -AUBIO_OP_C_AND_F(sin, SIN) -AUBIO_OP_C_AND_F(abs, ABS) -AUBIO_OP_C_AND_F(sqrt, SQRT) -AUBIO_OP_C_AND_F(log10, SAFE_LOG10) -AUBIO_OP_C_AND_F(log, SAFE_LOG) -AUBIO_OP_C_AND_F(floor, FLOOR) -AUBIO_OP_C_AND_F(ceil, CEIL) -AUBIO_OP_C_AND_F(round, ROUND) +AUBIO_OP_C(exp, EXP) +AUBIO_OP_C(cos, COS) +AUBIO_OP_C(sin, SIN) +AUBIO_OP_C(abs, ABS) +AUBIO_OP_C(sqrt, SQRT) +AUBIO_OP_C(log10, SAFE_LOG10) +AUBIO_OP_C(log, SAFE_LOG) +AUBIO_OP_C(floor, FLOOR) +AUBIO_OP_C(ceil, CEIL) +AUBIO_OP_C(round, ROUND) -//AUBIO_OP_C_AND_F(pow, POW) void fvec_pow (fvec_t *s, smpl_t power) { uint_t j; @@ -38,12 +35,3 @@ void fvec_pow (fvec_t *s, smpl_t power) s->data[j] = POW(s->data[j], power); } } - -void cvec_pow (cvec_t *s, smpl_t power) -{ - uint_t j; - for (j = 0; j < s->length; j++) { - s->norm[j] = POW(s->norm[j], power); - } -} - diff --git a/src/vecutils.h b/src/vecutils.h index 30bb5e5a..7e698492 100644 --- a/src/vecutils.h +++ b/src/vecutils.h @@ -20,7 +20,7 @@ /** \file - Utility functions for ::fvec_t and ::cvec_t objects + Utility functions for ::fvec_t */ @@ -109,162 +109,6 @@ void fvec_round (fvec_t *s); */ void fvec_pow (fvec_t *s, smpl_t pow); -/** compute \f$e^x\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_exp (cvec_t *s); - -/** compute \f$cos(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_cos (cvec_t *s); - -/** compute \f$sin(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_sin (cvec_t *s); - -/** compute the \f$abs(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_abs (cvec_t *s); - -/** compute the \f$sqrt(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_sqrt (cvec_t *s); - -/** compute the \f$log10(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_log10 (cvec_t *s); - -/** compute the \f$log(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_log (cvec_t *s); - -/** compute the \f$floor(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_floor (cvec_t *s); - -/** compute the \f$ceil(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_ceil (cvec_t *s); - -/** compute the \f$round(x)\f$ of each vector norm elements - - \param s vector to modify - -*/ -void cvec_norm_round (cvec_t *s); - -/** raise each vector norm elements to the power pow - - \param s vector to modify - \param pow power to raise to - -*/ -void cvec_norm_pow (cvec_t *s, smpl_t pow); - -/** compute \f$e^x\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_exp (cvec_t *s); - -/** compute \f$cos(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_cos (cvec_t *s); - -/** compute \f$sin(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_sin (cvec_t *s); - -/** compute the \f$abs(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_abs (cvec_t *s); - -/** compute the \f$sqrt(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_sqrt (cvec_t *s); - -/** compute the \f$log10(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_log10 (cvec_t *s); - -/** compute the \f$log(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_log (cvec_t *s); - -/** compute the \f$floor(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_floor (cvec_t *s); - -/** compute the \f$ceil(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_ceil (cvec_t *s); - -/** compute the \f$round(x)\f$ of each vector phas elements - - \param s vector to modify - -*/ -void cvec_phas_round (cvec_t *s); - -/** raise each vector phas elements to the power pow - - \param s vector to modify - \param pow power to raise to - -*/ -void cvec_phas_pow (cvec_t *s, smpl_t pow); - #ifdef __cplusplus } #endif -- 2.11.0