Changeset e11c14d4
- Timestamp:
- Dec 29, 2021, 5:51:41 PM (3 years ago)
- Branches:
- feature/cnn, feature/crepe
- Children:
- 1fe822d
- Parents:
- 808c6ac5
- git-author:
- Paul Brossier <piem@piem.org> (12/30/18 15:24:23)
- git-committer:
- Paul Brossier <piem@piem.org> (12/29/21 17:51:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fmat.c
r808c6ac5 re11c14d4 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.