NetworKit::ConjugateGradient< Matrix, Preconditioner > Class Template Reference

#include <ConjugateGradient.h>

## Public Member Functions

void setup (const Matrix &matrix)
Sets the solver up for the specified matrix. More...

void setupConnected (const Matrix &matrix)
Sets the solver up for the specified matrix where the underlying graph has to be connected. More...

SolverStatus solve (const Vector &rhs, Vector &result, count maxConvergenceTime=5 *60 *1000, count maxIterations=std::numeric_limits< count >::max())
Solves the linear system using the conjugate gradient method with a given preconditioner and with initial value . More...

void parallelSolve (const std::vector< Vector > &rhs, std::vector< Vector > &results, count maxConvergenceTime=5 *60 *1000, count maxIterations=std::numeric_limits< count >::max())
Solves the linear systems in parallel. More...

Public Member Functions inherited from NetworKit::LinearSolver< Matrix >
LinearSolver (const double tolerance)
Construct an abstract solver with the given tolerance. More...

virtual ~LinearSolver ()=default

virtual void setup (const Graph &graph)
Sets the solver up for the Laplacian matrix of the graph specified. More...

virtual void setupConnected (const Graph &graph)
Sets the solver up for the Laplacian matrix of the graph specified. More...

Protected Attributes inherited from NetworKit::LinearSolver< Matrix >
double tolerance

## Constructor & Destructor Documentation

template<class Matrix , class Preconditioner >
 NetworKit::ConjugateGradient< Matrix, Preconditioner >::ConjugateGradient ( double tolerance = 1e-5 )
inline

## Member Function Documentation

template<class Matrix , class Preconditioner >
 void NetworKit::ConjugateGradient< Matrix, Preconditioner >::parallelSolve ( const std::vector< Vector > & rhs, std::vector< Vector > & results, count maxConvergenceTime = 5 * 60 * 1000, count maxIterations = std::numeric_limits::max() )
virtual

Solves the linear systems in parallel.

Parameters
 rhs results maxConvergenceTime maxIterations

Reimplemented from NetworKit::LinearSolver< Matrix >.

template<class Matrix , class Preconditioner >
 void NetworKit::ConjugateGradient< Matrix, Preconditioner >::setup ( const Matrix & matrix )
inlinevirtual

Sets the solver up for the specified matrix.

Parameters
 matrix

Implements NetworKit::LinearSolver< Matrix >.

template<class Matrix , class Preconditioner >
 void NetworKit::ConjugateGradient< Matrix, Preconditioner >::setupConnected ( const Matrix & matrix )
inlinevirtual

Sets the solver up for the specified matrix where the underlying graph has to be connected.

Parameters
 matrix

Implements NetworKit::LinearSolver< Matrix >.

template<class Matrix , class Preconditioner >
 SolverStatus NetworKit::ConjugateGradient< Matrix, Preconditioner >::solve ( const Vector & rhs, Vector & result, count maxConvergenceTime = 5 * 60 * 1000, count maxIterations = std::numeric_limits::max() )
virtual

Solves the linear system using the conjugate gradient method with a given preconditioner and with initial value .

We the return the solution . The solution fulfils if the algorithm has converged.

Obviously, A needs to have the same number of rows as b and status.residual must be nonnegative. You may also request that the algorithm does not run for more than status.max_iters iterations.

Implements NetworKit::LinearSolver< Matrix >.

The documentation for this class was generated from the following file: