source: tests/src/test-fvec.c @ b65230a

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since b65230a was 986131d, checked in by Eduard Müller <mueller.eduard@googlemail.com>, 7 years ago

Intel IPP support for aubio

See emuell/aubio/ intel_ipp2 for details please

  • Property mode set to 100644
File size: 886 bytes
RevLine 
[332487b]1#include "aubio.h"
2#include "utils_tests.h"
[4e9101e]3
[158e031]4int main (void)
[7e35b37]5{
[986131d]6  aubio_init();
7
[7e35b37]8  uint_t vec_size = 10, i;
9  fvec_t * vec = new_fvec (vec_size);
[4e9101e]10
[7e35b37]11  // vec->length matches requested size
12  assert(vec->length == vec_size);
[c251b80]13
[7e35b37]14  // all elements are initialized to `0.`
15  for ( i = 0; i < vec->length; i++ ) {
16    assert(vec->data[i] == 0.);
17  }
[c251b80]18
[7e35b37]19  // all elements can be set to `0.`
20  fvec_zeros(vec);
21  for ( i = 0; i < vec->length; i++ ) {
22    assert(vec->data[i] == 0.);
23  }
24  fvec_print(vec);
[c251b80]25
[7e35b37]26  // all elements can be set to `1.`
27  fvec_ones(vec);
28  for ( i = 0; i < vec->length; i++ ) {
29    assert(vec->data[i] == 1.);
30  }
31  fvec_print(vec);
32
33  // each element can be accessed directly
34  for ( i = 0; i < vec->length; i++ ) {
35    vec->data[i] = i;
36    assert(vec->data[i] == i);
37  }
38  fvec_print(vec);
39
40  // now destroys the vector
41  del_fvec(vec);
[c251b80]42
[986131d]43  aubio_cleanup();
44
[c251b80]45  return 0;
[4e9101e]46}
47
Note: See TracBrowser for help on using the repository browser.