#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(7, 8); randomInit(A); print(A, "A"); }