ergo
|
Vector of variables parametrising the solution to the linear response equations. More...
#include <slr.h>
Public Member Functions | |
VarVector (const VarVector &a) | |
VarVector () | |
VarVector (int nbast, int nocc, const ergo_real *full_mat) | |
Creates a vector from a full matrix. | |
~VarVector () | |
ergo_real * | x () const |
return the X part of the vector. | |
ergo_real * | y () const |
returns the Y part. | |
void | symorth (void) |
Uses symmetric orthogonalization to orthonormalize itself (x y) with the swapped vector (y x). | |
void | setSize (int n) |
int | size () const |
void | print (const char *comment=NULL) |
void | setFromFull (int nbast, int nocc, const ergo_real *full_mat) |
void | setFull (int nbast, int nocc, ergo_real *full_mat) const |
const ergo_real & | operator[] (int i) const |
ergo_real & | operator[] (int i) |
VarVector & | operator= (ergo_real scalar) |
VarVector & | operator= (const VarVector &b) |
VarVector & | operator= (const VarVectorProxyOp< false, false > &proxy) |
VarVector & | operator= (const VarVectorProxyOp< false, true > &proxy) |
void | load (const char *tmpdir) |
Load the object to memory. | |
void | save (const char *tmpdir) |
Save the object. | |
void | release (const char *tmpdir) |
Releases the memory, saving if necessary. | |
Public Attributes | |
char * | fName |
Present in secondary storage (i.e. | |
int | nvar |
nvar := nocc*nvirt. | |
unsigned | onDisk:1 |
valid representation on disk | |
unsigned | inMemory:1 |
valid representation in memory | |
Private Attributes | |
ergo_real * | v |
vector coefficients | |
Friends | |
ergo_real | operator* (const VarVector &a, const VarVector &b) |
ergo_real | operator* (const VarVector &a, const VarVectorProxyOp< false, false > &b) |
ergo_real | operator* (const VarVector &a, const VarVectorProxyOp< true, false > &b) |
Vector of variables parametrising the solution to the linear response equations.
It provides some handy operations for compact notation.
LR::VarVector::VarVector | ( | ) | [inline] |
LR::VarVector::VarVector | ( | int | nbast, |
int | nocc, | ||
const ergo_real * | full_mat | ||
) | [inline] |
Creates a vector from a full matrix.
References setFromFull().
void LR::VarVector::load | ( | const char * | tmpdir | ) |
Load the object to memory.
References inMemory, nvar, do_output(), LOG_CAT_INFO, LOG_AREA_LR, fName, and v.
Referenced by LR::VarVectorCollection::operator[]().
VarVector& LR::VarVector::operator= | ( | const VarVectorProxyOp< false, false > & | proxy | ) | [inline] |
VarVector& LR::VarVector::operator= | ( | const VarVectorProxyOp< false, true > & | proxy | ) | [inline] |
void LR::VarVector::release | ( | const char * | tmpdir | ) |
Releases the memory, saving if necessary.
References nvar, onDisk, save(), v, and inMemory.
Referenced by LR::VarVectorCollection::release(), and LR::VarVectorCollection::releaseAll().
void LR::VarVector::save | ( | const char * | tmpdir | ) |
Save the object.
Probably does not need be done explicitly.
References onDisk, nvar, fName, do_output(), LOG_CAT_INFO, LOG_AREA_LR, and v.
Referenced by release().
void LR::VarVector::setFromFull | ( | int | nbast, |
int | nocc, | ||
const ergo_real * | full_mat | ||
) |
References nvar, inMemory, onDisk, and v.
Referenced by LR::LRSolver::lintrans(), LR::LRSolver::setE2diag(), LR::LRSolver::operToVec(), LR::SetOfEqSolver::setRHS(), LR::EigenSolver::computeMoments(), and VarVector().
void LR::VarVector::setFull | ( | int | nbast, |
int | nocc, | ||
ergo_real * | full_mat | ||
) | const |
References v.
Referenced by LR::LRSolver::lintrans().
void LR::VarVector::setSize | ( | int | n | ) | [inline] |
< sets the size. Reallocates if needed.
References nvar, v, and onDisk.
Referenced by LR::LRSolver::computeExactE2Diag(), LR::LRSolver::buildVector(), and LR::SetOfEqSolver::getInitialGuess().
int LR::VarVector::size | ( | ) | const [inline] |
References nvar.
void LR::VarVector::symorth | ( | void | ) |
Uses symmetric orthogonalization to orthonormalize itself (x y) with the swapped vector (y x).
It is achieved by performing a following transformation: av = [ x y; y x]; s = av'*av [v, e] = eig(s); e=diag(e)' a = av* v*diag(e.^-0.5)*v'.
It may happen that X=Y (ovl=0) - one such case is running Hartree approximation. In that case we set Y=0.
References LR::dot(), nvar, v, do_output(), LOG_CAT_INFO, LOG_AREA_LR, and onDisk.
ergo_real* LR::VarVector::x | ( | ) | const [inline] |
return the X part of the vector.
References v.
Referenced by LR::precondition(), LR::LRSolver::projectOnSubspace(), and LR::SetOfEqSolver::addToSpace().
ergo_real* LR::VarVector::y | ( | ) | const [inline] |
returns the Y part.
Referenced by LR::precondition(), LR::LRSolver::projectOnSubspace(), and LR::SetOfEqSolver::addToSpace().
ergo_real operator* | ( | const VarVector & | a, |
const VarVectorProxyOp< false, false > & | b | ||
) | [friend] |
ergo_real operator* | ( | const VarVector & | a, |
const VarVectorProxyOp< true, false > & | b | ||
) | [friend] |
char* LR::VarVector::fName |
Present in secondary storage (i.e.
disk) under given file name.
Referenced by load(), save(), and ~VarVector().
unsigned LR::VarVector::inMemory |
valid representation in memory
Referenced by LR::operator*(), LR::operator+=(), load(), release(), and setFromFull().
nvar := nocc*nvirt.
Vector length is 2*nvar
Referenced by LR::operator*(), LR::operator+=(), load(), save(), release(), setFromFull(), symorth(), LR::precondition(), LR::LRSolver::projectOnSubspace(), LR::LRSolver::buildVector(), LR::SetOfEqSolver::getInitialGuess(), LR::SetOfEqSolver::getResidual(), LR::SetOfEqSolver::addToSpace(), LR::EigenSolver::getInitialGuess(), VarVector(), y(), setSize(), size(), print(), and operator=().
unsigned LR::VarVector::onDisk |
valid representation on disk
Referenced by save(), release(), setFromFull(), symorth(), LR::precondition(), setSize(), and operator=().
ergo_real* LR::VarVector::v [private] |
vector coefficients
Referenced by LR::operator*(), load(), save(), release(), setFromFull(), setFull(), symorth(), VarVector(), ~VarVector(), x(), y(), setSize(), print(), operator[](), and operator=().