Beispiel #1
0
double NOX::LAPACK::Vector::norm(NOX::Abstract::Vector::NormType type) const
{

  if (n == 0)
    return 0.0;

  int i;            // counter
  double value;            // final answer

  switch (type) {
  case MaxNorm:
    value = fabs(x[0]);
    for (i = 1; i < n; i ++)
      if (value < fabs(x[i]))
    value = fabs(x[i]);
    break;
  case OneNorm:
    value = DASUM_F77(&n, &x[0], &i_one);
    break;
  case TwoNorm:
  default:
    value = DNRM2_F77(&n, &x[0], &i_one);
   break;
  }

  return value;
}
//=============================================================================
double Epetra_BLAS::NRM2(const int N, const double * X, const int INCX) const {
  return(DNRM2_F77(&N, X, &INCX));
}
Beispiel #3
0
 double BLAS<int, double>::NRM2(const int n, const double* x, const int incx) const
 { return DNRM2_F77(&n, x, &incx); }