51 constexpr
int ensemble_size = 8;
57 scalar a = (scalar) 1.;
60 scalar b = (scalar) 2.0;
63 std::cout << std::endl;
64 std::cout << a << std::endl;
65 std::cout << b << std::endl;
66 std::cout << m1 << std::endl;
69 TEST_EQUALITY( m1[1],
false );
70 TEST_EQUALITY( m1[2],
true );
71 for (
auto i=3; i<ensemble_size; ++i)
72 TEST_EQUALITY( m1[i],
false );
74 TEST_EQUALITY( (
double) m1, 2./ensemble_size );
79 constexpr
int ensemble_size = 16;
85 scalar a = (scalar) 1.;
88 scalar b = (scalar) 2.0;
91 std::cout << std::endl;
92 std::cout << a << std::endl;
93 std::cout << b << std::endl;
94 std::cout << m1 << std::endl;
97 TEST_EQUALITY( m1[1],
false );
98 TEST_EQUALITY( m1[2],
true );
99 for (
auto i=3; i<ensemble_size; ++i)
100 TEST_EQUALITY( m1[i],
false );
102 TEST_EQUALITY( (
double) m1, 2./ensemble_size );
107 constexpr
int ensemble_size = 8;
113 scalar a = (scalar) 1.;
116 scalar b = (scalar) 2.0;
120 std::cout << m1 << std::endl;
121 std::cout << m2 << std::endl;
122 for (
auto i=0; i<ensemble_size; ++i)
128 constexpr
int ensemble_size = 8;
134 scalar a = (scalar) 1.0;
137 scalar b = (scalar) 2.0;
145 std::cout << m1 << std::endl;
146 std::cout << mul << std::endl;
148 std::cout << mul2 << std::endl;
149 std::cout << mul3 << std::endl;
154 for (
auto i=3; i<ensemble_size; ++i)
162 constexpr
int ensemble_size = 16;
168 scalar a = (scalar) 1.0;
171 scalar b = (scalar) 2.0;
175 std::cout << m1 << std::endl;
176 std::cout << mul << std::endl;
181 for (
auto i=3; i<ensemble_size; ++i)
187 constexpr
int ensemble_size = 8;
193 scalar a = (scalar) 1.0;
196 scalar b = (scalar) 2.0;
199 scalar mul = m1*a + !m1*b;
200 scalar mul2 = a*m1 + !m1*b;
201 std::cout << m1 << std::endl;
202 std::cout << mul << std::endl;
203 std::cout << mul2 << std::endl;
208 for (
auto i=3; i<ensemble_size; ++i)
216 constexpr
int ensemble_size = 8;
222 using namespace MaskLogic;
224 scalar a = (scalar) 1.0;
227 scalar b = (scalar) 2.0;
230 auto m2 = a>(scalar) 0.0;
233 std::cout << m1 << std::endl;
234 std::cout << m2 << std::endl;
235 std::cout << m3<< std::endl;
236 std::cout << m4<< std::endl;
260 constexpr
int ensemble_size = 8;
266 using namespace MaskLogic;
268 scalar a = (scalar) 1.0;
271 scalar b = (scalar) 2.0;
275 std::cout << m1 << std::endl;
276 std::cout << m2 << std::endl;
289 constexpr
int ensemble_size = 8;
295 using namespace MaskLogic;
297 scalar a = (scalar) 1.0;
300 scalar b = (scalar) 2.0;
304 std::cout << m1 << std::endl;
305 std::cout << m2 << std::endl;
318 constexpr
int ensemble_size = 8;
324 using namespace MaskLogic;
326 scalar a = (scalar) 1.0;
328 scalar b = (scalar) 2.0;
332 std::cout << m1 << std::endl;
333 std::cout << m2 << std::endl;
346 constexpr
int ensemble_size = 8;
352 scalar a = (scalar) 1.0;
354 scalar b = (scalar) 2.0;
359 std::cout << m1 << std::endl;
360 std::cout << m2 << std::endl;
388 constexpr
int ensemble_size = 8;
394 scalar a = (scalar) 1.0;
396 scalar b = (scalar) 2.0;
402 std::cout << m1 << std::endl;
403 std::cout << m2 << std::endl;
404 std::cout << m3 << std::endl;
410 constexpr
int ensemble_size = 8;
416 scalar a = (scalar) 1.0;
418 scalar b = (scalar) 2.0;
424 std::cout << m1 << std::endl;
425 std::cout << m2 << std::endl;
426 std::cout << m3 << std::endl;
432 constexpr
int ensemble_size = 8;
438 scalar a = (scalar) 1.;
440 scalar b = (scalar) 2.0;
442 std::cout << a << std::endl;
443 std::cout << b << std::endl;
451 std::cout << m3 << std::endl;
457 constexpr
int ensemble_size = 8;
463 scalar a = (scalar) 1.;
465 scalar b = (scalar) 2.0;
469 std::cout << m1 << std::endl;
470 std::cout << m2 << std::endl;
471 auto m3 = (a>0.) - (a>b);
472 std::cout << m3 << std::endl;
478 constexpr
int ensemble_size = 8;
485 scalar a = (scalar) 1.;
496 constexpr
int ensemble_size = 8;
503 scalar a = (scalar) 1.;
506 scalar b = (scalar) 2.;
510 std::cout << std::endl;
511 std::cout << a << std::endl;
512 std::cout << b << std::endl;
514 std::cout << a << std::endl;
515 std::cout << b << std::endl;
523 Kokkos::initialize();
Vector< S > copysign(const Vector< S > &a1, const Vector< S > &a2)
Stokhos::StandardStorage< int, double > storage_type
Statically allocated storage class.
Kokkos::DefaultExecutionSpace execution_space
static int runUnitTestsFromMain(int argc, char *argv[])
int main(int argc, char **argv)
#define TEST_EQUALITY(v1, v2)
Mask< Sacado::MP::Vector< S > > signbit_v(const Sacado::MP::Vector< S > &a1)