All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
NetworKit::Lamg< Matrix > Class Template Reference

Represents the interface to the Lean Algebraic Multigrid (LAMG) graph Laplacian linear solver by Oren E. More...

#include <Lamg.h>

Public Member Functions

 Lamg (const double tolerance=1e-6)
 Construct a solver with the given tolerance. More...
 
 ~Lamg ()=default
 Default destructor. More...
 
void setup (const Matrix &laplacianMatrix)
 Compute the multigrid hierarchy for the given Laplacian matrix laplacianMatrix. More...
 
void setupConnected (const Matrix &laplacianMatrix)
 Compute the multigrid hierarchy for te given Laplacian matrix laplacianMatrix. More...
 
SolverStatus solve (const Vector &rhs, Vector &result, count maxConvergenceTime=5 *60 *1000, count maxIterations=std::numeric_limits< count >::max())
 Computes the result for the matrix currently setup and the right-hand side rhs. More...
 
void parallelSolve (const std::vector< Vector > &rhs, std::vector< Vector > &results, count maxConvergenceTime=5 *60 *1000, count maxIterations=std::numeric_limits< count >::max())
 Compute the results for the matrix currently setup and the right-hand sides rhs. 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...
 

Additional Inherited Members

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

Detailed Description

template<class Matrix>
class NetworKit::Lamg< Matrix >

Represents the interface to the Lean Algebraic Multigrid (LAMG) graph Laplacian linear solver by Oren E.

Livne and Achi Brandt.

See Also
Livne, Oren E., and Achi Brandt. "Lean algebraic multigrid (LAMG): Fast graph Laplacian linear solver." SIAM Journal on Scientific Computing 34.4 (2012): B499-B522.

Constructor & Destructor Documentation

template<class Matrix>
NetworKit::Lamg< Matrix >::Lamg ( const double  tolerance = 1e-6)
inline

Construct a solver with the given tolerance.

The relative residual ||Ax-b||/||b|| will be less than or equal to tolerance after the solver finished.

Parameters
tolerance
template<class Matrix>
NetworKit::Lamg< Matrix >::~Lamg ( )
default

Default destructor.

Member Function Documentation

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

Compute the results for the matrix currently setup and the right-hand sides rhs.

The maximum spent time for each system can be specified by maxConvergenceTime and the maximum number of iterations can be set by maxIterations.

Parameters
rhs
results
maxConvergenceTime
maxIterations

Reimplemented from NetworKit::LinearSolver< Matrix >.

template<class Matrix>
void NetworKit::Lamg< Matrix >::setup ( const Matrix laplacianMatrix)
virtual

Compute the multigrid hierarchy for the given Laplacian matrix laplacianMatrix.

Parameters
laplacianMatrix
Note
This method also works for disconnected graphs. If you know that the graph is connected, if is faster to use setupConnected instead.

Implements NetworKit::LinearSolver< Matrix >.

template<class Matrix>
void NetworKit::Lamg< Matrix >::setupConnected ( const Matrix laplacianMatrix)
virtual

Compute the multigrid hierarchy for te given Laplacian matrix laplacianMatrix.

Parameters
laplacianMatrix
Note
The graph has to be connected for this method to work. Otherwise the output is undefined.

Implements NetworKit::LinearSolver< Matrix >.

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

Computes the result for the matrix currently setup and the right-hand side rhs.

The maximum spent time can be specified by maxConvergenceTime and the maximum number of iterations can be set by maxIterations.

Parameters
rhs
result
maxConvergenceTime
maxIterations
Returns
A SolverStatus object which provides some statistics like the final absolute residual.

Implements NetworKit::LinearSolver< Matrix >.


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