5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_MATRIX_RANK_1_UPDATE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_MATRIX_RANK_1_UPDATE_HPP_
10#include "arene/base/linalg/detail/constraints_for.hpp"
11#include "arene/base/linalg/detail/mandates.hpp"
12#include "arene/base/linalg/detail/zero_object.hpp"
15#include "arene/base/stdlib_choice/declval.hpp"
16#include "arene/base/stdlib_choice/enable_if.hpp"
17#include "arene/base/stdlib_choice/is_assignable.hpp"
18#include "arene/base/stdlib_choice/is_constructible.hpp"
19#include "arene/base/stdlib_choice/multiplies.hpp"
20#include "arene/base/stdlib_choice/plus.hpp"
38template <
typename Target,
typename Result,
typename Addend,
typename Left,
typename Right>
45 std::enable_if_t<std::is_assignable<Target, Result>::value>>;
49class algorithm_constraints<class matrix_rank_1_update_fn> {
56 template <
typename InVec1,
typename InVec2,
typename InMat,
typename OutMat>
65 multiply_add_constraints<
66 math_reference_t<OutMat>,
68 math_reference_t<InMat>,
69 math_reference_t<InVec1>,
70 math_reference_t<InVec2>>>;
78class matrix_rank_1_update_fn {
104 constraints_for<matrix_rank_1_update_fn, InVec1, InVec2, InMat, OutMat> =
nullptr>
105 auto operator()(InVec1 x_vec, InVec2 y_vec, InMat e_mat, OutMat a_mat)
const
106 noexcept(
noexcept(a_mat(0U, 0U) =
static_cast<math_value_t<OutMat>>(e_mat(0U, 0U) + (x_vec(0U) * y_vec(0U)))))
130 constraints_for<matrix_rank_1_update_fn, InVec1, InVec2, zero_object_t<OutMat>, OutMat>> =
nullptr>
131 auto operator()(InVec1 x_vec, InVec2 y_vec, OutMat a_mat)
const
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
typename math_traits< T >::value_type math_value_t
The mdspan-equivalent value type of T if T is a linalg object, or a substitution error if not.
Definition math_traits.hpp:66
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
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,...