Changeset f7bfc5d


Ignore:
Timestamp:
Jan 7, 2019, 10:19:48 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn_org, feature/crepe_org
Children:
f3848c0
Parents:
71655fee
Message:

[fvec] add fvec_vecadd

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/fvec.c

    r71655fee rf7bfc5d  
    9999}
    100100
     101void fvec_vecadd(fvec_t *s, const fvec_t *bias) {
     102  uint_t j;
     103  uint_t length = MIN(s->length, bias->length);
     104  for (j = 0; j < length; j++) {
     105    s->data[j] += bias->data[j];
     106  }
     107}
     108
    101109void fvec_weight(fvec_t *s, const fvec_t *weight) {
    102110  uint_t length = MIN(s->length, weight->length);
  • src/fvec.h

    r71655fee rf7bfc5d  
    144144void fvec_rev(fvec_t *s);
    145145
     146/** add a vector b to vector a, modifying a
     147
     148  \param a  input vector to add b to
     149  \param b  input vector of the values to be added to a
     150
     151  Upon return, he content of a[i] will be set to a[i] + b[i].
     152
     153*/
     154void fvec_vecadd(fvec_t *a, const fvec_t *b);
     155
    146156/** apply weight to vector
    147157
Note: See TracChangeset for help on using the changeset viewer.