2.1 KiB
[linalg.algs.blas1.iamax]
29 Numerics library [numerics]
29.9 Basic linear algebra algorithms [linalg]
29.9.13 BLAS 1 algorithms [linalg.algs.blas1]
29.9.13.11 Index of maximum absolute value of vector elements [linalg.algs.blas1.iamax]
template<[in-vector](linalg.helpers.concepts#concept:in-vector "29.9.7.5 Argument concepts [linalg.helpers.concepts]") InVec> typename InVec::extents_type vector_idx_abs_max(InVec v); template<class ExecutionPolicy, [in-vector](linalg.helpers.concepts#concept:in-vector "29.9.7.5 Argument concepts [linalg.helpers.concepts]") InVec> typename InVec::extents_type vector_idx_abs_max(ExecutionPolicy&& exec, InVec v);
[Note 1:
These functions correspond to the BLAS function IxAMAX[bib].
â end note]
Let T bedecltype(abs-if-needed(real-if-needed(declval())) +abs-if-needed(imag-if-needed(declval())))
Mandates: declval() < declval() is a valid expression.
Returns:
numeric_limits<typename InVec::size_type>::max() if v has zero elements;
otherwise, the index of the first element of v having largest absolute value, if InVec::value_type is an arithmetic type;
otherwise, the index of the first element ve of v for whichabs-if-needed(real-if-needed(ve)) + abs-if-needed(imag-if-needed(ve)) has the largest value.