16 #ifndef OPENKALMAN_LIBRARY_INTERFACE_HPP 17 #define OPENKALMAN_LIBRARY_INTERFACE_HPP 19 #ifdef DOXYGEN_SHOULD_SKIP_THIS 20 #include "coordinates/coordinates.hpp" 40 template<
typename T,
typename =
void>
44 #ifdef DOXYGEN_SHOULD_SKIP_THIS 53 template<
typename Derived>
54 using library_base = std::monostate;
79 -> constexpr_matrix
auto 92 to_diagonal = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
104 static constexpr
auto 105 conjugate = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
106 (Arg&& arg) -> constexpr patterns_may_match_with<Arg>
118 static constexpr
auto 120 std::same_as<std::remove_cvref_t<Arg>, T> and
134 template<std::
size_t indexa, std::
size_t indexb>
135 static constexpr
auto 136 transpose = []<
typename Arg> requires
137 std::same_as<std::remove_cvref_t<Arg>, T> and
151 static constexpr
auto 152 adjoint = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
165 template<std::
size_t indexa, std::
size_t indexb>
166 static constexpr
auto 167 adjoint = []<
typename Arg> requires
168 std::same_as<std::remove_cvref_t<Arg>, T> and
183 template<values::number Scalar>
184 static constexpr
auto 199 template<triangle_type tri>
200 static constexpr
auto 202 (Arg&& arg) -> triangular_matrix<tri> decltype(
auto)
216 template<HermitianAdapterType h>
217 static constexpr
auto 218 make_hermitian_adapter = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
219 (Arg&& arg) -> hermitian_matrix<h> decltype(
auto)
265 static constexpr
auto 266 to_euclidean = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
267 (Arg&& arg) -> has_untyped_index<0> decltype(
auto)
280 static constexpr
auto 281 from_euclidean = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T> and all_fixed_indices_are_euclidean<T>
282 (Arg&& arg,
const has_untyped_index<0>
auto& v) ->
indexible decltype(
auto)
293 static constexpr
auto 294 wrap_angles = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
295 (Arg&& arg) -> std::convertible_to<const T&> decltype(
auto)
306 static constexpr
auto 307 slice = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
308 (Arg&& arg,
const index_collection_for<Arg>
auto& begin,
const collections::index_collection
auto&
size)
323 static constexpr
auto 325 (T& t,
indexible auto&& block,
const index_collection_for<T>
auto& offsets) ->
void 339 template<triangle_type tri>
340 static constexpr
auto 341 set_triangle = [] requires writable<T>
342 (T& t, patterns_may_match_with<T>
auto&& b) ->
void 358 static constexpr
auto 359 diagonal_of = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
373 static constexpr
auto 374 broadcast = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
375 (Arg&& arg,
const collections::index_collection
auto& factors) ->
indexible auto 395 static constexpr
auto 397 compares_with_pattern_collection<Patterns>...Args>
399 std::invocable<Operation&&, element_type_of_t<Args>...> or
400 std::invocable<Operation&&, std::array<std::size_t, collections::size_of_v<Patterns>>,
element_type_of_t<Args>...> or
402 (
const Patterns& patterns, Operation&& op, Args&&...args)
403 -> compares_with_pattern_collection<Patterns>
auto 419 template<std::size_t...indices,
typename BinaryFunction>
420 static constexpr
auto 421 reduce = []<
typename Arg,
typename BinaryFunction>
422 requires std::same_as<std::remove_cvref_t<Arg>, T> and
424 (Arg&& arg, BinaryFunction&& binary_function)
434 static constexpr
auto 435 determinant = [] requires square_shaped<T, applicability::permitted>
447 static constexpr
auto 449 (Args&&...args) -> patterns_may_match_with<Args...> decltype(
auto)
460 static constexpr
auto 461 scalar_product = [](
const T& t, std::convertible_to<element_type_of_t<T>>
const auto& s)
462 -> patterns_may_match_with<T> decltype(
auto)
473 static constexpr
auto 474 scalar_quotient = [](
const T& t, std::convertible_to<element_type_of_t<T>>
const auto& s)
475 -> patterns_may_match_with<T> decltype(
auto)
486 static constexpr
auto 488 (
const T& a,
const dimension_size_of_index_is<0, index_dimension_of<T, 1>, &stdex::is_eq,
applicability::permitted>
auto& b)
500 template<
bool on_the_right>
501 static constexpr
auto 516 template<triangle_type tri>
517 static constexpr
auto 537 template<HermitianAdapterType significant_triangle>
538 static constexpr
auto 540 requires std::same_as<std::remove_cvref_t<A>, T> and
568 static constexpr
auto 570 requires std::same_as<std::remove_cvref_t<A>, T> and
575 -> triangular_matrix<triangle> decltype(
auto)
595 template<
bool must_be_unique = false,
bool must_be_exact = false>
596 static constexpr
auto 598 (
const T& a,
const dimension_size_of_index_is<0, index_dimension_of_v<A, 0>, &stdex::is_eq,
applicability::permitted>
auto& b)
611 static constexpr
auto 612 LQ_decomposition = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
613 (Arg&& arg) -> triangular_matrix<triangle_type::lower>
auto 625 static constexpr
auto 626 QR_decomposition = []<
typename Arg> requires std::same_as<std::remove_cvref_t<Arg>, T>
627 (Arg&& arg) -> triangular_matrix<triangle_type::upper>
auto 632 #endif // DOXYGEN_SHOULD_SKIP_THIS Definition for internal::slice_specifier.
decltype(auto) constexpr from_euclidean(Arg &&arg, const V &v)
Project the Euclidean vector space associated with index 0 to coordinates::pattern v after applying d...
Definition: from_euclidean.hpp:35
constexpr auto n_ary_operation(const std::tuple< Ds... > &d_tup, Operation &&operation, Args &&...args)
Perform a component-wise n-ary operation, using broadcasting to match the size of a pattern matrix...
Definition: n_ary_operation.hpp:325
decltype(auto) constexpr contract(A &&a, B &&b)
Matrix multiplication of A * B.
Definition: contract.hpp:54
Definition: basics.hpp:41
decltype(auto) rank_update_hermitian(A &&a, U &&u, scalar_type_of_t< A > alpha=1)
Do a rank update on a hermitian matrix.
Definition: rank_update_hermitian.hpp:45
Definition for layout_mapping_policy.
constexpr bool diagonal_matrix
Specifies that a type is a diagonal matrix or tensor.
Definition: diagonal_matrix.hpp:32
A lower-left triangular matrix.
decltype(auto) constexpr conjugate(Arg &&arg)
Take the complex conjugate of an indexible object.
Definition: conjugate.hpp:44
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
constexpr bool indexible
T is a multidimensional array type.
Definition: indexible.hpp:32
decltype(auto) constexpr QR_decomposition(A &&a)
Perform a QR decomposition of matrix A=Q[U,0], U is a upper-triangular matrix, and Q is orthogonal...
Definition: QR_decomposition.hpp:33
decltype(auto) constexpr copy_from(Dest &&dest, Source &&source)
Copy elements from one object to another.
Definition: copy_from.hpp:59
decltype(auto) constexpr to_diagonal(Arg &&arg)
Convert an indexible object into a diagonal matrix.
Definition: to_diagonal.hpp:33
decltype(auto) constexpr reduce(BinaryFunction &&b, Arg &&arg)
Perform a partial reduction based on an associative binary function, across one or more indices...
Definition: reduce.hpp:143
Enumerations relating to linear algebra.
decltype(auto) constexpr broadcast(Arg &&arg, const Factors &...factors)
Broadcast an object by replicating it by factors specified for each index.
Definition: broadcast.hpp:49
constexpr bool hermitian_matrix
Specifies that a type is a hermitian matrix.
Definition: hermitian_matrix.hpp:59
Definition for element_type_of.
constexpr bool patterns_may_match_with
Specifies that indexible objects Ts may have equivalent dimensions and vector-space types...
Definition: patterns_may_match_with.hpp:57
constexpr bool dimension_size_of_index_is
Specifies that a given index of T has a specified size.
Definition: dimension_size_of_index_is.hpp:35
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:42
constexpr bool identity_matrix
Specifies that a type is known at compile time to be a rank-2 or lower identity matrix.
Definition: identity_matrix.hpp:50
decltype(auto) constexpr transpose(Arg &&arg)
Swap any two indices of an indexible_object.
Definition: transpose.hpp:163
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
constexpr auto solve(A &&a, B &&b)
Solve the equation AX = B for X, which may or may not be a unique solution.
Definition: solve.hpp:87
constexpr auto determinant(Arg &&arg)
Take the determinant of a matrix.
Definition: determinant.hpp:44
decltype(auto) constexpr diagonal_of(Arg &&arg)
Extract a column vector (or column slice for rank>2 tensors) comprising the diagonal elements...
Definition: diagonal_of.hpp:36
constexpr bool size
T is either an index representing a size, or unbounded_size_t, which indicates that the size is unbou...
Definition: size.hpp:65
decltype(auto) constexpr to_euclidean(Arg &&arg)
Project the vector space associated with index 0 to a Euclidean space for applying directional statis...
Definition: to_euclidean.hpp:38
constexpr detail::slice_adapter slice
a RangeAdapterObject associated with slice_view.
Definition: slice.hpp:364
An upper-right triangular matrix.
constexpr bool pattern_collection
An object describing a collection of /ref pattern objects.
Definition: pattern_collection.hpp:65
decltype(auto) constexpr sum(Ts &&...ts)
Element-by-element sum of one or more objects.
Definition: sum.hpp:112
constexpr bool euclidean_pattern_collection
An object describing a collection of /ref euclidean_pattern objects.
Definition: euclidean_pattern_collection.hpp:65
decltype(auto) constexpr LQ_decomposition(A &&a)
Perform an LQ decomposition of matrix A=[L,0]Q, L is a lower-triangular matrix, and Q is orthogonal...
Definition: LQ_decomposition.hpp:33
decltype(auto) rank_update_triangular(A &&a, U &&u, scalar_type_of_t< A > alpha=1)
Do a rank update on triangular matrix.
Definition: rank_update_triangular.hpp:48
constexpr auto make_constant(C c, stdex::extents< IndexType, Extents... > extents)
Make an indexible object in which every element is a constant value.
Definition: make_constant.hpp:39
decltype(auto) constexpr adjoint(Arg &&arg)
Take the conjugate-transpose of an indexible_object.
Definition: adjoint.hpp:35
typename element_type_of< T >::type element_type_of_t
helper template for element_type_of.
Definition: element_type_of.hpp:54
A matrix with typed rows and columns.
Definition: forward-class-declarations.hpp:292
decltype(auto) constexpr make_triangular_matrix(Arg &&arg)
Create a triangular_matrix from a general matrix.
Definition: make_triangular_matrix.hpp:35
decltype(auto) constexpr cholesky_factor(A &&a)
Take the Cholesky factor of a matrix.
Definition: cholesky_factor.hpp:38
constexpr Arg && set_slice(Arg &&arg, Block &&block, const Begin &...begin)
Assign an object to a particular slice of a matrix or tensor.
Definition: set_slice.hpp:56