1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include "ra/ra.hh"
- #include <iostream>
- using std::cout, std::endl;
- int main()
- {
-
-
-
-
- ra::Big<float, 3> A({3, 4, 5}, 1.);
- ra::Big<float, 2> B({3, 4}, 2.);
- ra::Big<float, 1> C({3}, 3.);
- ra::Big<float, 3> X({3, 4, 5}, 99.);
-
-
-
-
-
-
-
-
- X = map([](auto && a, auto && b, auto && c) { return a+b-c; }, A, B, C);
- cout << "\nX: " << X << endl;
-
-
-
- {
-
-
- ra::Big<float, 2> X = B*7.;
- cout << "\nB*7: " << X << endl;
- }
- {
-
- ra::Big<float, 2> X = B*C;
- cout << "\nB*C: " << X << endl;
- }
- {
-
- ra::Big<float, 2> X = B*B;
- cout << "\nB*B: " << X << endl;
- }
-
-
-
- {
- constexpr auto i = ra::iota<0>();
- constexpr auto j = ra::iota<1>();
-
- ra::Big<float, 2> X({3, 4}, i-j);
- cout << "\ni-j: " << X << endl;
-
-
- }
-
- {
- ra::Big<float, 2> A({3, 4}, 0);
- ra::Big<float, 1> b({3}, ra::_0);
- ra::Big<float, 1> c({4}, ra::_0);
-
-
- A = b;
- cout << "\nA: " << A << endl;
-
- A = c(ra::insert<1>);
- cout << "\nA: " << A << endl;
- }
- return 0;
- }
|