5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_MATRIX_ONE_NORM_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_MATRIX_ONE_NORM_HPP_
15#include "arene/base/functional/detail/max_fn.hpp"
16#include "arene/base/linalg/detail/constraints_for.hpp"
17#include "arene/base/linalg/detail/zero_scalar.hpp"
24#include "arene/base/math/detail/less_nan_highest.hpp"
25#include "arene/base/stdlib_choice/declval.hpp"
26#include "arene/base/stdlib_choice/enable_if.hpp"
27#include "arene/base/stdlib_choice/is_convertible.hpp"
28#include "arene/base/stdlib_choice/move.hpp"
45class algorithm_constraints<class matrix_one_norm_fn> {
50 template <
typename InVec,
typename Scalar,
typename Norm>
52 constraints_for<
decltype(vector_abs_sum), InVec, Scalar, Norm>,
53 constraints_for<
decltype(vector_idx_abs_max), InVec,
auto(math_reference_t<InVec>)->Scalar>>;
61 template <
typename InMat,
typename Scalar,
typename Norm>
66 underlying_constraints<column_vector_of_t<InMat>, Scalar, Norm>>;
70class matrix_one_norm_fn {
72 using default_norm =
decltype(math::abs);
90 typename Norm = default_norm,
91 constraints_for<matrix_one_norm_fn, InMat, Scalar, Norm> =
nullptr>
92 constexpr auto operator()(InMat mat, Scalar init, Norm norm = {})
const noexcept(
99 auto const abs_column_sum = bind_back(vector_abs_sum, init,
std::move(norm));
101 return transform_reduce(
104 functional_detail::max_fn(math_detail::less_nan_highest),
127 zero_scalar_t<InMat, default_norm>,
128 default_norm>> =
nullptr>
129 constexpr auto operator()(InMat mat)
const noexcept(
132 return (*
this)(
std::move(mat), zero_scalar_v<InMat, default_norm>);
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
Definition accumulate.hpp:37
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
constexpr bool is_nothrow_less_than_comparable_v
Definition accumulate.hpp:36
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...