source: src/vecutils.c @ 3d2e481

sampler
Last change on this file since 3d2e481 was b155ed03, checked in by Paul Brossier <piem@piem.org>, 11 years ago

src/vecutils.*: remove cvec functions for clarity

  • Property mode set to 100644
File size: 749 bytes
Line 
1#include "config.h"
2#include "aubio_priv.h"
3#include "types.h"
4#include "fvec.h"
5#include "cvec.h"
6#include "vecutils.h"
7
8#define AUBIO_OP(OPNAME, OP, TYPE, OBJ) \
9void TYPE ## _ ## OPNAME (TYPE ## _t *o) \
10{ \
11  uint_t j; \
12  for (j = 0; j < o->length; j++) { \
13    o->OBJ[j] = OP (o->OBJ[j]); \
14  } \
15}
16
17#define AUBIO_OP_C(OPNAME, OP) \
18  AUBIO_OP(OPNAME, OP, fvec, data)
19
20AUBIO_OP_C(exp, EXP)
21AUBIO_OP_C(cos, COS)
22AUBIO_OP_C(sin, SIN)
23AUBIO_OP_C(abs, ABS)
24AUBIO_OP_C(sqrt, SQRT)
25AUBIO_OP_C(log10, SAFE_LOG10)
26AUBIO_OP_C(log, SAFE_LOG)
27AUBIO_OP_C(floor, FLOOR)
28AUBIO_OP_C(ceil, CEIL)
29AUBIO_OP_C(round, ROUND)
30
31void fvec_pow (fvec_t *s, smpl_t power)
32{
33  uint_t j;
34  for (j = 0; j < s->length; j++) {
35    s->data[j] = POW(s->data[j], power);
36  }
37}
Note: See TracBrowser for help on using the repository browser.