Commit 8ef263f3 by PIACIBELLO Cyrille

### Innovation Work Test code updated, display now for the three methods the time spent.

parent 06e93feb
 ... ... @@ -34,7 +34,7 @@ struct Arnoldi_QRInc{ //Storage needed for computating Base base(SizeBlock,max_iter+1,dim); HessQR Hess(max_iter+1,SizeBlock); HessQR Hess(max_iter+1,SizeBlock); Block Yj(SizeBlock,dim+SizeBlock); Block R0(SizeBlock,dim); ... ...
 ... ... @@ -19,7 +19,7 @@ * * Ref : IB-BGMRES-DR (Giraud Jing Agullo): p.21 */ template template int BGMRes(Matrix& A,Block& B, Block& X0, int max_iter, int restart, Block& Sol,Primary epsilon = 0.0000001){ ... ...
 ... ... @@ -2,14 +2,14 @@ #include #include #include #include "../src/Block.hpp" #include "../src/BlockGMRes.hpp" #include "../src/LapackInterface.hpp" #include "../src/Logger.hpp" #include "../src/BlockArnoldiIb.hpp" #include "../src/IBGMRes.hpp" #include "../src/Arnoldi.hpp" #include "../src/Arnoldi_IB.hpp" #include "../src/Arnoldi_QRInc.hpp" #include "../src/BGMRes.hpp" /** * Driver to read Innovation Works arrays */ ... ... @@ -133,7 +133,8 @@ int main(int ac, char ** av){ std::cout << ag << "\n"; using Primary=double; using Scalar=std::complex; using Scalar =std::complex; using Matrix = InputMatrix; //Random engine used to generate RHS std::random_device rd; ... ... @@ -141,7 +142,7 @@ int main(int ac, char ** av){ std::uniform_real_distribution<> dis(0, 2); InputMatrix mat{}; Matrix mat{}; { std::string location("../data/matrices_BEM/MatconeSpherePC_MAIN_MAIN_0"); std::ifstream myfile(location,std::ios::binary); ... ... @@ -174,77 +175,90 @@ int main(int ac, char ** av){ int dim = mat.size(); int SizeBlock = RHS.getSizeBlock(); int max_ite = dim/SizeBlock; int maxiteIB = dim / SizeBlock + (SizeBlock); Block X0(SizeBlock,dim); // for(int i=0 ; i sol(SizeBlock,dim); Logger logger; // int nb = BlockArnoldiIb, // Scalar,Primary,5>(mat,RHS, // X0, // maxiteIB, // sol,logger, // 0.00001); int nb = IBGMRes,Scalar,Primary,5>(mat,RHS,X0, 3,maxiteIB,sol, logger,0.00001); std::string locationRes("../data/res/MatconeSpherePC_MAIN_MAIN_0.res"); std::ofstream fileRes(locationRes,std::ios::out); fileRes<<"Ite\tSizeBlck\tMinRes\tMaxRes\tTime\tMatVect\tOrtho\tResidual\tSVD\n"; logger.forEachIte([&](int ite, int sizeB, Primary min, Primary max, double* time) { fileRes<; using Arnoldi2 = Arnoldi_IB; using Arnoldi3 = Arnoldi_QRInc; double elapsed1,elapsed2,elapsed3; { //Compute what i need for my metrics //MatxSol : Mat*Sol_computed Block MatxSol(SizeBlock,dim); mat.MatBlockVect(sol,MatxSol); //MatxSolMinusB : Mat*Sol_computed-B Block MatxSolMinusB(SizeBlock,dim); MatxSolMinusB.CopyBlock(MatxSol); for(int idxRHS=0 ; idxRHS X0(SizeBlock,dim); Block sol(SizeBlock,dim); double tic = Logger::GetTime(); int nb = BGMRes(mat,RHS,X0,max_ite,max_ite,sol, 0.000001); elapsed1 = Logger::GetTime() - tic; std::cout<<"Return value / max_ite : "< X0(SizeBlock,dim); Block sol(SizeBlock,dim); double tic = Logger::GetTime(); int nb = BGMRes(mat,RHS,X0,maxiteIB,max_ite,sol, 0.000001); elapsed2 = Logger::GetTime() - tic; std::cout<<"Return value / max_ite : "< X0(SizeBlock,dim); Block sol(SizeBlock,dim); double tic = Logger::GetTime(); int nb = BGMRes(mat,RHS,X0,max_ite,max_ite,sol, 0.000001); elapsed3 = Logger::GetTime() - tic; std::cout<<"Return value / max_ite : "< MatxSol(SizeBlock,dim); // mat.MatBlockVect(sol,MatxSol); // //MatxSolMinusB : Mat*Sol_computed-B // Block MatxSolMinusB(SizeBlock,dim); // MatxSolMinusB.CopyBlock(MatxSol); // for(int idxRHS=0 ; idxRHS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!