infinity_norm [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:algorithms Component type:function
Prototype
template <class LinalgObj>
linalg_traits<LinalgObj>::magnitude_type infinity_norm(const LinalgObj& A) ;
Description
For matrices, the maximum of the row sums. For vectors, the maximum absolute value of any of its element.
Definition
mtl.h
Requirements on types
  • The vector or matrix must have an associated magnitude_type that is the type of the absolute value of its value_type.
  • There must be abs() defined for Vector::value_type.
  • The addition must be defined for magnitude_type.
Preconditions
Complexity
O(n) for vectors, O(m*n) for dense matrices, O(nnz) for sparse
Example
In vec_inf_norm.cc:
  mtl::dense1D< double > x(10, 2.0);
  double s = mtl::infinity_norm(x);
  cout << s << endl;

Notes
See also

[MTL Home] Copyright © 1998,1999 University of Notre Dame. All Rights Reserved.