
Public Member Functions | |
| void | initialize (const MATRIX &A, const std::vector< unsigned int > &permutation, const std::vector< unsigned int > &inverse_permutation, typename PreconditionRelaxation< MATRIX >::AdditionalData parameters=typename PreconditionRelaxation< MATRIX >::AdditionalData()) |
| template<class VECTOR > | |
| void | vmult (VECTOR &, const VECTOR &) const |
| template<class VECTOR > | |
| void | Tvmult (VECTOR &, const VECTOR &) const |
Private Attributes | |
| const std::vector< unsigned int > * | permutation |
| const std::vector< unsigned int > * | inverse_permutation |
Permuted SOR preconditioner using matrix built-in function. The MATRIX class used is required to have functions PSOR(VECTOR&, const VECTOR&, double) and TPSOR(VECTOR&, const VECTOR&, double).
// Declare related objects SparseMatrix<double> A; Vector<double> x; Vector<double> b; SolverCG<> solver(...); //...initialize and build A std::vector<unsigned int> permutation(x.size()); std::vector<unsigned int> inverse_permutation(x.size()); //...fill permutation and its inverse with reasonable values // Define and initialize preconditioner PreconditionPSOR<SparseMatrix<double> > precondition; precondition.initialize (A, permutation, inverse_permutation, .6); solver.solve (A, x, b, precondition);
| void PreconditionPSOR< MATRIX >::initialize | ( | const MATRIX & | A, | |
| const std::vector< unsigned int > & | permutation, | |||
| const std::vector< unsigned int > & | inverse_permutation, | |||
| typename PreconditionRelaxation< MATRIX >::AdditionalData | parameters = typename PreconditionRelaxation< MATRIX >::AdditionalData() | |||
| ) |
Initialize matrix and relaxation parameter. The matrix is just stored in the preconditioner object.
The permutation vector is stored as a pointer. Therefore, it has to be assured that the lifetime of the vector exceeds the lifetime of the preconditioner.
The relaxation parameter should be larger than zero and smaller than 2 for numerical reasons. It defaults to 1.
| void PreconditionPSOR< MATRIX >::vmult | ( | VECTOR & | , | |
| const VECTOR & | ||||
| ) | const [inline] |
Apply preconditioner.
| void PreconditionPSOR< MATRIX >::Tvmult | ( | VECTOR & | , | |
| const VECTOR & | ||||
| ) | const [inline] |
Apply transpose preconditioner.
const std::vector<unsigned int>* PreconditionPSOR< MATRIX >::permutation [private] |
Storage for the permutation vector.
const std::vector<unsigned int>* PreconditionPSOR< MATRIX >::inverse_permutation [private] |
Storage for the inverse permutation vector.
documentation generated on Mon Nov 23 22:58:01 2009 by
doxygen
1.6.1