Commit 52ca5b90 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Changes in logger, now we log a fake iteration at the start, storing the norms...

Changes in logger, now we log a fake iteration at the start, storing the norms of R0 as min/max residual
parent 2918f19b
......@@ -54,6 +54,14 @@ struct Arnoldi{
}
}
std::pair<Primary,Primary> minmaxR0 = R0.getMinMaxNorm();
double timestamp = Logger<Primary>::GetTime();
//Init Log with norm of R0 (only if log is empty)
if(0 == log.getNbIteLogged()){
log.add_ite(-1,B.getSizeBlock(),
minmaxR0.first,minmaxR0.second,timestamp);
}
//V1 will be first block of base, and R1, will be used for least
//square pb, in criteria verification
Block<Scalar,Primary> V1(SizeBlock,dim);
......@@ -66,7 +74,7 @@ struct Arnoldi{
bool convergence = false;
int j = 0;
while(j<max_iter){
double timestamp = Logger<Primary>::GetTime();
timestamp = Logger<Primary>::GetTime();
std::cout<<"\t\tStart of Iteration\n";
//Compute block Wj
Block<Scalar,Primary> Wj(SizeBlock,dim);
......
......@@ -67,6 +67,15 @@ struct Arnoldi_IB{
bool IB_happened = false;
std::pair<Primary,Primary> minmaxR0 = R0.getMinMaxNorm();
//init timestamp
double timestamp = Logger<Primary>::GetTime();
//Init Log with norm of R0 (only if log is empty)
if(0 == log.getNbIteLogged()){
log.add_ite(-1,B.getSizeBlock(),
minmaxR0.first,minmaxR0.second,timestamp);
}
//here, insert inexact breakdown on R0
{
//Copy r0 because needed to compute Lambda, but is
......@@ -167,7 +176,7 @@ struct Arnoldi_IB{
int j=0;
while(j<max_iter){ //Main Loop
double timestamp = Logger<Primary>::GetTime();
timestamp = Logger<Primary>::GetTime();
std::cout<<"\t\tStart of Iteration\n";
//Get new starting point, and test if restart is triggered
......
......@@ -53,6 +53,15 @@ struct Arnoldi_QRInc{
}
}
std::pair<Primary,Primary> minmaxR0 = R0.getMinMaxNorm();
double timestamp = Logger<Primary>::GetTime();
//Init Log with norm of R0 (only if log is empty)
if(0 == log.getNbIteLogged()){
log.add_ite(-1,B.getSizeBlock(),
minmaxR0.first,minmaxR0.second,timestamp);
}
//V1 will be first block of base, and R1, will be used for least
//square pb, in criteria verification
Block<Scalar,Primary> V1(SizeBlock,dim);
......@@ -69,7 +78,7 @@ struct Arnoldi_QRInc{
bool convergence = false;
int j = 0;
while(j<max_iter){
double timestamp = Logger<Primary>::GetTime();
timestamp = Logger<Primary>::GetTime();
std::cout<<"\t\tStart of Iteration\n";
//Compute block Wj
Block<Scalar,Primary> Wj(SizeBlock,dim);
......
......@@ -59,6 +59,7 @@ int BGMRes(Matrix& A,Block<Scalar,Primary>& B, Block<Scalar,Primary>& X0,
// Global step is total number of iteration (thus is <max_iter)
int k=0,nb_restart=0;
int nbIteDone = 0;
while(k<max_iter){
//Compute nb_iter to give to Arnoldi procedure
int arnoldi_ite = max_iter - nbIteDone;
......
......@@ -32,6 +32,10 @@ public:
}
int getNbIteLogged(){
return iterations.size();
}
void add_ite(int /*curr*/,int inSizeBlock,Primary min, Primary max,
double last_timestamp){
iterations.push_back(Ite{globalIte+1,currNbMatVect+inSizeBlock,inSizeBlock,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment