double random_test_9(int a1, int a2) { CRandomGenerator rg; CMatrixTemplateNumeric<double> R(a1, a1); rg.drawGaussian1DMatrix(R, 0.0, 1.0); CMatrixTemplateNumeric<double> COV; COV.multiply_AAt(R); const size_t NSAMPS = 1000; // test 9: // ---------------------------------------- const long N = 1000; CTicTac tictac; std::vector<CVectorDouble> res; for (long i = 0; i < N; i++) { rg.drawGaussianMultivariateMany(res, NSAMPS, COV); } return tictac.Tac() / (N * NSAMPS); }
double random_test_8(int a1, int a2) { CRandomGenerator rg; CMatrixFixed<double, DIM, DIM> R; rg.drawGaussian1DMatrix(R, 0.0, 1.0); CMatrixFixed<double, DIM, DIM> COV; COV.matProductOf_AAt(R); const size_t NSAMPS = 1000; // test 8: // ---------------------------------------- const long N = 1000; CTicTac tictac; std::vector<CVectorDouble> res; for (long i = 0; i < N; i++) { rg.drawGaussianMultivariateMany(res, NSAMPS, COV); } return tictac.Tac() / (N * NSAMPS); }