16 #ifndef OPENKALMAN_TO_DENSE_OBJECT_HPP 17 #define OPENKALMAN_TO_DENSE_OBJECT_HPP 29 template<indexible T, Layout layout = Layout::none, values::number Scalar = scalar_type_of_t<T>, indexible Arg> requires
31 constexpr writable decltype(
auto)
33 template<
typename T, Layout layout = Layout::none,
typename Scalar = scalar_type_of_t<T>,
typename Arg, std::enable_if_t<
34 indexible<T> and (layout != Layout::str
ide) and values::number<Scalar> and indexible<Arg>,
int> = 0>
35 constexpr decltype(
auto)
39 if constexpr (writable<Arg>)
41 return std::forward<Arg>(arg);
43 else if constexpr (writable<decltype(to_native_matrix<T>(std::declval<Arg&&>()))>)
45 return to_native_matrix<T>(std::forward<Arg>(arg));
50 assign(m, std::forward<Arg>(arg));
63 template<Layout layout, values::number Scalar, indexible Arg> requires (layout !=
Layout::stride)
64 constexpr writable decltype(
auto)
66 template<Layout layout,
typename Scalar,
typename Arg, std::enable_if_t<values::number<Scalar> and indexible<Arg> and
67 (layout != Layout::str
ide),
int> = 0>
68 constexpr decltype(
auto)
73 return std::forward<Arg>(arg);
75 return to_dense_object<std::decay_t<Arg>, layout, Scalar>(std::forward<Arg>(arg));
87 template<Layout layout = Layout::none, indexible Arg> requires (layout !=
Layout::stride)
88 constexpr writable decltype(
auto)
90 template<Layout layout = Layout::none,
typename Arg, std::enable_if_t<indexible<Arg> and (layout != Layout::str
ide),
int> = 0>
91 constexpr decltype(
auto)
95 if constexpr (writable<Arg>)
96 return std::forward<Arg>(arg);
104 #endif //OPENKALMAN_TO_DENSE_OBJECT_HPP 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 to_dense_object(Arg &&arg)
Convert the argument to a dense, writable matrix of a particular scalar type.
Definition: to_dense_object.hpp:37
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
A generalization of the above: a custom stride is specified for each index.
constexpr To && assign(To &&a, From &&b)
Assign a writable object from an indexible object.
Definition: assign.hpp:51