LR::SetOfEqSolver Class Reference

Iterative Set Of Linear Equations solver, extending the generic LRSolver. More...

#include <slr.h>

Inheritance diagram for LR::SetOfEqSolver:
LR::LRSolver

List of all members.

Public Member Functions

 SetOfEqSolver (int nbast, int nocc, const ergo_real *fock_matrix, const ergo_real *s, ergo_real freq)
 Creates the set-of-equations solver.
void setRHS (OneElOperator &op)
 initializes the rhs field
virtual ~SetOfEqSolver ()
virtual ergo_real getPreconditionerShift (int) const
 returns the preconditioning shift.
virtual int getInitialGuess (VarVectorCollection &vecs)
 returns the initial guess for the linear set of equations.
virtual bool getResidual (VarVectorCollection &residualv)
 get the residual of the set of linear equations.
virtual void increaseSubspaceLimit (int newSize)
 expands above the default limit
ergo_real getPolarisability (OneElOperator &oper)
 computes polarizability by contracting the response vector with specified operator

Protected Member Functions

virtual void addToSpace (VarVectorCollection &vecs, E2Evaluator &e2)
 extends the subspace with v and its transformed vector Av.
ergo_real multiplyXtimesVec (const VarVector &rhs)
 multiplies current solution by some vector.

Protected Attributes

ergo_realrhsSub
 RHS vector projected onto subspace.
ergo_real xTimesRHS

Private Attributes

ergo_real frequency
 frequency for which the SOE is to be solved.
VarVector rhs
 RHS of the SOE.

Detailed Description

Iterative Set Of Linear Equations solver, extending the generic LRSolver.


Constructor & Destructor Documentation

LR::SetOfEqSolver::SetOfEqSolver ( int  nbast,
int  nocc,
const ergo_real fock_matrix,
const ergo_real s,
ergo_real  freq 
) [inline]

Creates the set-of-equations solver.

The KS and overlap matrix may be deleted immediately after the object creation.

virtual LR::SetOfEqSolver::~SetOfEqSolver (  )  [inline, virtual]

References rhsSub.


Member Function Documentation

void LR::SetOfEqSolver::addToSpace ( VarVectorCollection v,
E2Evaluator e2 
) [protected, virtual]

extends the subspace with v and its transformed vector Av.

The eSub and sSub projected matrices are modified as well. We do not store explicitely the swapped vectors (y x), only the (x y) combination.

Reimplemented from LR::LRSolver.

References LR::dot(), LR::VarVector::nvar, rhs, rhsSub, LR::LRSolver::subspaceSize, LR::LRSolver::vects, LR::VarVector::x(), and LR::VarVector::y().

int LR::SetOfEqSolver::getInitialGuess ( VarVectorCollection guess  )  [virtual]

returns the initial guess for the linear set of equations.

The explicit value is obtained from the diagonal assumption for the E[2] operator and is: (E[2]- freq*S[2])*g = Y -> g = Y./(E[2]-freq*S[2])

Implements LR::LRSolver.

References LR::LRSolver::e2diag, LR::VarVector::nvar, rhs, LR::VarVector::setSize(), and LR::VarVectorCollection::setSize().

ergo_real LR::SetOfEqSolver::getPolarisability ( OneElOperator oper  ) 

computes polarizability by contracting the response vector with specified operator

References multiplyXtimesVec(), and LR::LRSolver::operToVec().

Referenced by solveForRHS().

virtual ergo_real LR::SetOfEqSolver::getPreconditionerShift ( int  i  )  const [inline, virtual]

returns the preconditioning shift.

Proper preconditioning is vital for the quick convergence.

Implements LR::LRSolver.

References frequency.

bool LR::SetOfEqSolver::getResidual ( VarVectorCollection residualv  )  [virtual]

get the residual of the set of linear equations.

This is done in two steps: Solution in the subspace: Xsub = (eSub-freq*Ssub)\Ysub; Residual vector is: residualv= (Av-freq*Sv)*Xsub - Y;

Implements LR::LRSolver.

References A, LR::LRSolver::convThreshold, do_output(), LR::LRSolver::eSub, frequency, LR::LRSolver::getAvMinusFreqSv(), LOG_AREA_LR, LOG_CAT_INFO, multiplyXtimesVec(), LR::VarVector::nvar, rhs, rhsSub, LR::VarVectorCollection::setSize(), solve_linear_equation_system(), LR::LRSolver::sSub, LR::LRSolver::subspaceSize, LR::LRSolver::xSub, and xTimesRHS.

void LR::SetOfEqSolver::increaseSubspaceLimit ( int  newSize  )  [virtual]

expands above the default limit

Reimplemented from LR::LRSolver.

References LR::LRSolver::maxSubspaceSize, and rhsSub.

Referenced by es_get_polarisability().

ergo_real LR::SetOfEqSolver::multiplyXtimesVec ( const VarVector rhs  )  [protected]

multiplies current solution by some vector.

If such contractions are to be done several times, perhaps a single vector solution should be created and only then contracted with rhs vector.

References LR::LRSolver::projectOnSubspace(), LR::LRSolver::subspaceSize, and LR::LRSolver::xSub.

Referenced by getPolarisability(), and getResidual().

void LR::SetOfEqSolver::setRHS ( OneElOperator op  ) 

Member Data Documentation

frequency for which the SOE is to be solved.

Referenced by getPreconditionerShift(), and getResidual().

RHS of the SOE.

Referenced by addToSpace(), getInitialGuess(), getResidual(), and setRHS().

RHS vector projected onto subspace.

Referenced by addToSpace(), getResidual(), increaseSubspaceLimit(), and ~SetOfEqSolver().

Referenced by getResidual().


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

Generated on 21 Nov 2012 for ergo by  doxygen 1.6.1