5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_OBJECT_TRAITS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_OBJECT_TRAITS_HPP_
12#include "arene/base/stdlib_choice/is_assignable.hpp"
13#include "arene/base/stdlib_choice/is_default_constructible.hpp"
14#include "arene/base/stdlib_choice/remove_cv.hpp"
33namespace linalg_traits_detail {
37extern constexpr bool is_in_object_v{
false};
44template <
typename ElementType,
typename Extents,
typename LayoutPolicy,
typename AccessorPolicy>
45extern constexpr bool is_in_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>{
is_scalar_v<
51extern constexpr bool is_out_object_v{
false};
58template <
typename ElementType,
typename Extents,
typename LayoutPolicy,
typename AccessorPolicy>
59extern constexpr bool is_out_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>{
60 is_in_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>> &&
64 mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>::is_always_unique()
70extern constexpr bool is_in_vector_v{
false};
77template <
typename ElementType,
typename Extents,
typename LayoutPolicy,
typename AccessorPolicy>
78extern constexpr bool is_in_vector_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>{
80 is_in_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>
86extern constexpr bool is_out_vector_v{
false};
93template <
typename ElementType,
typename Extents,
typename LayoutPolicy,
typename AccessorPolicy>
94extern constexpr bool is_out_vector_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>{
95 is_in_vector_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>> &&
96 is_out_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>
102extern constexpr bool is_in_matrix_v{
false};
109template <
typename ElementType,
typename Extents,
typename LayoutPolicy,
typename AccessorPolicy>
110extern constexpr bool is_in_matrix_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>{
112 is_in_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>
118extern constexpr bool is_out_matrix_v{
false};
125template <
typename ElementType,
typename Extents,
typename LayoutPolicy,
typename AccessorPolicy>
126extern constexpr bool is_out_matrix_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>{
127 is_in_matrix_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>> &&
128 is_out_object_v<mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>>
135extern constexpr bool is_in_vector_v{linalg_traits_detail::is_in_vector_v<std::remove_cv_t<T>>};
140extern constexpr bool is_out_vector_v{linalg_traits_detail::is_out_vector_v<std::remove_cv_t<T>>};
150extern constexpr bool is_in_matrix_v{linalg_traits_detail::is_in_matrix_v<std::remove_cv_t<T>>};
155extern constexpr bool is_out_matrix_v{linalg_traits_detail::is_out_matrix_v<std::remove_cv_t<T>>};
165extern constexpr bool is_in_object_v{linalg_traits_detail::is_in_object_v<std::remove_cv_t<T>>};
170extern constexpr bool is_out_object_v{linalg_traits_detail::is_out_object_v<std::remove_cv_t<T>>};
ElementType element_type
The element type.
Definition mdspan.hpp:183
static constexpr std::integral_constant< rank_type, Extents::rank()> rank
Get the number of dimensions.
Definition mdspan.hpp:206
std::remove_cv_t< element_type > value_type
The value type.
Definition mdspan.hpp:188
typename accessor_type::reference reference
The reference type.
Definition mdspan.hpp:200
static constexpr value_type value
Definition integral_constant.hpp:34
constexpr bool is_out_vector_v
Determine if the given type is an out-vector, usable as an output vector for linalg algorithms.
constexpr bool is_in_matrix_v
Determine if the given type is an in-matrix, usable as an input matrix for linalg algorithms.
constexpr bool is_inout_object_v
Determine if the given type is an inout-object, e.g. an inout-vector or inout-matrix.
constexpr bool is_in_object_v
Determine if the given type is an in-object, e.g. an in-vector or in-matrix.
constexpr bool is_inout_vector_v
Determine if the given type is an inout-vector, usable as both input and output vector for linalg alg...
constexpr bool is_inout_matrix_v
Determine if the given type is an inout-matrix, usable as both input and output matrix for linalg alg...
constexpr bool is_out_matrix_v
Determine if the given type is an out-matrix, usable as an output matrix for linalg algorithms.
constexpr bool is_in_vector_v
Determine if the given type is an in-vector, usable as an input vector for linalg algorithms.
constexpr bool is_scalar_v
Determine if the given type is a scalar for the purposes of linalg algorithms.
constexpr bool is_out_object_v
Determine if the given type is an out-object, e.g. an out-vector or out-matrix.
Definition accumulate.hpp:37
constexpr bool is_mdspan_v
Type trait to determine if the given type is an mdspan of some kind.
constexpr bool is_copyable_v
Backport for the C++20 copyable concept.
Definition accumulate.hpp:36