JDFTx  1.7.0
LinearSolvableIndefinite< Vector > Struct Template Referenceabstract

#include <LinearSolver.h>

Public Member Functions

virtual void hessian (Vector &Av, const Vector &v)=0
 Linear operator A applied to the vector v.
 
virtual void precondition (Vector &v)=0
 Apply precondioner to vector v. Required for CG algorithm.
 
virtual void Ksqrt (Vector &v)=0
 Apply square root of preconditioner to v. Required for MINRES algorithm.
 
virtual double sync (double x) const
 Override to synchronize scalars over MPI processes (if the same minimization is happening in sync over many processes)
 
int solve (const Vector &b, const SolverParams &params)
 
int CG (const Vector &b, const SolverParams &params)
 
int MINRES (const Vector &b, const SolverParams &params)
 

Public Attributes

Vector state
 Solution to the system A.state+b = 0.
 

Detailed Description

template<typename Vector>
struct LinearSolvableIndefinite< Vector >

Interface for symmetric (possibly indefinite) linear systems of the form Ax+b = 0. Choose between conjugate gradient or MINRES algorithms. Used in variational perturbation solver. CG implementation more memory-efficient compared to LinearSolvable. MINRES uses more memory but converges smoothly.

Template Parameters
VectorSame requirements as the Vector for Minimizable

Member Function Documentation

◆ CG()

template<typename Vector >
int LinearSolvableIndefinite< Vector >::CG ( const Vector &  b,
const SolverParams params 
)

Solve Ax+b=0 using linear conjugate gradients.

Returns
the number of iterations taken to achieve target tolerance

◆ MINRES()

template<typename Vector >
int LinearSolvableIndefinite< Vector >::MINRES ( const Vector &  b,
const SolverParams params 
)

Solve Ax+b=0 using MINRES algorithm.

Returns
the number of iterations taken to achieve target tolerance

◆ solve()

template<typename Vector >
int LinearSolvableIndefinite< Vector >::solve ( const Vector &  b,
const SolverParams params 
)

Solve the linear system Ax+b=0 using algorithm specified by params

Returns
the number of iterations taken to achieve target tolerance

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