1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "ra/ra.hh"
- #include "ra/test.hh"
- using std::cout, std::endl, std::flush, ra::TestRecorder;
- int main()
- {
- ra::Big<int, 1> x = ra::iota(7, -3);
-
-
-
- ra::Big<int, 1> y = where(abs(x) > 2, x+10, x-10);
-
-
-
-
-
-
-
- cout << x << endl << y << endl;
-
-
-
- ra::Big<int, 1> z = pick(where(x<0, 0, where(x==0, 1, 2)), x*3, 77, x*2);
- TestRecorder tr(std::cout, TestRecorder::NOISY);
- tr.test_eq(ra::start({7, -12, -11, -10, -9, -8, 13}), y);
- tr.test_eq(ra::start({-9, -6, -3, 77, 2, 4, 6}), z);
- return tr.summary();
- }
|