11#ifndef TLAPACK_BLAS_IAMAX_HH
12#define TLAPACK_BLAS_IAMAX_HH
67template <TLAPACK_VECTOR vector_t,
class abs_f>
77 const idx_t n = size(
x);
93 for (idx_t
k = i + 1;
k < n; ++
k) {
157template <TLAPACK_VECTOR vector_t,
class abs_f>
167 const idx_t n = size(
x);
170 if (n <= 0)
return 0;
211 return (index != idx_t(-1)) ? index : 0;
233template <TLAPACK_VECTOR vector_t,
class abs_f>
244template <TLAPACK_VECTOR vector_t, disable_if_allow_optblas_t<vector_t> = 0>
245size_type<vector_t>
iamax(
const vector_t& x)
247 using T = type_t<vector_t>;
248 using real_t = real_type<T>;
250 return iamax(x, IamaxOpts([](
const T& x) -> real_t {
return abs1(x); }));
253#ifdef TLAPACK_USE_LAPACKPP
256 enable_if_allow_optblas_t<vector_t> = 0>
257size_type<vector_t>
iamax(vector_t
const& x)
260 auto x_ = legacy_vector(x);
263 const auto& n = x_.n;
265 return ::blas::iamax(n, x_.ptr, x_.inc);
constexpr bool isnan(const T &x) noexcept
Extends std::isnan() to complex numbers.
Definition utils.hpp:125
constexpr bool isinf(const T &x) noexcept
Extends std::isinf() to complex numbers.
Definition utils.hpp:117
#define TLAPACK_LEGACY_VECTOR
Macro for tlapack::concepts::LegacyVector compatible with C++17.
Definition concepts.hpp:954
size_type< vector_t > iamax(const vector_t &x, const IamaxOpts< abs_f > &opts)
Return .
Definition iamax.hpp:234
size_type< vector_t > iamax_ec(const vector_t &x, abs_f absf)
Return .
Definition iamax.hpp:68
size_type< vector_t > iamax_nc(const vector_t &x, abs_f absf)
Return .
Definition iamax.hpp:158
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113
Options for error checking.
Definition exceptionHandling.hpp:76
Options for iamax.
Definition iamax.hpp:37
abs_f absf
Absolute value function In reference BLAS, absf(a) := |Re(a)| + |Im(a)|.
Definition iamax.hpp:41