Beispiel #1
0
double
VectorMinD(const double* src, unsigned length)
{
    double res = DBL_MAX;
#ifdef __APPLE__
    // Use the Accelerate framework if we have it
    vDSP_minvD(src, 1, &res, length);
#else
    for (unsigned i = 0; i < length; ++i)
    {
        if (src[i] < res)
        {
            res = src[i];
        }
    }
#endif
    return res;
}
Beispiel #2
0
smpl_t
fvec_min (fvec_t * s)
{
#ifndef HAVE_ACCELERATE
  uint_t j;
  smpl_t tmp = s->data[0];
  for (j = 0; j < s->length; j++) {
    tmp = (tmp < s->data[j]) ? tmp : s->data[j];
  }
#else
  smpl_t tmp = 0.;
#if !HAVE_AUBIO_DOUBLE
  vDSP_minv(s->data, 1, &tmp, s->length);
#else
  vDSP_minvD(s->data, 1, &tmp, s->length);
#endif
#endif
  return tmp;
}