17 #ifndef OPENKALMAN_PASS_THROUGH_INTERFACE_HPP 18 #define OPENKALMAN_PASS_THROUGH_INTERFACE_HPP 20 #include "patterns/patterns.hpp" 23 #include "linear-algebra/adapters/internal/AdapterBase.hpp" 29 #include "linear-algebra/adapters/internal/AdapterBase.hpp" 38 template<
typename Object,
typename Nested>
47 assert_valid_arg_type(T) { static_assert(stdex::same_as<stdex::remove_cvref_t<T>, Object>); }
52 get_mdspan = [](
auto&& t) -> decltype(
auto)
54 assert_valid_arg_type(t);
60 get_pattern_collection = [](
auto&& t) -> decltype(
auto)
62 assert_valid_arg_type(t);
68 triangle_type_value = triangle_type_of_v<Nested>;
72 template<
typename T> requires get_constant_defined_for<Nested>
74 template<
typename T,
bool Enable = true, std::enable_if_t<Enable and get_constant_defined_for<Nested>,
int> = 0>
79 assert_valid_arg_type(t);
80 return NestedTraits::get_constant(std::forward<T>(t).nested_object());
85 nested_object = [](
auto&& t) -> decltype(
auto)
87 assert_valid_arg_type(t);
88 return std::forward<decltype(t)>(t).nested_object();
92 template<applicability b>
94 is_square = square_shaped<Nested, 2, b>;
98 is_triangular_adapter =
false;
101 static constexpr
bool 102 is_hermitian = hermitian_matrix<Nested>;
106 hermitian_adapter_type = hermitian_adapter_type_of_v<Nested>;
114 template<
typename Object,
typename Nested>
122 static constexpr
void 123 assert_valid_arg_type(T) { static_assert(stdex::same_as<stdex::remove_cvref_t<T>, Object>); }
125 template<
typename T,
typename Arg>
126 static constexpr
auto 127 make_adapter(T&& t, Arg&& arg)
130 return attach_patterns(std::forward<decltype(a)>(a), std::forward<decltype(vs)>(vs)...);
131 }, std::tuple_cat(std::forward_as_tuple(std::forward<Arg>(arg)), std::forward<T>(t).my_descriptors));
136 template<
typename Derived>
137 using library_base = internal::library_base_t<Derived, Nested>;
140 #ifdef __cpp_concepts 141 template<
typename T,
typename Other> requires copy_from_defined_for<Nested&, Other&&>
143 template<
typename T,
typename Other, std::enable_if_t<copy_from_defined_for<Nested&, Other&&>,
int> = 0>
145 static constexpr
void 148 assert_valid_arg_type(t);
Pass-through object traits.
Definition: pass_through_interface.hpp:39
Definition: basics.hpp:41
Library interface traits for pattern_adapter.
Definition: pass_through_interface.hpp:115
triangle_type
The type of a triangular matrix.
Definition: enumerations.hpp:26
decltype(auto) constexpr attach_patterns(Arg &&arg, P &&p)
Attach a pattern_collection to an indexible object.
Definition: attach_patterns.hpp:74
Definition for square_shaped.
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the patterns::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:36
HermitianAdapterType
The type of a hermitian adapter, indicating which triangle of the nested matrix is used...
Definition: enumerations.hpp:79
decltype(auto) constexpr copy_from(Dest &&dest, Source &&source)
Copy elements from one object to another.
Definition: copy_from.hpp:59
decltype(auto) constexpr apply(F &&f, T &&t)
A generalization of std::apply.
Definition: apply.hpp:49
Definition for hermitian_adapter_type_of.
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:42
Definition: object_traits.hpp:38
Definition of copy_from function.
Definition for pattern_collection_for.
Definition for hermitian_matrix.
Definition for indexible.
Concepts for testing whether object_traits or library_interface definitions exist for a particular ob...
decltype(auto) constexpr get_mdspan(T &&t)
Get the mdspan associated with indexible object T.
Definition: get_mdspan.hpp:35