16 #ifndef OPENKALMAN_PATTERN_ADAPTER_HPP 17 #define OPENKALMAN_PATTERN_ADAPTER_HPP 19 #include "patterns/patterns.hpp" 22 #include "linear-algebra/adapters/internal/AdapterBase.hpp" 23 #include "linear-algebra/adapters/interfaces/pass_through_interface.hpp" 33 template<indexible Nested, pattern_collection_for<Nested> PatternCollection>
34 requires std::same_as<PatternCollection, std::decay_t<PatternCollection>>
36 template<
typename Nested,
typename PatternCollection>
42 #ifndef __cpp_concepts 43 static_assert(pattern_collection_for<PatternCollection, Nested>);
54 template<indexible Arg, patterns::pattern_collection P> requires
55 std::constructible_from<Nested, Arg&&> and
56 std::constructible_from<PatternCollection, P&&>
58 template<
typename Arg,
typename P, std::enable_if_t<
59 stdex::constructible_from<Nested, Arg&&> and
60 stdex::constructible_from<PatternCollection, P&&>,
int> = 0>
65 if constexpr(not pattern_collection_for<PatternCollection, Nested, applicability::guaranteed>)
82 #ifdef __cpp_explicit_this_parameter 83 template<
typename Self>
86 return std::forward<Self>(
self).patt_;
98 constexpr
const PatternCollection&&
pattern_collection() const && {
return std::move(*this).patt_; }
103 PatternCollection patt_;
111 #ifdef __cpp_concepts 112 template<indexible Arg, pattern_collection_for<Arg> P>
114 template<
typename Arg,
typename P, std::enable_if_t<indexible<Arg> and pattern_collection_for<P, Arg>,
int> = 0>
128 template<
typename Nested,
typename PatternCollection>
132 static const bool is_specialized =
true;
134 static constexpr
auto 138 static constexpr
auto 147 template<
typename Nested,
typename PatternCollection>
Pass-through object traits.
Definition: pass_through_interface.hpp:39
constexpr pattern_adapter(Arg &&arg, P &&p)
Construct from an indexible object and a pattern_collection.
Definition: pattern_adapter.hpp:63
Library interface traits for pattern_adapter.
Definition: pass_through_interface.hpp:115
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the patterns::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:36
Definition: AdapterBase.hpp:38
constexpr const PatternCollection & pattern_collection() const &
Definition: pattern_adapter.hpp:92
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
Definition: object_traits.hpp:38
constexpr const PatternCollection && pattern_collection() const &&
Definition: pattern_adapter.hpp:98
An adapter that attaches a pattern_collection to an indexible object.
Definition: pattern_adapter.hpp:38
Definition for pattern_collection_for.
constexpr auto compare_pattern_collections(const A &a, const B &b)
Compare each element of two pattern_collection objects lexicographically.
Definition: compare_pattern_collections.hpp:137
constexpr Nested & nested_object() &
Get the nested object.
Definition: AdapterBase.hpp:77
Definition for indexible.
constexpr pattern_adapter()=default
Default constructor.
constexpr PatternCollection & pattern_collection() &
Get the associated pattern_collection.
Definition: pattern_adapter.hpp:89
constexpr PatternCollection && pattern_collection() &&
Definition: pattern_adapter.hpp:95
constexpr auto to_extents(P &&p)
Convert a pattern_collection to std::extents.
Definition: to_extents.hpp:78
decltype(auto) constexpr get_mdspan(T &&t)
Get the mdspan associated with indexible object T.
Definition: get_mdspan.hpp:35