ConicBundle
psqmr.hxx
Go to the documentation of this file.
1 
2 
3 #ifndef CH_MATRIX_CLASSES__PSQMR_HXX
4 #define CH_MATRIX_CLASSES__PSQMR_HXX
5 
15 
16 namespace CH_Matrix_Classes {
17 
21 
31  {
32  private:
40 
41  std::ostream* myout;
43 
44  public:
46  Psqmr(std::ostream* out=0,int pril=-1);
48  virtual ~Psqmr(){}
49 
56 
58  void set_maxit(Integer in_maxit) {maxit=in_maxit;}
60  Integer get_maxit() const {return maxit;}
61 
63  int get_err() const {return err;}
65  Integer get_nmult() const {return nmult;}
67  Real get_residual_norm() const {return resnorm;}
69  virtual Real get_avg_reduction() const {return avg_reduction;}
71  virtual Real get_termprec() const {return termprec;}
72 
74 
76  int compute(IterativeSystemObject& system,
77  Matrix& x,
78  Real termprec,
79  Matrix* storex=0,
80  Integer storestep=0
81  );
82 
87 
89  virtual void set_out(std::ostream* in_out=0,int in_print_level=1)
90  {myout=in_out;print_level=in_print_level;}
91 
93  };
94 
96 
97 }
98 
99 #endif
100 
int Integer
all integer numbers in calculations and indexing are of this type
Definition: matop.hxx:40
Real get_residual_norm() const
returns the residual norm of last call
Definition: psqmr.hxx:67
Header declaring the abstract classes CH_Matrix_Classes::IterativeSystemObject and CH_Matrix_Classes:...
double Real
all real numbers in calculations are of this type
Definition: matop.hxx:50
Integer nmult
number of matrix vector multiplications/iterations
Definition: psqmr.hxx:38
Real resnorm
residual norm
Definition: psqmr.hxx:34
Real avg_reduction
average over the reduction factors
Definition: psqmr.hxx:36
Real old_resnorm
residual norm in the previous step
Definition: psqmr.hxx:35
int get_err() const
returns the error code of the last call
Definition: psqmr.hxx:63
Integer get_nmult() const
returns the number of matrix-vector multiplications of the last call
Definition: psqmr.hxx:65
Integer get_maxit() const
get maximum number of iterations
Definition: psqmr.hxx:60
Psqmr(std::ostream *out=0, int pril=-1)
default constructor
virtual void set_out(std::ostream *in_out=0, int in_print_level=1)
set output stream and level of detail of log output (for debugging)
Definition: psqmr.hxx:89
PSQMR method for solving Ax=b with symmetric matrix A and symmetric preconditioner M=M1*M2 (M1 and M2...
Definition: psqmr.hxx:30
std::ostream * myout
everything is output to *myout, default: 0 for no output
Definition: psqmr.hxx:41
int print_level
level of iteration information that should be displayed
Definition: psqmr.hxx:42
Matrix Classes and Linear Algebra. See Matrix Classes (namespace CH_Matrix_Classes) for a quick intro...
Definition: PSCOracle.hxx:20
Abstract base class for supplying the system for an iterative solver.
Definition: IterativeSystemObject.hxx:37
Matrix class for real values of type Real
Definition: matrix.hxx:74
void set_maxit(Integer in_maxit)
set maximum number of iterations
Definition: psqmr.hxx:58
Integer maxit
maximum number of matrix vector multiplications
Definition: psqmr.hxx:33
Integer err
error code
Definition: psqmr.hxx:39
virtual Real get_termprec() const
return the (absolute) precision requirement for termination used in the last call ...
Definition: psqmr.hxx:71
int compute(IterativeSystemObject &system, Matrix &x, Real termprec, Matrix *storex=0, Integer storestep=0)
compute the solution for system into x with (absolute) residual precision termprec ...
virtual Real get_avg_reduction() const
returns the average of the achieved reduction factor per iteration
Definition: psqmr.hxx:69
Abstract interface to iterative methods for solving Ax=b given by an IterativeSystemObject.
Definition: IterativeSystemObject.hxx:61
Real termprec
absolute precision required in the last call
Definition: psqmr.hxx:37