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


Category:algorithms Component type:function
Prototype
template <class Vec>
Vec::value_type max(const Vec& x) ;
Description
Returns the value of the element with the maximum value
Definition
mtl.h
Requirements on types
  • Vec::value_type must be LessThanComparible.
Preconditions
Complexity
O(n)
Example
In vec_max.cc:
  mtl::dense1D<float> x(10, 0.0);
  x[5] = 1.0;
  float s = mtl::max(x);

Notes
See also

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