| ||||||
| ||||||
| Prototype | ||||||
|
template <class Vec> Vec::size_type max_index(const Vec& x) ; | ||||||
| Description | ||||||
| The location (index) of the element with the maximum absolute value. | ||||||
| Definition | ||||||
| mtl.h | ||||||
| Requirements on types | ||||||
| ||||||
| Preconditions | ||||||
|
| ||||||
| Complexity | ||||||
| O(n) | ||||||
| Example | ||||||
In max_index.cc:
typedef external_vec<float> Vec; const int N = 5; float dx[] = { 5.0, -3.0,-4.0, 6.0 , 0.0 }; Vec x(dx, N); int imax = max_index(x); | ||||||
| Notes | ||||||
| See also | ||||||

Copyright ©
1998,1999 University of Notre Dame. All Rights Reserved.