16 #ifndef OPENKALMAN_CONTRACT_IN_PLACE_HPP 17 #define OPENKALMAN_CONTRACT_IN_PLACE_HPP 28 template<
bool on_the_right = true, square_shaped<applicability::permitted> A, square_shaped<applicability::permitted> B> requires
29 vector_space_descriptors_may_match_with<A, B> and (not triangular_matrix<A> or triangle_type_of_v<A> == triangle_type_of_v<A, B>) and
30 (index_count_v<A> == stdex::dynamic_extent or index_count_v<A> <= 2) and (index_count_v<B> == stdex::dynamic_extent or index_count_v<B> <= 2)
32 template<
bool on_the_right =
true,
typename A,
typename B, std::enable_if_t<
33 square_shaped<A, applicability::permitted> and square_shaped<B, applicability::permitted> and
40 if constexpr (not square_shaped<A> or not square_shaped<B> or not vector_space_descriptors_match_with<A, B>)
if (not vector_space_descriptors_match(a, b))
41 throw std::invalid_argument {
"Arguments to contract_in_place must match in size and be square matrices"};
43 if constexpr (zero<A> or identity_matrix<B>)
47 else if constexpr (zero<B> and writable<A>)
49 copy(a, std::forward<B>(b));
51 else if constexpr (interface::contract_in_place_defined_for<A, on_the_right, A&, B&&>)
59 return std::forward<A>(a);
decltype(auto) constexpr contract(A &&a, B &&b)
Matrix multiplication of A * B.
Definition: contract.hpp:54
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
decltype(auto) constexpr to_dense_object(Arg &&arg)
Convert the argument to a dense, writable matrix of a particular scalar type.
Definition: to_dense_object.hpp:37
The root namespace for OpenKalman.
Definition: basics.hpp:34
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:42
constexpr A && contract_in_place(A &&a, B &&b)
In-place matrix multiplication of A * B, storing the result in A.
Definition: contract_in_place.hpp:38