Logo Search packages:      
Sourcecode: aubio version File versions  Download package

uint_t vec_min_elem ( fvec_t s  ) 

returns the index of the min of a vector

Bug:
mono

Definition at line 126 of file mathutils.c.

References _fvec_t::channels, _fvec_t::data, and _fvec_t::length.

{
  uint_t i,j=0, pos=0.;
  smpl_t tmp = s->data[0][0];
  for (i=0; i < s->channels; i++)
    for (j=0; j < s->length; j++) {
      pos = (tmp < s->data[i][j])? pos : j;
      tmp = (tmp < s->data[i][j])? tmp : s->data[i][j]  ;
    }
  return pos;
}


Generated by  Doxygen 1.6.0   Back to index