16 #ifndef OPENKALMAN_FIXEDSIZEADAPTER_HPP 17 #define OPENKALMAN_FIXEDSIZEADAPTER_HPP 22 template<indexible NestedObject, pattern_tuple Descriptors> requires
23 compatible_with_vector_space_descriptor_collection<NestedObject, Descriptors> and
24 internal::not_more_fixed_than<NestedObject, Descriptors> and internal::less_fixed_than<NestedObject, Descriptors>
26 template<
typename NestedObject,
typename Descriptors>
32 #ifndef __cpp_concepts 33 static_assert(indexible<NestedObject>);
34 static_assert(pattern_tuple<Descriptors>);
35 static_assert(compatible_with_vector_space_descriptor_collection<NestedObject, Descriptors>);
36 static_assert(internal::not_more_fixed_than<NestedObject, Descriptors>);
37 static_assert(internal::less_fixed_than<NestedObject, Descriptors>);
53 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg> requires
54 std::constructible_from<NestedObject, Arg&&> and (not fixed_size_adapter<Arg>)
56 template<
typename Arg, std::enable_if_t<
57 compatible_with_vector_space_descriptors<Arg, Descriptors> and std::is_constructible_v<NestedObject, Arg&&> and
58 (not fixed_size_adapter<Arg>),
int> = 0>
69 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg, coordinates::pattern...Ds> requires
70 (
sizeof...(Ds) == 0 or std::same_as<std::tuple<Ds...>, Descriptors>) and
71 std::constructible_from<NestedObject, Arg&&> and (not fixed_size_adapter<Arg>)
73 template<
typename Arg,
typename...Ds, std::enable_if_t<
74 compatible_with_vector_space_descriptors<Arg, Vs...> and (... and coordinates::pattern<Ds>) and
75 std::is_same_v<std::tuple<Ds...>, Descriptors> and
76 std::is_constructible_v<NestedObject, Arg&&> and (not fixed_size_adapter<Arg>),
int> = 0>
86 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg> requires
87 std::constructible_from<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>
89 template<
typename Arg, std::enable_if_t<
90 compatible_with_vector_space_descriptors<Arg, Descriptors> and
91 std::is_constructible_v<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>,
int> = 0>
103 #ifdef __cpp_concepts 104 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg, coordinates::pattern...Ds> requires
105 (
sizeof...(Ds) == 0 or std::same_as<std::tuple<Ds...>, Descriptors>) and
106 std::constructible_from<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>
108 template<
typename Arg,
typename...Ds, std::enable_if_t<
109 compatible_with_vector_space_descriptors<Arg, Vs...> and (... and coordinates::pattern<Ds>) and
110 std::is_same_v<std::tuple<Ds...>, Descriptors> and
111 std::is_constructible_v<NestedObject, nested_object_of_t<Arg&&>> and fixed_size_adapter<Arg>,
int> = 0>
119 #ifdef __cpp_concepts 120 template<compatible_with_vector_space_descriptor_collection<Descriptors> Arg> requires
121 std::assignable_from<std::add_lvalue_reference_t<NestedObject>, Arg&&>
123 template<
typename Arg, std::enable_if_t<compatible_with_vector_space_descriptor_collection<Arg, Descriptors> and
124 std::is_assignable_v<std::add_lvalue_reference_t<NestedObject>, Arg&&>,
int> = 0>
139 constexpr decltype(
auto)
nested_object() const && {
return std::move(static_cast<const Base&&>(*
this)).nested_object(); }
148 #ifdef __cpp_concepts 149 template<indexible Arg, pattern_collection Descriptors> requires (not fixed_size_adapter<Arg>)
151 template<
typename Arg,
typename...Vs, std::enable_if_t<indexible<Arg> and pattern_collection<Descriptors> and
152 (not fixed_size_adapter<Arg>),
int> = 0>
157 #ifdef __cpp_concepts 158 template<
indexible Arg, coordinates::pattern...Vs> requires (not fixed_size_adapter<Arg>)
160 template<
typename Arg,
typename...Vs, std::enable_if_t<indexible<Arg> and (... and coordinates::pattern<Vs>) and
161 (not fixed_size_adapter<Arg>),
int> = 0>
166 #ifdef __cpp_concepts 167 template<fixed_size_adapter Arg, pattern_collection Descriptors>
169 template<
typename Arg,
typename Descriptors, std::enable_if_t<fixed_size_adapter<Arg> and pattern_collection<Descriptors>,
int> = 0>
175 #ifdef __cpp_concepts 176 template<fixed_size_adapter Arg, coordinates::pattern...Vs>
178 template<
typename Arg,
typename...Vs, std::enable_if_t<
179 fixed_size_adapter<Arg> and (... and coordinates::pattern<Vs>),
int> = 0>
188 #endif //OPENKALMAN_FIXEDSIZEADAPTER_HPP constexpr NestedObject & nested_object() &
Get the nested object.
Definition: AdapterBase.hpp:97
decltype(auto) constexpr nested_object() const &
Get the nested object.
Definition: FixedSizeAdapter.hpp:136
constexpr AdapterBase & operator=(Arg &&arg)
Assign from another compatible indexible object.
Definition: AdapterBase.hpp:82
constexpr bool indexible
T is a generalized tensor 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:93
Definition: AdapterBase.hpp:36
constexpr FixedSizeAdapter(Arg &&arg, const Descriptors &)
Construct from a compatible indexible object.
Definition: FixedSizeAdapter.hpp:60
constexpr FixedSizeAdapter & operator=(Arg &&arg)
Assign from another compatible indexible object.
Definition: FixedSizeAdapter.hpp:126
Definition: FixedSizeAdapter.hpp:28
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:78
Definition: basics.hpp:48