Changeset 012466b


Ignore:
Timestamp:
Sep 26, 2009, 4:44:00 AM (15 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, pitchshift, sampler, timestretch, yinfft+
Children:
342e3807
Parents:
9e0dd58
Message:

src/cvec.{c,h}: add cvec_set, cvec_zeros and cvec_ones

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.c

    r9e0dd58 r012466b  
    100100}
    101101
     102void cvec_set(cvec_t *s, smpl_t val) {
     103  uint_t i,j;
     104  for (i=0; i< s->channels; i++) {
     105    for (j=0; j< s->length; j++) {
     106      s->norm[i][j] = val;
     107    }
     108  }
     109}
     110
     111void cvec_zeros(cvec_t *s) {
     112  cvec_set(s, 0.);
     113}
     114
     115void cvec_ones(cvec_t *s) {
     116  cvec_set(s, 1.);
     117}
     118
  • src/cvec.h

    r9e0dd58 r012466b  
    189189void cvec_print(cvec_t *s);
    190190
     191/** set all elements to a given value
     192
     193  \param s vector to modify
     194  \param val value to set elements to
     195
     196*/
     197void cvec_set(cvec_t *s, smpl_t val);
     198
     199/** set all elements to zero
     200
     201  \param s vector to modify
     202
     203*/
     204void cvec_zeros(cvec_t *s);
     205
     206/** set all elements to ones
     207
     208  \param s vector to modify
     209
     210*/
     211void cvec_ones(cvec_t *s);
     212
    191213#ifdef __cplusplus
    192214}
Note: See TracChangeset for help on using the changeset viewer.