#include <aubio.h>
+#include <assert.h>
-int main(){
- uint_t length = 1024; /* length */
- uint_t height = 1024; /* height */
- fmat_t * mat = new_fmat (length, height); /* input buffer */
- fmat_print(mat);
- del_fmat(mat);
- return 0;
+// create a new matrix and fill it with i * 1. + j * .1, where i is the row,
+// and j the column.
+
+int main ()
+{
+ uint_t height = 3, length = 9, i, j;
+ // create fmat_t object
+ fmat_t * mat = new_fmat (length, height);
+ for ( i = 0; i < mat->height; i++ ) {
+ for ( j = 0; j < mat->length; j++ ) {
+ // all elements are already initialized to 0.
+ assert(mat->data[i][j] == 0);
+ // setting element of row i, column j
+ mat->data[i][j] = i * 1. + j *.1;
+ }
+ }
+ // print out matrix
+ fmat_print(mat);
+ // destroy it
+ del_fmat(mat);
+ return 0;
}