3#ifndef TETL_LINALG_BLAS1_VECTOR_IDX_ABS_MAX_HPP
4#define TETL_LINALG_BLAS1_VECTOR_IDX_ABS_MAX_HPP
14template <in_vector InVec>
15constexpr auto idx_abs_max(InVec v) ->
typename InVec::size_type
17 constexpr auto getValue = [](
typename InVec::value_type
const& val) {
19 return detail::abs_if_needed(val);
21 auto const re = detail::abs_if_needed(detail::real_if_needed(val));
22 auto const im = detail::abs_if_needed(detail::imag_if_needed(val));
30 for (
typename InVec::size_type i{0};
etl::cmp_less(i, v.extent(0)); ++i) {
31 if (
auto const val = getValue(v(i)); val > maxV) {
constexpr auto min(Type const &a, Type const &b, Compare comp) noexcept -> Type const &
Returns the smaller of a and b, using a compare function.
Definition min.hpp:13
constexpr auto idx_abs_max(InVec v) -> typename InVec::size_type
Definition blas1_vector_idx_abs_max.hpp:15
constexpr auto cmp_less(T t, U u) noexcept -> bool
Compare the values of two integers t and u. Unlike builtin comparison operators, negative signed inte...
Definition cmp_less.hpp:21
Definition accessor_conjugate.hpp:12
constexpr bool is_arithmetic_v
Definition is_arithmetic.hpp:21
Definition numeric_limits.hpp:17
static constexpr auto max() noexcept
Definition numeric_limits.hpp:21