Class ae108::cpppetsc::LinearSolver
template <class Policy>
ClassList > ae108 > cpppetsc > LinearSolver
This class can be used to solve linear systems Ax = b.
#include <LinearSolver.h>
Public Types
Type | Name |
---|---|
typedef Matrix< Policy > | matrix_type |
typedef Vector< Policy > | vector_type |
Public Functions
Type | Name |
---|---|
LinearSolver (const matrix_type * mat) Initialize the solver with a matrix A. |
|
distributed< vector_type > | solve (const distributed< vector_type > & rhs) const Calls solve with a suitable result vector. Passes on the rest of the arguments. |
distributed< vector_type > | solve (const distributed< vector_type > & rhs, distributed< vector_type > result) const Solve the linear system Ax = b. |
Public Types Documentation
typedef matrix_type
using ae108::cpppetsc::LinearSolver< Policy >::matrix_type = Matrix<Policy>;
typedef vector_type
using ae108::cpppetsc::LinearSolver< Policy >::vector_type = Vector<Policy>;
Public Functions Documentation
function LinearSolver
Initialize the solver with a matrix A.
explicit ae108::cpppetsc::LinearSolver::LinearSolver (
const matrix_type * mat
)
Remark:
The solver keeps a reference to that matrix.
Parameters:
mat
A pointer to the matrix A.
function solve [1/2]
Calls solve with a suitable result vector. Passes on the rest of the arguments.
distributed < vector_type > ae108::cpppetsc::LinearSolver::solve (
const distributed < vector_type > & rhs
) const
Parameters:
rhs
The vector b.
Returns:
The solution of the linear system.
Exception:
- LinearSolverDivergedException if the solve diverged
function solve [2/2]
Solve the linear system Ax = b.
distributed < vector_type > ae108::cpppetsc::LinearSolver::solve (
const distributed < vector_type > & rhs,
distributed < vector_type > result
) const
Parameters:
rhs
The vector b.result
Used to store the result (instead of creating a new vector).
Returns:
The solution of the linear system.
Exception:
- LinearSolverDivergedException if the solve diverged
The documentation for this class was generated from the following file cpppetsc/src/include/ae108/cpppetsc/LinearSolver.h