ycpp 0.1.0__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. ycpp/__init__.py +110 -0
  2. ycpp/_array.py +318 -0
  3. ycpp/_awareness.py +268 -0
  4. ycpp/_doc.py +718 -0
  5. ycpp/_event.py +188 -0
  6. ycpp/_id_map.py +620 -0
  7. ycpp/_map.py +267 -0
  8. ycpp/_provider.py +180 -0
  9. ycpp/_snapshot.py +28 -0
  10. ycpp/_sticky_index.py +59 -0
  11. ycpp/_stream.py +91 -0
  12. ycpp/_sync.py +192 -0
  13. ycpp/_text.py +239 -0
  14. ycpp/_transaction.py +287 -0
  15. ycpp/_typed.py +122 -0
  16. ycpp/_undo.py +201 -0
  17. ycpp/_update.py +18 -0
  18. ycpp/_xml.py +452 -0
  19. ycpp/_ycpp.cp312-win_amd64.lib +0 -0
  20. ycpp/_ycpp.cp312-win_amd64.pyd +0 -0
  21. ycpp-0.1.0.data/headers/fast_float/ascii_number.h +766 -0
  22. ycpp-0.1.0.data/headers/fast_float/bigint.h +638 -0
  23. ycpp-0.1.0.data/headers/fast_float/constexpr_feature_detect.h +53 -0
  24. ycpp-0.1.0.data/headers/fast_float/decimal_to_binary.h +212 -0
  25. ycpp-0.1.0.data/headers/fast_float/digit_comparison.h +455 -0
  26. ycpp-0.1.0.data/headers/fast_float/fast_float.h +91 -0
  27. ycpp-0.1.0.data/headers/fast_float/fast_table.h +708 -0
  28. ycpp-0.1.0.data/headers/fast_float/float_common.h +1432 -0
  29. ycpp-0.1.0.data/headers/fast_float/parse_number.h +488 -0
  30. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  31. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_bit.hpp +230 -0
  32. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  33. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  34. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  35. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  36. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  37. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  38. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  39. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  40. ycpp-0.1.0.data/headers/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  41. ycpp-0.1.0.data/headers/xsimd/arch/utils/shifts.hpp +82 -0
  42. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx.hpp +2111 -0
  43. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx2.hpp +1591 -0
  44. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  45. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  46. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  47. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512er.hpp +17 -0
  48. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  49. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  50. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  51. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  52. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  53. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  54. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  55. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  56. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_common.hpp +26 -0
  57. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  58. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_constants.hpp +393 -0
  59. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_emulated.hpp +787 -0
  60. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  61. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  62. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  63. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_fma4.hpp +92 -0
  64. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  65. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_isa.hpp +146 -0
  66. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_neon.hpp +3580 -0
  67. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_neon64.hpp +1614 -0
  68. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_rvv.hpp +1515 -0
  69. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_scalar.hpp +1210 -0
  70. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse2.hpp +2333 -0
  71. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse3.hpp +66 -0
  72. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  73. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  74. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_ssse3.hpp +186 -0
  75. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_sve.hpp +1186 -0
  76. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_vsx.hpp +916 -0
  77. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_vxe.hpp +787 -0
  78. ycpp-0.1.0.data/headers/xsimd/arch/xsimd_wasm.hpp +1819 -0
  79. ycpp-0.1.0.data/headers/xsimd/config/xsimd_arch.hpp +242 -0
  80. ycpp-0.1.0.data/headers/xsimd/config/xsimd_config.hpp +620 -0
  81. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features.hpp +50 -0
  82. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  83. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  84. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  85. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  86. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpu_features_x86.hpp +1044 -0
  87. ycpp-0.1.0.data/headers/xsimd/config/xsimd_cpuid.hpp +144 -0
  88. ycpp-0.1.0.data/headers/xsimd/config/xsimd_getauxval.hpp +159 -0
  89. ycpp-0.1.0.data/headers/xsimd/config/xsimd_macros.hpp +76 -0
  90. ycpp-0.1.0.data/headers/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  91. ycpp-0.1.0.data/headers/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  92. ycpp-0.1.0.data/headers/xsimd/memory/xsimd_alignment.hpp +102 -0
  93. ycpp-0.1.0.data/headers/xsimd/types/xsimd_all_registers.hpp +57 -0
  94. ycpp-0.1.0.data/headers/xsimd/types/xsimd_api.hpp +3106 -0
  95. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx2_register.hpp +44 -0
  96. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  97. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  98. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  99. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  100. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  101. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  102. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  103. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  104. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  105. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  106. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  107. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avx_register.hpp +64 -0
  108. ycpp-0.1.0.data/headers/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  109. ycpp-0.1.0.data/headers/xsimd/types/xsimd_batch.hpp +1665 -0
  110. ycpp-0.1.0.data/headers/xsimd/types/xsimd_batch_constant.hpp +571 -0
  111. ycpp-0.1.0.data/headers/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  112. ycpp-0.1.0.data/headers/xsimd/types/xsimd_common_arch.hpp +49 -0
  113. ycpp-0.1.0.data/headers/xsimd/types/xsimd_emulated_register.hpp +80 -0
  114. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  115. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  116. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  117. ycpp-0.1.0.data/headers/xsimd/types/xsimd_fma4_register.hpp +50 -0
  118. ycpp-0.1.0.data/headers/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  119. ycpp-0.1.0.data/headers/xsimd/types/xsimd_neon64_register.hpp +55 -0
  120. ycpp-0.1.0.data/headers/xsimd/types/xsimd_neon_register.hpp +130 -0
  121. ycpp-0.1.0.data/headers/xsimd/types/xsimd_register.hpp +96 -0
  122. ycpp-0.1.0.data/headers/xsimd/types/xsimd_rvv_register.hpp +491 -0
  123. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse2_register.hpp +59 -0
  124. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse3_register.hpp +49 -0
  125. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  126. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  127. ycpp-0.1.0.data/headers/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  128. ycpp-0.1.0.data/headers/xsimd/types/xsimd_sve_register.hpp +216 -0
  129. ycpp-0.1.0.data/headers/xsimd/types/xsimd_traits.hpp +408 -0
  130. ycpp-0.1.0.data/headers/xsimd/types/xsimd_utils.hpp +462 -0
  131. ycpp-0.1.0.data/headers/xsimd/types/xsimd_vsx_register.hpp +77 -0
  132. ycpp-0.1.0.data/headers/xsimd/types/xsimd_vxe_register.hpp +86 -0
  133. ycpp-0.1.0.data/headers/xsimd/types/xsimd_wasm_register.hpp +59 -0
  134. ycpp-0.1.0.data/headers/xsimd/utils/bits.hpp +122 -0
  135. ycpp-0.1.0.data/headers/xsimd/utils/xsimd_type_traits.hpp +145 -0
  136. ycpp-0.1.0.data/headers/xsimd/xsimd.hpp +43 -0
  137. ycpp-0.1.0.dist-info/DELVEWHEEL +2 -0
  138. ycpp-0.1.0.dist-info/METADATA +15 -0
  139. ycpp-0.1.0.dist-info/RECORD +142 -0
  140. ycpp-0.1.0.dist-info/WHEEL +4 -0
  141. ycpp.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
  142. ycpp.libs/msvcp140_1-226498d4bfcb4f07974757b596ebec45.dll +0 -0
@@ -0,0 +1,408 @@
1
+ /***************************************************************************
2
+ * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3
+ * Martin Renou *
4
+ * Copyright (c) QuantStack *
5
+ * Copyright (c) Serge Guelton *
6
+ * *
7
+ * Distributed under the terms of the BSD 3-Clause License. *
8
+ * *
9
+ * The full license is in the file LICENSE, distributed with this software. *
10
+ ****************************************************************************/
11
+
12
+ #ifndef XSIMD_TRAITS_HPP
13
+ #define XSIMD_TRAITS_HPP
14
+
15
+ #include <complex>
16
+ #include <cstdint>
17
+ #include <type_traits>
18
+
19
+ #ifdef XSIMD_ENABLE_XTL_COMPLEX
20
+ #include <xtl/xcomplex.hpp>
21
+ #endif
22
+
23
+ #include "./xsimd_batch_fwd.hpp"
24
+ #include "./xsimd_utils.hpp"
25
+
26
+ /**
27
+ * high level type traits
28
+ *
29
+ * @defgroup batch_traits Type traits
30
+ *
31
+ **/
32
+
33
+ namespace xsimd
34
+ {
35
+
36
+ /**************************************
37
+ * simd_traits and revert_simd_traits *
38
+ **************************************/
39
+
40
+ template <class T, class A = default_arch>
41
+ struct has_simd_register : types::has_simd_register<T, A>
42
+ {
43
+ };
44
+
45
+ template <class T, class A>
46
+ struct has_simd_register<std::complex<T>, A> : has_simd_register<T, A>
47
+ {
48
+ };
49
+
50
+ namespace detail
51
+ {
52
+ template <class T, bool>
53
+ struct simd_traits_impl;
54
+
55
+ template <class T>
56
+ struct simd_traits_impl<T, false>
57
+ {
58
+ using type = T;
59
+ using bool_type = bool;
60
+ static constexpr size_t size = 1;
61
+ };
62
+
63
+ #if __cplusplus < 201703L
64
+ template <class T>
65
+ constexpr size_t simd_traits_impl<T, false>::size;
66
+ #endif
67
+
68
+ template <class T>
69
+ struct simd_traits_impl<T, true>
70
+ {
71
+ using type = batch<T>;
72
+ using bool_type = typename type::batch_bool_type;
73
+ static constexpr size_t size = type::size;
74
+ };
75
+
76
+ #if __cplusplus < 201703L
77
+ template <class T>
78
+ constexpr size_t simd_traits_impl<T, true>::size;
79
+ #endif
80
+
81
+ template <class T, class A>
82
+ struct static_check_supported_config_emitter
83
+ {
84
+
85
+ static_assert(A::supported(),
86
+ "usage of batch type with unsupported architecture");
87
+ static_assert(!A::supported() || xsimd::has_simd_register<T, A>::value,
88
+ "usage of batch type with unsupported type");
89
+ };
90
+
91
+ template <class A>
92
+ struct static_check_supported_config_emitter<bool, A> : static_check_supported_config_emitter<xsimd::as_unsigned_integer_t<bool>, A>
93
+ {
94
+ };
95
+
96
+ template <class T, class A>
97
+ struct static_check_supported_config_emitter<std::complex<T>, A> : static_check_supported_config_emitter<T, A>
98
+ {
99
+ };
100
+
101
+ #ifdef XSIMD_ENABLE_XTL_COMPLEX
102
+ template <class T, class A, bool i3ec>
103
+ struct static_check_supported_config_emitter<xtl::xcomplex<T, T, i3ec>, A> : static_check_supported_config_emitter<T, A>
104
+ {
105
+ };
106
+ #endif
107
+
108
+ // consistency checker
109
+ template <class T, class A>
110
+ XSIMD_INLINE void static_check_supported_config()
111
+ {
112
+ (void)static_check_supported_config_emitter<T, A>();
113
+ }
114
+ }
115
+
116
+ template <class T>
117
+ struct simd_traits : detail::simd_traits_impl<T, xsimd::has_simd_register<T>::value>
118
+ {
119
+ };
120
+
121
+ template <class T>
122
+ struct simd_traits<std::complex<T>>
123
+ : detail::simd_traits_impl<std::complex<T>, xsimd::has_simd_register<T>::value>
124
+ {
125
+ };
126
+
127
+ #ifdef XSIMD_ENABLE_XTL_COMPLEX
128
+ template <class T, bool i3ec>
129
+ struct simd_traits<xtl::xcomplex<T, T, i3ec>>
130
+ : detail::simd_traits_impl<std::complex<T>, xsimd::has_simd_register<T>::value>
131
+ {
132
+ };
133
+ #endif
134
+
135
+ template <class T>
136
+ struct revert_simd_traits
137
+ {
138
+ using type = T;
139
+ static constexpr size_t size = simd_traits<type>::size;
140
+ };
141
+
142
+ #if __cplusplus < 201703L
143
+ template <class T>
144
+ constexpr size_t revert_simd_traits<T>::size;
145
+ #endif
146
+
147
+ template <class T>
148
+ struct revert_simd_traits<batch<T>>
149
+ {
150
+ using type = T;
151
+ static constexpr size_t size = batch<T>::size;
152
+ };
153
+
154
+ #if __cplusplus < 201703L
155
+ template <class T>
156
+ constexpr size_t revert_simd_traits<batch<T>>::size;
157
+ #endif
158
+
159
+ template <class T>
160
+ using simd_type = typename simd_traits<T>::type;
161
+
162
+ template <class T>
163
+ using simd_bool_type = typename simd_traits<T>::bool_type;
164
+
165
+ template <class T>
166
+ using revert_simd_type = typename revert_simd_traits<T>::type;
167
+
168
+ /********************
169
+ * simd_return_type *
170
+ ********************/
171
+
172
+ namespace detail
173
+ {
174
+ template <class T1, class T2>
175
+ struct simd_condition
176
+ {
177
+ static constexpr bool value = (std::is_same<T1, T2>::value && !std::is_same<T1, bool>::value) || (std::is_same<T1, bool>::value && !std::is_same<T2, bool>::value) || std::is_same<T1, float>::value || std::is_same<T1, double>::value || std::is_same<T1, int8_t>::value || std::is_same<T1, uint8_t>::value || std::is_same<T1, int16_t>::value || std::is_same<T1, uint16_t>::value || std::is_same<T1, int32_t>::value || std::is_same<T1, uint32_t>::value || std::is_same<T1, int64_t>::value || std::is_same<T1, uint64_t>::value || std::is_same<T1, char>::value || detail::is_complex<T1>::value;
178
+ };
179
+
180
+ template <class T1, class T2, class A>
181
+ struct simd_return_type_impl
182
+ : std::enable_if<simd_condition<T1, T2>::value, batch<T2, A>>
183
+ {
184
+ };
185
+
186
+ template <class T2, class A>
187
+ struct simd_return_type_impl<bool, T2, A>
188
+ : std::enable_if<simd_condition<bool, T2>::value, batch_bool<T2, A>>
189
+ {
190
+ };
191
+
192
+ template <class T2, class A>
193
+ struct simd_return_type_impl<bool, std::complex<T2>, A>
194
+ : std::enable_if<simd_condition<bool, T2>::value, batch_bool<T2, A>>
195
+ {
196
+ };
197
+
198
+ template <class T1, class T2, class A>
199
+ struct simd_return_type_impl<std::complex<T1>, T2, A>
200
+ : std::enable_if<simd_condition<T1, T2>::value, batch<std::complex<T2>, A>>
201
+ {
202
+ };
203
+
204
+ template <class T1, class T2, class A>
205
+ struct simd_return_type_impl<std::complex<T1>, std::complex<T2>, A>
206
+ : std::enable_if<simd_condition<T1, T2>::value, batch<std::complex<T2>, A>>
207
+ {
208
+ };
209
+
210
+ #ifdef XSIMD_ENABLE_XTL_COMPLEX
211
+ template <class T1, class T2, bool I3EC, class A>
212
+ struct simd_return_type_impl<xtl::xcomplex<T1, T1, I3EC>, T2, A>
213
+ : std::enable_if<simd_condition<T1, T2>::value, batch<std::complex<T2>, A>>
214
+ {
215
+ };
216
+
217
+ template <class T1, class T2, bool I3EC, class A>
218
+ struct simd_return_type_impl<xtl::xcomplex<T1, T1, I3EC>, std::complex<T2>, A>
219
+ : std::enable_if<simd_condition<T1, T2>::value, batch<std::complex<T2>, A>>
220
+ {
221
+ };
222
+
223
+ template <class T1, class T2, bool I3EC, class A>
224
+ struct simd_return_type_impl<xtl::xcomplex<T1, T1, I3EC>, xtl::xcomplex<T2, T2, I3EC>, A>
225
+ : std::enable_if<simd_condition<T1, T2>::value, batch<std::complex<T2>, A>>
226
+ {
227
+ };
228
+
229
+ template <class T1, class T2, bool I3EC, class A>
230
+ struct simd_return_type_impl<std::complex<T1>, xtl::xcomplex<T2, T2, I3EC>, A>
231
+ : std::enable_if<simd_condition<T1, T2>::value, batch<std::complex<T2>, A>>
232
+ {
233
+ };
234
+ #endif
235
+ }
236
+
237
+ template <class T1, class T2, class A = default_arch>
238
+ using simd_return_type = typename detail::simd_return_type_impl<T1, T2, A>::type;
239
+
240
+ /**
241
+ * @ingroup batch_traits
242
+ *
243
+ * type traits that provide information about a batch or scalar type.
244
+ *
245
+ * @tparam T type to analyze.
246
+ */
247
+
248
+ template <class T>
249
+ struct batch_traits
250
+ {
251
+ using scalar_type = T; ///< T if scalar, or type of the scalar element for the batch T.
252
+ using mask_type = bool; ///< Mask type for T: bool for scalars, or batch_bool for batch types.
253
+
254
+ static constexpr bool is_batch = false; ///< True if T is @c batch<...>.
255
+ static constexpr bool is_batch_bool = false; ///< True if T is @c batch_bool<...>.
256
+ static constexpr bool is_any_batch = false; ///< True if T is @c batch<...> or @c batch_bool<...>.
257
+ static constexpr bool is_complex = detail::is_complex<T>::value; ///< True if T is complex or a batch of complex values.
258
+ };
259
+
260
+ #if __cplusplus < 201703L
261
+ template <class T>
262
+ constexpr bool batch_traits<T>::is_batch;
263
+ template <class T>
264
+ constexpr bool batch_traits<T>::is_batch_bool;
265
+ template <class T>
266
+ constexpr bool batch_traits<T>::is_any_batch;
267
+ template <class T>
268
+ constexpr bool batch_traits<T>::is_complex;
269
+ #endif
270
+
271
+ template <class T, class A>
272
+ struct batch_traits<batch<T, A>>
273
+ {
274
+ using scalar_type = T;
275
+ using mask_type = typename batch<T, A>::batch_bool_type;
276
+
277
+ static constexpr bool is_batch = true;
278
+ static constexpr bool is_batch_bool = false;
279
+ static constexpr bool is_any_batch = true;
280
+ static constexpr bool is_complex = detail::is_complex<T>::value;
281
+ };
282
+
283
+ #if __cplusplus < 201703L
284
+ template <class T, class A>
285
+ constexpr bool batch_traits<batch<T, A>>::is_batch;
286
+ template <class T, class A>
287
+ constexpr bool batch_traits<batch<T, A>>::is_batch_bool;
288
+ template <class T, class A>
289
+ constexpr bool batch_traits<batch<T, A>>::is_any_batch;
290
+ template <class T, class A>
291
+ constexpr bool batch_traits<batch<T, A>>::is_complex;
292
+ #endif
293
+
294
+ template <class T, class A>
295
+ struct batch_traits<batch_bool<T, A>>
296
+ {
297
+ using scalar_type = bool;
298
+ using mask_type = batch_bool<T, A>;
299
+
300
+ static constexpr bool is_batch = false;
301
+ static constexpr bool is_batch_bool = true;
302
+ static constexpr bool is_any_batch = true;
303
+ static constexpr bool is_complex = false;
304
+ };
305
+
306
+ #if __cplusplus < 201703L
307
+ template <class T, class A>
308
+ constexpr bool batch_traits<batch_bool<T, A>>::is_batch;
309
+ template <class T, class A>
310
+ constexpr bool batch_traits<batch_bool<T, A>>::is_batch_bool;
311
+ template <class T, class A>
312
+ constexpr bool batch_traits<batch_bool<T, A>>::is_any_batch;
313
+ template <class T, class A>
314
+ constexpr bool batch_traits<batch_bool<T, A>>::is_complex;
315
+ #endif
316
+
317
+ /**
318
+ * @ingroup batch_traits
319
+ *
320
+ * type traits that inherits from @c std::true_type for @c batch<...> types and from
321
+ * @c std::false_type otherwise.
322
+ *
323
+ * @tparam T type to analyze.
324
+ */
325
+
326
+ template <class T>
327
+ struct is_batch : std::integral_constant<bool, batch_traits<T>::is_batch>
328
+ {
329
+ };
330
+
331
+ /**
332
+ * @ingroup batch_traits
333
+ *
334
+ * type traits that inherits from @c std::true_type for @c batch_bool<...> types and from
335
+ * @c std::false_type otherwise.
336
+ *
337
+ * @tparam T type to analyze.
338
+ */
339
+
340
+ template <class T>
341
+ struct is_batch_bool : std::integral_constant<bool, batch_traits<T>::is_batch_bool>
342
+ {
343
+ };
344
+
345
+ /**
346
+ * @ingroup batch_traits
347
+ *
348
+ * type traits that inherits from @c std::true_type for @c batch<...> or batch_bool<...>
349
+ * types and from @c std::false_type otherwise.
350
+ *
351
+ * @tparam T type to analyze.
352
+ */
353
+
354
+ template <class T>
355
+ struct is_any_batch : std::integral_constant<bool, batch_traits<T>::is_any_batch>
356
+ {
357
+ };
358
+
359
+ /**
360
+ * @ingroup batch_traits
361
+ *
362
+ * type traits that inherits from @c std::true_type for @c batch<std::complex<...>>
363
+ * types and from @c std::false_type otherwise.
364
+ *
365
+ * @tparam T type to analyze.
366
+ */
367
+
368
+ template <class T>
369
+ struct is_batch_complex : std::integral_constant<bool, batch_traits<T>::is_batch && batch_traits<T>::is_complex>
370
+ {
371
+ };
372
+
373
+ /**
374
+ * @ingroup batch_traits
375
+ *
376
+ * type traits whose @c type field is set to @c T::value_type if @c
377
+ * is_batch<T>::value and to @c T otherwise.
378
+ *
379
+ * @tparam T type to analyze.
380
+ */
381
+ template <class T>
382
+ struct scalar_type
383
+ {
384
+ using type = typename batch_traits<T>::scalar_type;
385
+ };
386
+
387
+ template <class T>
388
+ using scalar_type_t = typename scalar_type<T>::type;
389
+
390
+ /**
391
+ * @ingroup batch_traits
392
+ *
393
+ * type traits whose @c type field is set to @c T::value_type if @c
394
+ * is_batch_bool<T>::value and to @c bool otherwise.
395
+ *
396
+ * @tparam T type to analyze.
397
+ */
398
+ template <class T>
399
+ struct mask_type
400
+ {
401
+ using type = typename batch_traits<T>::mask_type;
402
+ };
403
+
404
+ template <class T>
405
+ using mask_type_t = typename mask_type<T>::type;
406
+ }
407
+
408
+ #endif