16 #ifndef OPENKALMAN_MAKE_IDENTITY_MATRIX_LIKE_HPP 17 #define OPENKALMAN_MAKE_IDENTITY_MATRIX_LIKE_HPP 28 template<indexible T, values::number Scalar = scalar_type_of_t<T>, pattern_collection Descriptors>
31 template<typename T, typename Scalar = typename scalar_type_of<T>::type,
typename Descriptors, std::enable_if_t<
32 indexible<T> and values::number<Scalar> and pattern_collection<Descriptors>,
int> = 0>
37 decltype(
auto) d = internal::remove_trailing_1D_descriptors(std::forward<Descriptors>(descriptors));
38 using D = decltype(d);
41 if constexpr (coordinates::euclidean_pattern_collection<D> and interface::make_identity_matrix_defined_for<T, Scalar, D>)
43 return Trait::template make_identity_matrix<Scalar>(std::forward<D>(d));
45 else if constexpr (interface::make_identity_matrix_defined_for<T, Scalar, decltype(internal::to_euclidean_vector_space_descriptor_collection(d))>)
47 auto ed = internal::to_euclidean_vector_space_descriptor_collection(d);
62 template<indexible T, values::number Scalar = scalar_type_of_t<T>, coordinates::pattern...Ds>
65 template<typename T, typename Scalar = typename scalar_type_of<T>::type,
typename...Ds, std::enable_if_t<
66 indexible<T> and values::number<Scalar> and (... and coordinates::pattern<Ds>),
int> = 0>
71 return make_identity_matrix_like<T, Scalar>(std::tuple {std::forward<Ds>(ds)...});
83 template<values::number Scalar, indexible Arg>
86 template<
typename Scalar,
typename Arg, std::enable_if_t<values::number<Scalar> and indexible<Arg>,
int> = 0>
91 if constexpr (identity_matrix<Arg> and std::is_same_v<Scalar,
scalar_type_of_t<Arg>>)
return std::forward<Arg>(arg);
102 #ifdef __cpp_concepts 103 template<indexible Arg>
106 template<
typename Arg, std::enable_if_t<indexible<Arg>,
int> = 0>
111 return make_identity_matrix_like<scalar_type_of_t<Arg>>(std::forward<Arg>(arg));
117 #endif //OPENKALMAN_MAKE_IDENTITY_MATRIX_LIKE_HPP auto make_vector_space_adapter(Arg &&arg, Descriptors &&descriptors)
If necessary, wrap an object in a wrapper that adds vector space descriptors for each index...
Definition: make_vector_space_adapter.hpp:37
typename scalar_type_of< T >::type scalar_type_of_t
helper template for scalar_type_of.
Definition: scalar_type_of.hpp:54
decltype(auto) constexpr all_vector_space_descriptors(const T &t)
Return a collection of coordinates::pattern objects associated with T.
Definition: all_vector_space_descriptors.hpp:52
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:37
constexpr auto make_identity_matrix_like(Descriptors &&descriptors)
Make an identity_matrix with a particular set of coordinates::pattern objects.
Definition: make_identity_matrix_like.hpp:35
constexpr bool identity_matrix
Specifies that a type is an identity matrix.
Definition: identity_matrix.hpp:45