Files
cppdraft_translate/cppdraft/linalg/algs/blas1/iamax.md
2025-10-25 03:02:53 +03:00

2.1 KiB
Raw Blame History

[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.5Argument 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.5Argument concepts[linalg.helpers.concepts]") InVec> typename InVec::extents_type vector_idx_abs_max(ExecutionPolicy&& exec, InVec v);

1

#

[Note 1:

These functions correspond to the BLAS function IxAMAX[bib].

— end note]

2

#

Let T bedecltype(abs-if-needed(real-if-needed(declval())) +abs-if-needed(imag-if-needed(declval())))

3

#

Mandates: declval() < declval() is a valid expression.

4

#

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.