Classes | |
struct | AdditionalData |
Public Member Functions | |
SolverCG (::SolverControl &cn,::VectorMemory< VECTOR > &mem, const AdditionalData &data=AdditionalData()) | |
SolverCG (::SolverControl &cn, const AdditionalData &data=AdditionalData()) | |
virtual | ~SolverCG () |
template<class MATRIX , class PRECONDITIONER > | |
void | solve (const MATRIX &A, VECTOR &x, const VECTOR &b, const PRECONDITIONER &precondition) |
Protected Member Functions | |
virtual double | criterion () |
virtual void | print_vectors (const unsigned int step, const VECTOR &x, const VECTOR &r, const VECTOR &d) const |
Protected Attributes | |
VECTOR * | Vr |
VECTOR * | Vp |
VECTOR * | Vz |
VECTOR * | VAp |
double | res2 |
AdditionalData | additional_data |
Private Member Functions | |
void | cleanup () |
SolverCG< VECTOR >::SolverCG | ( | ::SolverControl & | cn, | |
::VectorMemory< VECTOR > & | mem, | |||
const AdditionalData & | data = AdditionalData() | |||
) | [inline] |
Constructor.
SolverCG< VECTOR >::SolverCG | ( | ::SolverControl & | cn, | |
const AdditionalData & | data = AdditionalData() | |||
) | [inline] |
Constructor. Use an object of type GrowingVectorMemory as a default to allocate memory.
void SolverCG< VECTOR >::solve | ( | const MATRIX & | A, | |
VECTOR & | x, | |||
const VECTOR & | b, | |||
const PRECONDITIONER & | precondition | |||
) | [inline] |
Solve the linear system for x.
References SolverCG< VECTOR >::additional_data, SolverCG< VECTOR >::cleanup(), SolverCG< VECTOR >::AdditionalData::compute_all_condition_numbers, SolverCG< VECTOR >::AdditionalData::compute_condition_number, SolverCG< VECTOR >::AdditionalData::compute_eigenvalues, Solver< VECTOR >::control(), SolverCG< VECTOR >::AdditionalData::log_coefficients, Solver< VECTOR >::memory, SolverCG< VECTOR >::print_vectors(), SolverCG< VECTOR >::VAp, SolverCG< VECTOR >::Vp, SolverCG< VECTOR >::Vr, and SolverCG< VECTOR >::Vz.
double SolverCG< VECTOR >::criterion | ( | ) | [inline, protected, virtual] |
Implementation of the computation of the norm of the residual. This can be replaced by a more problem oriented functional in a derived class.
References SolverCG< VECTOR >::res2.
void SolverCG< VECTOR >::print_vectors | ( | const unsigned int | step, | |
const VECTOR & | x, | |||
const VECTOR & | r, | |||
const VECTOR & | d | |||
) | const [inline, protected, virtual] |
Interface for derived class. This function gets the current iteration vector, the residual and the update vector in each step. It can be used for a graphical output of the convergence history.
Referenced by SolverCG< VECTOR >::solve().
void SolverCG< VECTOR >::cleanup | ( | ) | [inline, private] |
References Solver< VECTOR >::memory, SolverCG< VECTOR >::VAp, SolverCG< VECTOR >::Vp, SolverCG< VECTOR >::Vr, and SolverCG< VECTOR >::Vz.
Referenced by SolverCG< VECTOR >::solve().
Temporary vectors, allocated through the VectorMemory
object at the start of the actual solution process and deallocated at the end.
Referenced by SolverCG< VECTOR >::cleanup(), and SolverCG< VECTOR >::solve().
Referenced by SolverCG< VECTOR >::cleanup(), and SolverCG< VECTOR >::solve().
Referenced by SolverCG< VECTOR >::cleanup(), and SolverCG< VECTOR >::solve().
Referenced by SolverCG< VECTOR >::cleanup(), and SolverCG< VECTOR >::solve().
Within the iteration loop, the square of the residual vector is stored in this variable. The function criterion
uses this variable to compute the convergence value, which in this class is the norm of the residual vector and thus the square root of the res2
value.
Referenced by SolverCG< VECTOR >::criterion().
AdditionalData SolverCG< VECTOR >::additional_data [protected] |
Additional parameters.
Referenced by SolverCG< VECTOR >::solve().