Esempio n. 1
0
  float BLAS<int, float>::ASUM(const int n, const float* x, const int incx) const
  {
    typedef ScalarTraits<float> ST;
#ifdef HAVE_TEUCHOS_BLASFLOAT
    float tmp = SASUM_F77(&n, x, &incx);
    return tmp;
#else
    float sum = 0.0;
    if (incx == 1) {
      for (int i = 0; i < n; ++i)
        sum += ST::magnitude(*x++);
    }
    else {
      for (int i = 0; i < n; ++i, x+=incx)
        sum += ST::magnitude(*x);
    }
    return sum;
#endif
  }
Esempio n. 2
0
//=============================================================================
float Epetra_BLAS::ASUM(const int N, const float * X, const int INCX) const {
 return(SASUM_F77(&N, X, &INCX));
}