Skip to content

Class ae108::cpppetsc::LinearSolver

ClassList > ae108 > cpppetsc > LinearSolver

This class can be used to solve linear systems Ax = b.

  • #include <LinearSolver.h>

Public Functions

Type Name
LinearSolver (const Matrix * mat)
Initialize the solver with a matrix A.
distributed< Vector > solve (const distributed< Vector > & rhs) const
Calls solve with a suitable result vector. Passes on the rest of the arguments.
distributed< Vector > solve (const distributed< Vector > & rhs, distributed< Vector > result) const
Solve the linear system Ax = b.

Public Functions Documentation

function LinearSolver

Initialize the solver with a matrix A.

explicit ae108::cpppetsc::LinearSolver::LinearSolver (
    const Matrix * 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 > ae108::cpppetsc::LinearSolver::solve (
    const distributed < Vector > & rhs
) const

Parameters:

  • rhs The vector b.

Returns:

The solution of the linear system.

Exception:


function solve [2/2]

Solve the linear system Ax = b.

distributed < Vector > ae108::cpppetsc::LinearSolver::solve (
    const distributed < Vector > & rhs,
    distributed < Vector > 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:



The documentation for this class was generated from the following file cpppetsc/src/include/ae108/cpppetsc/LinearSolver.h