1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-16 06:47:06 +01:00

Adding reproducibility tests

This commit is contained in:
Guido Cossu
2016-11-21 09:52:07 +00:00
parent 036ec31c48
commit f1908c7bc9
2 changed files with 85 additions and 45 deletions

View File

@ -33,17 +33,21 @@ directory
namespace Grid {
struct CG_state{
bool do_repro;
std::vector<RealD> residuals;
struct CG_state {
bool do_repro;
std::vector<RealD> residuals;
CG_state(){
do_repro = false;
residuals.clear();}
CG_state() {
do_repro = false;
residuals.clear();
}
void reset(){
do_repro = false;
residuals.clear();
}
};
/////////////////////////////////////////////////////////////
// Base classes for iterative processes based on operators
// single input vec, single output vec.
@ -57,7 +61,7 @@ class ConjugateGradient : public OperatorFunction<Field> {
RealD Tolerance;
Integer MaxIterations;
bool ReproTest;
CG_state CGState;
CG_state CGState;//to check reproducibility by repeating the CG
ConjugateGradient(RealD tol, Integer maxit, bool err_on_no_conv = true,
bool ReproducibilityTest = false)
@ -199,8 +203,7 @@ class ConjugateGradient : public OperatorFunction<Field> {
}
// Clear state
CGState.residuals.clear();
CGState.do_repro = false;
CGState.reset();
return;
}
}