11#ifndef TLAPACK_ARRAY_CONCEPTS_HH
12#define TLAPACK_ARRAY_CONCEPTS_HH
14#if __cplusplus >= 202002L
18 #include <type_traits>
54 concept Arithmetic =
requires(
const T& a,
const T& b, T& c)
54 concept Arithmetic =
requires(
const T& a,
const T& b, T& c) {
…}
104 template <
typename T>
106 std::numeric_limits<T>::is_specialized&&
requires(
const T& a, T& b)
120 ->std::same_as<
bool>;
124 ->std::same_as<
bool>;
163 template <
typename T>
169 T(real_type<T>(), real_type<T>());
179 ->std::same_as<real_type<T>>;
183 ->std::same_as<real_type<T>>;
211 template <
typename T>
216 a = std::forward<T>(a);
251 template <
typename vector_t>
252 concept Vector =
requires(
const vector_t& v)
252 concept Vector =
requires(
const vector_t& v) {
…}
285 template <
typename vector_t>
329 template <
typename matrix_t>
330 concept Matrix =
requires(
const matrix_t& A)
330 concept Matrix =
requires(
const matrix_t& A) {
…}
416 template <
typename matrix_t>
421 slice(A, pair{0, 1}, pair{0, 1})
451 slice(A, 0, pair{0, 1})
457 slice(A, pair{0, 1}, 0)
488 template <
typename matrix_t>
501 template <
typename pair_t>
505 template <
typename pair_t>
537 template <
typename work_t>
544 ->internal::PairOfTransposableMatrixAndOther<>;
550 ->internal::PairOfVectorAndOther<>;
562 template <
typename T>
572 template <
typename T>
573 concept Side = std::convertible_to<T, tlapack::Side>;
583 template <
typename T>
584 concept Direction = std::convertible_to<T, tlapack::Direction>;
593 template <
typename T>
594 concept Op = std::convertible_to<T, tlapack::Op>;
604 template <
typename T>
605 concept StoreV = std::convertible_to<T, tlapack::StoreV>;
614 template <
typename T>
615 concept Norm = std::convertible_to<T, tlapack::Norm>;
624 template <
typename T>
625 concept Uplo = std::convertible_to<T, tlapack::Uplo>;
634 template <
typename T>
635 concept Diag = std::convertible_to<T, tlapack::Diag>;
651 template <
typename T>
661 ->std::convertible_to<size_type<T>>;
665 ->std::convertible_to<size_type<T>>;
667 (legacy_matrix(A)).ptr[0]
669 ->std::convertible_to<type_t<T>>;
671 (legacy_matrix(A)).ldim
673 ->std::convertible_to<size_type<T>>;
689 template <
typename matrix_t>
691 ((layout<matrix_t> == Layout::ColMajor) ||
692 (layout<matrix_t> == Layout::RowMajor));
709 template <
typename vector_t>
711 ((layout<vector_t> == Layout::ColMajor) ||
712 (layout<vector_t> == Layout::RowMajor) ||
713 (layout<vector_t> == Layout::Strided)) &&
714 requires(
const vector_t& v)
719 ->std::convertible_to<size_type<vector_t>>;
721 (legacy_vector(v)).ptr[0]
723 ->std::convertible_to<type_t<vector_t>>;
725 (legacy_vector(v)).inc
727 ->std::convertible_to<size_type<vector_t>>;
766 template <
typename array_t>
769 type_t<array_t>* ptr)
772 Create<matrix_type<array_t>>()(v, 2, 3)
776 Create<vector_type<array_t>>()(v, 2)
780 CreateStatic<matrix_type<array_t>, 5, 6>()(ptr)
784 CreateStatic<vector_type<array_t>, 5>()(ptr)
813 template <
typename matrix_t>
816 std::vector<type_t<matrix_t>>& v, type_t<matrix_t>* ptr)
819 Create<matrix_t>()(v, 2, 3)
823 CreateStatic<matrix_t, 5, 6>()(ptr)
837 template <
typename matrix_t>
864 template <
typename vector_t>
867 std::vector<type_t<vector_t>>& v, type_t<vector_t>* ptr)
870 Create<vector_t>()(v, 2)
874 CreateStatic<vector_t, 5>()(ptr)
888 template <
typename vector_t>
896 #define TLAPACK_MATRIX tlapack::concepts::Matrix
899 #define TLAPACK_SMATRIX tlapack::concepts::SliceableMatrix
903 #define TLAPACK_STMATRIX tlapack::concepts::SliceableTransposeMatrix
906 #define TLAPACK_VECTOR tlapack::concepts::Vector
909 #define TLAPACK_SVECTOR tlapack::concepts::SliceableVector
912 #define TLAPACK_WORKSPACE tlapack::concepts::Workspace
915 #define TLAPACK_SCALAR tlapack::concepts::Scalar
918 #define TLAPACK_REAL tlapack::concepts::Real
921 #define TLAPACK_COMPLEX tlapack::concepts::Complex
924 #define TLAPACK_INDEX tlapack::concepts::Index
927 #define TLAPACK_SIDE tlapack::concepts::Side
930 #define TLAPACK_DIRECTION tlapack::concepts::Direction
933 #define TLAPACK_OP tlapack::concepts::Op
936 #define TLAPACK_STOREV tlapack::concepts::StoreV
939 #define TLAPACK_NORM tlapack::concepts::Norm
942 #define TLAPACK_UPLO tlapack::concepts::Uplo
945 #define TLAPACK_DIAG tlapack::concepts::Diag
948 #define TLAPACK_LEGACY_ARRAY tlapack::concepts::LegacyArray
951 #define TLAPACK_LEGACY_MATRIX tlapack::concepts::LegacyMatrix
954 #define TLAPACK_LEGACY_VECTOR tlapack::concepts::LegacyVector
957 #define TLAPACK_CMATRIX tlapack::concepts::ConstructableMatrix
961 #define TLAPACK_CSMATRIX tlapack::concepts::ConstructableAndSliceableMatrix
964 #define TLAPACK_CVECTOR tlapack::concepts::ConstructableVector
968 #define TLAPACK_CSVECTOR tlapack::concepts::ConstructableAndSliceableVector
972 #define TLAPACK_MATRIX class
973 #define TLAPACK_SMATRIX class
974 #define TLAPACK_STMATRIX class
976 #define TLAPACK_VECTOR class
977 #define TLAPACK_SVECTOR class
979 #define TLAPACK_WORKSPACE class
981 #define TLAPACK_SCALAR class
982 #define TLAPACK_REAL class
983 #define TLAPACK_COMPLEX class
984 #define TLAPACK_INDEX class
986 #define TLAPACK_SIDE class
987 #define TLAPACK_DIRECTION class
988 #define TLAPACK_OP class
989 #define TLAPACK_STOREV class
990 #define TLAPACK_NORM class
991 #define TLAPACK_UPLO class
992 #define TLAPACK_DIAG class
994 #define TLAPACK_LEGACY_ARRAY class
995 #define TLAPACK_LEGACY_MATRIX class
996 #define TLAPACK_LEGACY_VECTOR class
998 #define TLAPACK_CMATRIX class
999 #define TLAPACK_CSMATRIX class
1000 #define TLAPACK_CVECTOR class
1001 #define TLAPACK_CSVECTOR class
constexpr Layout layout
Layout of a matrix or vector.
Definition arrayTraits.hpp:232
Layout
Definition types.hpp:29
constexpr bool isnan(const T &x) noexcept
Extends std::isnan() to complex numbers.
Definition utils.hpp:125
constexpr real_type< T > real(const T &x) noexcept
Extends std::real() to real datatypes.
Definition utils.hpp:71
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
constexpr real_type< T > imag(const T &x) noexcept
Extends std::imag() to real datatypes.
Definition utils.hpp:86
constexpr bool isinf(const T &x) noexcept
Extends std::isinf() to complex numbers.
Definition utils.hpp:117
Definition concepts.hpp:54
Definition concepts.hpp:164
Definition concepts.hpp:838
Definition concepts.hpp:889
Definition concepts.hpp:767
Definition concepts.hpp:814
Definition concepts.hpp:865
Definition concepts.hpp:635
Definition concepts.hpp:584
Definition concepts.hpp:563
Definition concepts.hpp:652
Definition concepts.hpp:690
Definition concepts.hpp:710
Definition concepts.hpp:330
Definition concepts.hpp:615
Definition concepts.hpp:594
Definition concepts.hpp:105
Definition concepts.hpp:212
Definition concepts.hpp:573
Definition concepts.hpp:417
Definition concepts.hpp:286
Definition concepts.hpp:605
Definition concepts.hpp:489
Definition concepts.hpp:625
Definition concepts.hpp:252
Definition concepts.hpp:538
Definition concepts.hpp:502
Definition concepts.hpp:506
constexpr auto diag(T &A, int diagIdx=0) noexcept
Get the Diagonal of an Eigen Matrix.
Definition eigen.hpp:576