From 17ce8a90e3d503a55874cd09d25dd4f2b03996ca Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 12 Nov 2011 23:53:23 +0100 Subject: [PATCH] cholesky test can take matrix size and precision arguments --- edo/test/t-cholesky.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/edo/test/t-cholesky.cpp b/edo/test/t-cholesky.cpp index 5716d848..3b9ab5f8 100644 --- a/edo/test/t-cholesky.cpp +++ b/edo/test/t-cholesky.cpp @@ -99,7 +99,16 @@ bool equal( const MT& M1, const MT& M2, double prec /* = 1/std::numeric_limits= 2 ) { + N = std::atof(argv[1]); + } + if( argc >= 3 ) { + precision = std::atof(argv[2]); + } typedef edoSamplerNormalMulti::Cholesky::CovarMat CovarMat; typedef edoSamplerNormalMulti::Cholesky::FactorMat FactorMat; @@ -115,9 +124,13 @@ int main(int argc, char** argv) } } - double precision = 1e-15; - setformat(std::cout); + std::cout << "usage: t-cholesky [N] [precision]" << std::endl; + std::cout << "N = " << N << std::endl; + std::cout << "precision = " << precision << std::endl; std::string linesep = "--------------------------------------------------------------------------------------------"; + std::cout << linesep << std::endl; + + setformat(std::cout); std::cout << "Covariance matrix" << std::endl << format(V) << std::endl; std::cout << linesep << std::endl;