#include #include #include #include #include template typename std::enable_if::value, void>::type randomInit(MA& A) { using ElementType = typename MA::ElementType; using Index = typename MA::Index; std::random_device random; std::mt19937 mt(random()); std::uniform_real_distribution uniform(-100,100); hpc::matvec::apply(A, [&](ElementType& val, Index i, Index j) -> void { val = uniform(mt); }); } int main() { using namespace hpc::matvec; GeMatrix A(1000, 1000); randomInit(A); /* print a small block of each of the initialized matrices */ auto A1 = A(500, 500, 5, 5); print(A1, "A1"); }