- Timestamp:
- Dec 30, 2018, 3:24:23 PM (6 years ago)
- Branches:
- feature/cnn_org, feature/crepe_org
- Children:
- 4c33f81
- Parents:
- c1c3a99
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fmat.c
rc1c3a99 r1fcd392 24 24 fmat_t * new_fmat (uint_t height, uint_t length) { 25 25 fmat_t * s; 26 uint_t i ,j;26 uint_t i; 27 27 if ((sint_t)length <= 0 || (sint_t)height <= 0 ) { 28 28 return NULL; … … 32 32 s->length = length; 33 33 s->data = AUBIO_ARRAY(smpl_t*,s->height); 34 for (i=0; i< s->height; i++) { 35 s->data[i] = AUBIO_ARRAY(smpl_t, s->length); 36 for (j=0; j< s->length; j++) { 37 s->data[i][j]=0.; 38 } 34 s->data[0] = AUBIO_ARRAY(smpl_t, s->length * s->height); 35 for (i=1; i< s->height; i++) { 36 s->data[i] = s->data[0] + i * s->length; 39 37 } 40 38 return s; … … 42 40 43 41 void del_fmat (fmat_t *s) { 44 uint_t i;45 for (i=0; i<s->height; i++) {46 AUBIO_FREE(s->data[ i]);47 }48 AUBIO_FREE(s->data);42 AUBIO_ASSERT(s); 43 if (s->data[0]) 44 AUBIO_FREE(s->data[0]); 45 if (s->data) 46 AUBIO_FREE(s->data); 49 47 AUBIO_FREE(s); 50 48 }
Note: See TracChangeset
for help on using the changeset viewer.