Changeset 7166ef8 for src/fvec.c


Ignore:
Timestamp:
Sep 5, 2015, 11:05:43 AM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
8982328
Parents:
6c8ef58
Message:

src/fvec.{c,h}: add fvec_weighted_copy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/fvec.c

    r6c8ef58 r7166ef8  
    122122}
    123123
     124void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out) {
     125#ifndef HAVE_ACCELERATE
     126  uint_t j;
     127  uint_t length = MIN(s->length, weight->length);
     128  for (j=0; j< length; j++) {
     129    out->data[j] = in->data[j] * weight->data[j];
     130  }
     131#else
     132  aubio_vDSP_vmul(in->data, 1, weight->data, 1, out->data, 1, out->length);
     133#endif /* HAVE_ACCELERATE */
     134}
     135
    124136void fvec_copy(fvec_t *s, fvec_t *t) {
    125137  if (s->length != t->length) {
Note: See TracChangeset for help on using the changeset viewer.