Commit 9bf2d49b by MIJIEUX Thomas

parent c48f0dfa
 ... ... @@ -94,7 +94,6 @@ static double* create_random_matrix(int M, int N) int main(int argc, char *argv[]) { MORSE_Init(2, 0); MORSE_Enable(MORSE_ERRORS); int dim = 25; if (argc > 1) ... ...
 ... ... @@ -166,7 +166,7 @@ struct Arnoldi_IB Block LS; // Block to hold LS // STEP1: Compute first block residual Block R0{SizeBlock,dim}; Block R0{SizeBlock, dim}; //Fill matrix R0 with each vector r0_i = B[i] - A * X0[i] A.MatBlockVect(X0,R0); // R0 = A*X0 for (int i = 0; i < SizeBlock; ++i) // R0 = B - R0 ... ... @@ -220,6 +220,7 @@ struct Arnoldi_IB // Ortho and filling of L (the (IB) Hessenberg) Arnoldi_Ortho(L, base, WP, ArnChoice, ortho, A); //L.displayHessExtendedBitMap("AFTER ORTHO"); // Create Block and Residual LS.initData(SizeBlock, L.getNbLineUsed() + SizeBlock); ... ... @@ -292,6 +293,7 @@ struct Arnoldi_IB std::cout<<"################## End of Iteration ##################\n\n"; log.add_ite(ite_meter,WP.getSizeW(),evalConv.Min,evalConv.Max,timestamp); j += WP.getSizeW(); //L.displayHessExtendedBitMap("END L HESS"); } if (!convergence) { //No convergence, we need to write current sol into X0 Block Sol{SizeBlock,dim}; ... ...
 ... ... @@ -16,13 +16,13 @@ void ArnoldiBlock(Hess &L, Base &base, BlockWP &WP, OrthoChoice ortho) // We already test if there was room to augment Hessenberg auto *ptrToHess = L.getNewStartingCol(WP.getSizeW()); //Ortho against vectors inside base // Ortho against vectors inside base base.ComputeOrtho(ortho, WP, ptrToHess, L.getLeadingDim(), WP.getSizeP()); std::cout << "Ortho done" << std::endl; // Orthogonalisation of Wj against Pj WP.OrthoWP(L.getPtrToC(), L.getLeadingDim()); WP.QRofW(L.getPtrToD(),L.getLeadingDim()); // QR of w part WP.QRofW(L.getPtrToD(), L.getLeadingDim()); // QR of w part /* Warning : No base augmentation because we need to know if IB * already happened at this stage */ ... ...
 ... ... @@ -23,22 +23,20 @@ void ArnoldiRuhe_CGS(Hess& H, BlockWP& WP, Matrix &A ) { //Cste int dim = base.getLeadingDim(); //Where to start writing into Hessenberg const int dim = base.getLeadingDim(); // Where to start writing into Hessenberg Scalar *ptrToHess = H.getNewStartingCol(WP.getSizeW()); //Loop over vector in WP block for (int k=0; k< WP.getSizeW(); ++k) { int nbVectInBase = base.getNbVectUsed(); //Starting ptr of W_k // Starting ptr of W_k Scalar *ptrToWK = WP.getW() + k * WP.getLeadingDim(); //Starting point of Hessenberg // Starting point of Hessenberg Scalar *ptrToHessK = ptrToHess + k * H.getLeadingDim(); //Starting point of C inside Hessenberg // Starting point of C inside Hessenberg Scalar *ptrToCK = H.getPtrToC() + k * H.getLeadingDim(); //Starting point of D inside Hessenberg // Starting point of D inside Hessenberg Scalar *ptrToDK = H.getPtrToD() + k * H.getLeadingDim(); {//Compute Ortho against base ... ...
 ... ... @@ -57,12 +57,12 @@ int BGMRes(Matrix &A, print_precond(A); std::vector normB, invNormB; B.Normalize(normB,A); // Norm(s) of B B.Normalize(normB, A); // Norm(s) of B std::transform(normB.begin(),normB.end(),std::back_inserter(invNormB), [](const Primary &a)-> Primary{ return 1/a; }); X0.ScaleBlock(invNormB); // Global step is total number of iteration (thus is DR_struct{false,hessSave,base,0,Scalar(0),LS}; ret = ARNOLDI::Exec_Procedure( // Call Arnoldi's procedure specified in template A, X0, B, SizeToSpan, epsilon,log,DR_struct, ortho, arnChoice); ... ...
 ... ... @@ -82,10 +82,8 @@ public: std::cout<<"Problem on QR facto\n"; //2 - get the R part and write it in input for (int i=0; i tmp{getSizeW(), ld}; ... ...