16 #ifndef OPENKALMAN_DIAGONAL_OF_HPP 17 #define OPENKALMAN_DIAGONAL_OF_HPP 19 #include "patterns/patterns.hpp" 27 #include "linear-algebra/functions/internal/make_wrapped_mdspan.hpp" 38 template<indexible Arg>
41 template<
typename Arg, std::enable_if_t<indexible<Arg>,
int> = 0>
42 constexpr decltype(
auto)
48 return std::forward<Arg>(arg);
50 else if constexpr (interface::diagonal_of_defined_for<Arg&&>)
57 if constexpr (constant_object<Arg> or constant_diagonal_object<Arg>)
64 using N = std::decay_t<decltype(n)>;
65 using nested_extents_type =
typename N::extents_type;
66 using nested_layout =
typename N::layout_type;
70 using mapping_type =
typename layout_type::template mapping<extents_type>;
73 return internal::make_wrapped_mdspan(
74 std::forward<Arg>(arg),
Definition: language-features.hpp:228
Definitions for attach_patterns.
constexpr bool indexible
T is a multidimensional array type.
Definition: indexible.hpp:32
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the patterns::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:36
A structure representing the dimensions associated with of a particular index.
Definition: Dimensions.hpp:42
Definition for diagonal_matrix.
constexpr bool compares_with_pattern_collection
Compares the associated pattern collection of indexible T with pattern_collection D...
Definition: compares_with_pattern_collection.hpp:50
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:42
decltype(auto) constexpr diagonal_of(Arg &&arg)
Extract a column vector (or column slice for rank>2 tensors) comprising the diagonal elements...
Definition: diagonal_of.hpp:44
Definition of get_mdspan function.
constexpr auto make_constant(C c, P &&p)
Make an indexible object in which every element is a constant value.
Definition: make_constant.hpp:41
Definition for pattern_collection_for.
Definition: diagonal_of_mdspan_policies.hpp:30
constexpr auto constant_value(T &&t)
The constant value associated with a constant_object or constant_diagonal_object. ...
Definition: constant_value.hpp:37
constexpr detail::diagonal_of_adapter diagonal_of
A RangeAdapterObject that converts one pattern_collection to another corresponding to the diagonal_ma...
Definition: diagonal_of.hpp:153
Definition for indexible.
Definition for compares_with_pattern_collection.
Definitions for make_constant.
constexpr auto to_extents(P &&p)
Convert a pattern_collection to std::extents.
Definition: to_extents.hpp:78
decltype(auto) constexpr get_mdspan(T &&t)
Get the mdspan associated with indexible object T.
Definition: get_mdspan.hpp:35