5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_MATRIX_OBSERVERS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_LINALG_MATRIX_OBSERVERS_HPP_
14#include "arene/base/linalg/detail/mandates.hpp"
17#include "arene/base/stdlib_choice/cstddef.hpp"
18#include "arene/base/stdlib_choice/enable_if.hpp"
19#include "arene/base/stdlib_choice/integral_constant.hpp"
29namespace matrix_observers_detail {
33template <std::
size_t Axis>
34class extent_accessor_fn {
44 template <
typename Mat, arene::base::constra
ints<std::enable_if_t<is_in_matrix_v<Mat>>> =
nullptr>
46 return matrix.extent(Axis);
64template <
typename Mat, std::
size_t Axis,
typename = arene::base::constra
ints<>>
66 static_assert(
is_in_matrix_v<Mat>,
"static_row_count/static_column_count: Mat must be an in-matrix");
75template <
typename Mat, std::
size_t Axis>
76class static_extent<Mat, Axis, arene::
base::constraints<std::enable_if_t<is_in_matrix_v<Mat>>>>
77 :
public std::integral_constant<std::size_t, math_extents_t<Mat>::static_extent(Axis)> {};
105template <
typename Mat>
114template <
typename Mat>
121template <
typename Mat>
128template <
typename Mat>
131namespace matrix_observers_detail {
140 template <
typename Mat, arene::base::constra
ints<std::enable_if_t<possibly_square_v<Mat>>> =
nullptr>
141 constexpr auto operator()(Mat matrix)
const noexcept ->
bool {
142 return row_count(matrix) == column_count(matrix);
151 constexpr auto operator()(Mat )
const noexcept ->
bool {
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
Trait holding the compile-time number of columns of a matrix.
Definition matrix_observers.hpp:129
Trait holding the compile-time number of rows of a matrix.
Definition matrix_observers.hpp:122
A helper class to represent a compile-time constant with the specified type and value....
Definition integral_constant.hpp:23
constexpr std::size_t static_row_count_v
The compile-time number of rows of a matrix.
constexpr bool is_in_matrix_v
Determine if the given type is an in-matrix, usable as an input matrix for linalg algorithms.
constexpr std::size_t static_column_count_v
The compile-time number of columns of a matrix.
typename math_traits< T >::index_type math_index_t
The mdspan-equivalent index type of T if T is a linalg object, or a substitution error if not.
Definition math_traits.hpp:76
Definition accumulate.hpp:37
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29