17 #ifndef OPENKALMAN_MAKE_WRITABLE_SQUARE_MATRIX_HPP 18 #define OPENKALMAN_MAKE_WRITABLE_SQUARE_MATRIX_HPP 27 template<
typename U,
typename A>
28 constexpr decltype(
auto)
29 make_writable_square_matrix(A&& a)
31 constexpr
auto dim = not dynamic_dimension<A, 0> ? index_dimension_of_v<A, 0> :
32 not dynamic_dimension<A, 1> ? index_dimension_of_v<A, 1> : index_dimension_of_v<U, 0>;
33 if constexpr (writable<A>)
35 return std::forward<A>(a);
37 else if constexpr (not has_dynamic_dimensions<A> or dim == stdex::dynamic_extent)
43 constexpr
auto d = std::integral_constant<std::size_t, dim>{};
44 auto ret {make_dense_object<A>(d, d)};
45 ret = std::forward<A>(a);
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
Definition: basics.hpp:48