16 #ifndef OPENKALMAN_FIXEDSIZEADAPTER_HPP 17 #define OPENKALMAN_FIXEDSIZEADAPTER_HPP 24 template<indexible NestedObject, pattern_collection Descriptors> requires
25 compatible_with_vector_space_descriptor_collection<NestedObject, Descriptors> and
26 internal::not_more_fixed_than<NestedObject, Descriptors> and internal::less_fixed_than<NestedObject, Descriptors>
28 template<
typename NestedObject,
typename Descriptors>
34 #ifndef __cpp_concepts 35 static_assert(indexible<NestedObject>);
36 static_assert(pattern_collection<Descriptors>);
37 static_assert(compatible_with_vector_space_descriptor_collection<NestedObject, Descriptors>);
38 static_assert(internal::not_more_fixed_than<NestedObject, Descriptors>);
39 static_assert(internal::less_fixed_than<NestedObject, Descriptors>);
55 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg> requires
56 std::constructible_from<NestedObject, Arg&&> and (not fixed_size_adapter<Arg>)
58 template<
typename Arg, std::enable_if_t<
59 compatible_with_vector_space_descriptors<Arg, Descriptors> and stdex::constructible_from<NestedObject, Arg&&> and
60 (not fixed_size_adapter<Arg>),
int> = 0>
71 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg, coordinates::pattern...Ds> requires
72 (
sizeof...(Ds) == 0 or std::same_as<std::tuple<Ds...>, Descriptors>) and
73 std::constructible_from<NestedObject, Arg&&> and (not fixed_size_adapter<Arg>)
75 template<
typename Arg,
typename...Ds, std::enable_if_t<
76 compatible_with_vector_space_descriptors<Arg, Vs...> and (... and coordinates::pattern<Ds>) and
77 std::is_same_v<std::tuple<Ds...>, Descriptors> and
78 stdex::constructible_from<NestedObject, Arg&&> and (not fixed_size_adapter<Arg>),
int> = 0>
88 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg> requires
89 std::constructible_from<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>
91 template<
typename Arg, std::enable_if_t<
92 compatible_with_vector_space_descriptors<Arg, Descriptors> and
93 stdex::constructible_from<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>,
int> = 0>
105 #ifdef __cpp_concepts 106 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg, coordinates::pattern...Ds> requires
107 (
sizeof...(Ds) == 0 or std::same_as<std::tuple<Ds...>, Descriptors>) and
108 std::constructible_from<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>
110 template<
typename Arg,
typename...Ds, std::enable_if_t<
111 compatible_with_vector_space_descriptors<Arg, Vs...> and (... and coordinates::pattern<Ds>) and
112 std::is_same_v<std::tuple<Ds...>, Descriptors> and
113 stdex::constructible_from<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>,
int> = 0>
121 #ifdef __cpp_concepts 122 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg> requires
123 std::assignable_from<std::add_lvalue_reference_t<NestedObject>, Arg&&>
125 template<
typename Arg, std::enable_if_t<compatible_with_vector_space_descriptor_collection<Arg, Descriptors> and
126 std::is_assignable_v<std::add_lvalue_reference_t<NestedObject>, Arg&&>,
int> = 0>
130 Base::operator=(std::forward<Arg>(arg));
141 constexpr decltype(
auto)
nested_object() const && {
return std::move(static_cast<const Base&&>(*
this)).nested_object(); }
150 #ifdef __cpp_concepts 151 template<indexible Arg, pattern_collection Descriptors> requires (not fixed_size_adapter<Arg>)
153 template<
typename Arg,
typename...Vs, std::enable_if_t<indexible<Arg> and pattern_collection<Descriptors> and
154 (not fixed_size_adapter<Arg>),
int> = 0>
159 #ifdef __cpp_concepts 162 template<
typename Arg,
typename...Vs, std::enable_if_t<indexible<Arg> and (... and coordinates::pattern<Vs>) and
163 (not fixed_size_adapter<Arg>),
int> = 0>
168 #ifdef __cpp_concepts 169 template<fixed_size_adapter Arg, pattern_collection Descriptors>
171 template<
typename Arg,
typename Descriptors, std::enable_if_t<fixed_size_adapter<Arg> and pattern_collection<Descriptors>,
int> = 0>
177 #ifdef __cpp_concepts 180 template<
typename Arg,
typename...Vs, std::enable_if_t<
181 fixed_size_adapter<Arg> and (... and coordinates::pattern<Vs>),
int> = 0>
decltype(auto) constexpr nested_object() const &
Get the nested object.
Definition: FixedSizeAdapter.hpp:138
constexpr bool pattern
An object describing the set of coordinates associated with a tensor index.
Definition: pattern.hpp:31
constexpr bool indexible
T is a multidimensional array type.
Definition: indexible.hpp:32
constexpr FixedSizeAdapter(Arg &&arg, const Descriptors &...)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: FixedSizeAdapter.hpp:95
Definition: AdapterBase.hpp:37
constexpr FixedSizeAdapter(Arg &&arg, const Descriptors &)
Construct from a compatible indexible object.
Definition: FixedSizeAdapter.hpp:62
constexpr FixedSizeAdapter & operator=(Arg &&arg)
Assign from another compatible indexible object.
Definition: FixedSizeAdapter.hpp:128
Definition: FixedSizeAdapter.hpp:30
constexpr Nested & nested_object() &
Get the nested object.
Definition: AdapterBase.hpp:76
constexpr FixedSizeAdapter(Arg &&arg, const Ds &...)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: FixedSizeAdapter.hpp:80
Basic definitions for OpenKalman as a whole.
Definition: basics.hpp:48