Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 722be4e

Browse files
committed
Fix requirements for simd type
1 parent 8fc8f6d commit 722be4e

12 files changed

Lines changed: 22 additions & 13 deletions

File tree

‎common/include/algebra/concepts.hpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@ namespace algebra::concepts {
1919
template <typename T>
2020
concept arithmetic = std::is_arithmetic_v<T>;
2121

22+
/// Arithmetic types
23+
template <typename T>
24+
concept enumeration = std::is_enum_v<T>;
25+
2226
// Value concept: Single entry
2327
template <typename T>
2428
concept value = algebra::concepts::arithmetic<std::decay_t<T>>;
2529

30+
// Element concept: Single entry, not necessarily for vector/matrix operations
31+
template <typename T>
32+
concept element = algebra::concepts::value<T> ||
33+
algebra::concepts::enumeration<std::decay_t<T>>;
34+
2635
/// Scalar concept: Elements of vectors/matrices (can be simd vectors)
2736
template <typename T>
2837
concept scalar = !algebra::traits::is_matrix<T> &&

‎common/include/algebra/type_traits.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ using index_t = typename index<M>::type;
3333
template <class M>
3434
struct value {};
3535

36-
template <class M>
37-
using value_t = typename value<M>::type;
38-
3936
template <typename T>
4037
requires(std::is_arithmetic_v<T>&& std::is_scalar_v<T>) struct value<T> {
4138
using type = T;
4239
};
40+
41+
template <class M>
42+
using value_t = typename value<M>::type;
4343
/// @}
4444

4545
/// Scalar type that is used with the matrix (can be multiple values in SoA)

‎frontend/array_cmath/include/algebra/array_cmath.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct array {
130130
/// Define scalar type
131131
using value_type = V;
132132

133-
template <concepts::value T>
133+
template <concepts::element T>
134134
using simd = T;
135135

136136
using boolean = bool;

‎frontend/eigen_eigen/include/algebra/eigen_eigen.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct eigen {
9494
/// Define scalar type
9595
using value_type = V;
9696

97-
template <concepts::value T>
97+
template <concepts::element T>
9898
using simd = T;
9999

100100
using boolean = bool;

‎frontend/eigen_generic/include/algebra/eigen_generic.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ struct eigen_generic {
106106
/// Define scalar type
107107
using value_type = V;
108108

109-
template <concepts::value T>
109+
template <concepts::element T>
110110
using simd = T;
111111

112112
using boolean = bool;

‎frontend/fastor_fastor/include/algebra/fastor_fastor.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct fastor {
101101
/// Define scalar type
102102
using value_type = V;
103103

104-
template <concepts::value T>
104+
template <concepts::element T>
105105
using simd = T;
106106

107107
using boolean = bool;

‎frontend/smatrix_generic/include/algebra/smatrix_generic.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct smatrix_generic {
9797
/// Define scalar type
9898
using value_type = V;
9999

100-
template <concepts::value T>
100+
template <concepts::element T>
101101
using simd = T;
102102

103103
using boolean = bool;

‎frontend/smatrix_smatrix/include/algebra/smatrix_smatrix.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct smatrix {
9292
/// Define scalar type
9393
using value_type = V;
9494

95-
template <concepts::value T>
95+
template <concepts::element T>
9696
using simd = T;
9797

9898
using boolean = bool;

‎frontend/vc_aos/include/algebra/vc_aos.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ struct vc_aos {
119119
/// Define scalar type
120120
using value_type = V;
121121

122-
template <concepts::value T>
122+
template <concepts::element T>
123123
using simd = T;
124124

125125
using boolean = bool;

‎frontend/vc_aos_generic/include/algebra/vc_aos_generic.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct vc_aos_generic {
105105
/// Define scalar type
106106
using value_type = V;
107107

108-
template <concepts::value T>
108+
template <concepts::element T>
109109
using simd = T;
110110

111111
using boolean = bool;

0 commit comments

Comments
 (0)