Changeset 923a7a8 for src/fmat.c
- Timestamp:
- Nov 26, 2013, 4:44:17 AM (10 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 39a7b26
- Parents:
- 2dbcafa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fmat.c
r2dbcafa r923a7a8 87 87 88 88 void fmat_zeros(fmat_t *s) { 89 #if HAVE_MEMCPY_HACKS 90 memset(s->data, 0, s->height * s->length * sizeof(smpl_t)); 91 #else 89 92 fmat_set(s, 0.); 93 #endif 90 94 } 91 95 … … 114 118 115 119 void fmat_copy(fmat_t *s, fmat_t *t) { 116 uint_t i,j;117 uint_t height = MIN(s->height, t->height);118 uint_t length = MIN(s->length, t->length);119 120 if (s->height != t->height) { 120 AUBIO_ERR(" warning, trying to copy %d rows to %d rows \n",121 AUBIO_ERR("trying to copy %d rows to %d rows \n", 121 122 s->height, t->height); 123 return; 122 124 } 123 125 if (s->length != t->length) { 124 AUBIO_ERR(" warning, trying to copy %d columns to %d columns\n",126 AUBIO_ERR("trying to copy %d columns to %d columns\n", 125 127 s->length, t->length); 128 return; 126 129 } 127 for (i=0; i< height; i++) { 128 for (j=0; j< length; j++) { 130 #if HAVE_MEMCPY_HACKS 131 memcpy(t->data, s->data, t->height * t->length * sizeof(smpl_t)); 132 #else 133 uint_t i,j; 134 for (i=0; i< t->height; i++) { 135 for (j=0; j< t->length; j++) { 129 136 t->data[i][j] = s->data[i][j]; 130 137 } 131 138 } 139 #endif 132 140 } 133 141
Note: See TracChangeset
for help on using the changeset viewer.