source: tests/src/test-fmat.c @ 845c435

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 845c435 was 7e35b37, checked in by Paul Brossier <piem@piem.org>, 12 years ago

tests/src/: improve examples

  • Property mode set to 100644
File size: 615 bytes
Line 
1#include <aubio.h>
2#include <assert.h>
3
4// create a new matrix and fill it with i * 1. + j * .1, where i is the row,
5// and j the column.
6
7int main ()
8{
9  uint_t height = 3, length = 9, i, j;
10  // create fmat_t object
11  fmat_t * mat = new_fmat (length, height);
12  for ( i = 0; i < mat->height; i++ ) {
13    for ( j = 0; j < mat->length; j++ ) {
14      // all elements are already initialized to 0.
15      assert(mat->data[i][j] == 0);
16      // setting element of row i, column j
17      mat->data[i][j] = i * 1. + j *.1;
18    }
19  }
20  // print out matrix
21  fmat_print(mat);
22  // destroy it
23  del_fmat(mat);
24  return 0;
25}
26
Note: See TracBrowser for help on using the repository browser.