16 #ifndef OPENKALMAN_WRAP_GET_ELEMENT_HPP 17 #define OPENKALMAN_WRAP_GET_ELEMENT_HPP 19 #include <type_traits> 24 #include "linear-algebra/coordinates/interfaces/coordinate_descriptor_traits.hpp" 45 template<pattern T, values::index L>
50 template<
typename T,
typename Getter,
typename L, std::enable_if_t<pattern<T> and values::index<L> and
51 values::value<
typename std::invoke_result<Getter, std::
size_t>::type>,
int> = 0>
56 if constexpr (dimension_of_v<T> !=
dynamic_size and values::fixed<L>)
59 if constexpr (euclidean_pattern<T>)
61 return g(local_index);
63 else if constexpr (descriptor<T>)
69 auto component_ix =
collections::get(internal::get_index_table(t), local_index);
70 auto component = internal::get_descriptor_collection_element(t, component_ix);
71 auto start_i =
collections::get(internal::get_component_start_indices(t), component_ix);
72 auto new_g = [&g, start_i](
auto i) {
return g(
values::operation {std::plus{}, start_i, i}); };
82 #endif //OPENKALMAN_WRAP_GET_ELEMENT_HPP Definition for coordinates::euclidean_pattern.
Definition for collections::get.
decltype(auto) constexpr get(Arg &&arg, I i)
A generalization of std::get.
Definition: get.hpp:62
An operation involving some number of values.
Definition: operation.hpp:69
constexpr auto get_wrapped_component(const T &t, const Getter &g, const L &local_index)
Gets an element from a matrix or tensor object and wraps the result.
Definition: get_wrapped_component.hpp:53
Definition for coordinates::internal::get_component_start_indices.
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
Definition for coordinates::pattern.
constexpr auto to_number(Arg arg)
Convert any values::value to a values::number.
Definition: to_number.hpp:34
Definition for coordinates::internal::get_index_table.
Definition for coordinates::descriptor.
Definition: compares_with.hpp:28
Traits for coordinates::pattern objects.
Definition: coordinate_descriptor_traits.hpp:41
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33
Definition for coordinates::dimension_of.