Changeset ee8a57c


Ignore:
Timestamp:
Mar 10, 2017, 5:17:33 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
Children:
e149aa9
Parents:
155cc10
Message:

src/mathutils.h: add fvec_push

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r155cc10 ree8a57c  
    290290}
    291291
     292void fvec_push(fvec_t *in, smpl_t new_elem) {
     293  uint_t i;
     294  for (i = 0; i < in->length - 1; i++) {
     295    in->data[i] = in->data[i + 1];
     296  }
     297  in->data[in->length - 1] = new_elem;
     298}
     299
    292300smpl_t
    293301aubio_level_lin (const fvec_t * f)
  • src/mathutils.h

    r155cc10 ree8a57c  
    117117*/
    118118void fvec_ishift (fvec_t * v);
     119
     120/** push a new element to the end of a vector, erasing the first element and
     121 * sliding all others
     122
     123  \param in vector to push to
     124  \param new_elem new_element to add at the end of the vector
     125
     126  In numpy words, this is equivalent to: in = np.concatenate([in, [new_elem]])[1:]
     127
     128*/
     129void fvec_push(fvec_t *in, smpl_t new_elem);
    119130
    120131/** compute the sum of all elements of a vector
Note: See TracChangeset for help on using the changeset viewer.