16 #ifndef OPENKALMAN_INTERFACES_MDSPAN_LIBRARY_HPP 17 #define OPENKALMAN_INTERFACES_MDSPAN_LIBRARY_HPP 29 template<
typename T,
typename IndexType, std::size_t...Extents,
typename LayoutPolicy,
typename AccessorPolicy>
30 struct library_interface<stdex::mdspan<T, stdex::extents<IndexType, Extents...>, LayoutPolicy, AccessorPolicy>>
38 static constexpr std::size_t rank = extents::rank();
39 static constexpr std::size_t rank_dynamic = extents::rank_dynamic();
46 return stdex::linalg::conjugated(std::forward<decltype(m)>(m));
52 transpose = [](
auto&& m) -> decltype(
auto) requires (rank <= 2)
54 transpose = [](
auto&& m, std::enable_if_t<std::decay_t<decltype(m)>::rank() <= 2,
int> = 0) -> decltype(
auto)
57 if constexpr (rank == 2)
58 return stdex::linalg::transposed(std::forward<decltype(m)>(m));
59 else if constexpr (rank == 1 and rank_dynamic == 0)
61 else if constexpr (rank == 1)
64 return std::forward<decltype(m)>(m);
70 adjoint = [](
auto&& m) -> decltype(
auto) requires (rank <= 2)
72 adjoint = [](
auto&& m, std::enable_if_t<std::decay_t<decltype(m)>::rank() <= 2,
int> = 0) -> decltype(
auto)
75 if constexpr (rank == 2)
76 return stdex::linalg::conjugate_transposed(std::forward<decltype(m)>(m));
Definition: basics.hpp:41
decltype(auto) constexpr conjugate(Arg &&arg)
Take the complex conjugate of an indexible object.
Definition: conjugate.hpp:44
Definition: mdspan.hpp:34
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:42
Forward declaration of library_interface, which must be defined for all objects used in OpenKalman...
decltype(auto) constexpr transpose(Arg &&arg)
Swap any two indices of an indexible_object.
Definition: transpose.hpp:163
Definition of object_traits for std::mdspan.
decltype(auto) constexpr adjoint(Arg &&arg)
Take the conjugate-transpose of an indexible_object.
Definition: adjoint.hpp:35
Basic definitions for OpenKalman as a whole.
Definition: extents.hpp:372