5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_VECTOR_ABS_SUM_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_VECTOR_ABS_SUM_HPP_
11#include "arene/base/detail/make_range_from_indexable.hpp"
12#include "arene/base/linalg/detail/constraints_for.hpp"
13#include "arene/base/linalg/detail/zero_scalar.hpp"
17#include "arene/base/stdlib_choice/declval.hpp"
18#include "arene/base/stdlib_choice/enable_if.hpp"
19#include "arene/base/stdlib_choice/is_assignable.hpp"
20#include "arene/base/stdlib_choice/move.hpp"
21#include "arene/base/stdlib_choice/plus.hpp"
37class algorithm_constraints<class vector_abs_sum_fn> {
47 template <
typename Dest,
typename Reduce,
typename Source1,
typename Source2>
66 template <
typename InVec,
typename Scalar,
typename Norm>
71 reduce_update_constraints<Scalar&, std::plus<>&, Scalar&&, invoke_result_t<Norm&, math_reference_t<InVec>>>>;
75class vector_abs_sum_fn {
77 using default_norm =
decltype(complex_l1_norm);
99 typename Norm = default_norm,
100 constraints_for<vector_abs_sum_fn, InVec, Scalar, Norm> =
nullptr>
101 constexpr auto operator()(InVec vec, Scalar init, Norm norm = {})
const noexcept(
102 noexcept(transform_reduce(
109 return transform_reduce(
110 arene::base::detail::make_range_from_indexable(
std::move(vec)),
136 zero_scalar_t<InVec, default_norm>,
137 default_norm>> =
nullptr>
138 constexpr auto operator()(InVec vec)
const noexcept(
141 return (*
this)(
std::move(vec), zero_scalar_v<InVec, 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
typename invoke_result< Fn, Args... >::type invoke_result_t
The return type of a functor invoked with the specified arguments.
Definition is_invocable.hpp:271
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
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,...