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


Category:algorithms Component type:function
Prototype
template <class LinalgObj>
linalg_traits<LinalgObj>::magnitude_type one_norm(const LinalgObj& A) ;
Description
For vectors, the sum of the absolute values of the elements. For matrices, the maximum of the column sums. Note: not implemented yet for unit triangle matrices. is the type of the absolute value of its value_type.
Definition
mtl.h
Requirements on types
  • The vector or matrix must have an associated magnitude_type that
  • There must be abs() defined for Vector::value_type.
  • The addition must be defined for magnitude_type.
Preconditions
Complexity
O(n)
Example
In vec_one_norm.cc:
  typedef complex<double> cplx_d;
  dense1D< cplx_d > x(10, cplx_d(2.0, 1.0));
  double s = one_norm(x);
  cout << s << endl;

Notes
See also

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