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. More... | |
~VarVector () | |
ergo_real * | x () const |
return the X part of the vector. More... | |
ergo_real * | y () const |
returns the Y part. More... | |
void | symorth (void) |
Uses symmetric orthogonalization to orthonormalize itself (x y) with the swapped vector (y x). More... | |
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. More... | |
void | save (const char *tmpdir) |
Save the object. More... | |
void | release (const char *tmpdir) |
Releases the memory, saving if necessary. More... | |
Public Attributes | |
char * | fName |
Present in secondary storage (i.e. More... | |
int | nvar |
nvar := nocc*nvirt. More... | |
unsigned | onDisk:1 |
valid representation on disk More... | |
unsigned | inMemory:1 |
valid representation in memory More... | |
Private Attributes | |
ergo_real * | v |
vector coefficients More... | |
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.
|
inline |
|
inline |
Creates a vector from a full matrix.
References setFromFull().
void LR::VarVector::load | ( | const char * | tmpdir | ) |
Load the object to memory.
References do_output(), fName, inMemory, LOG_AREA_LR, LOG_CAT_INFO, nvar, and v.
Referenced by LR::VarVectorCollection::operator[]().
|
inline |
|
inline |
void LR::VarVector::release | ( | const char * | tmpdir | ) |
Releases the memory, saving if necessary.
References inMemory, nvar, onDisk, save(), and v.
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 do_output(), fName, LOG_AREA_LR, LOG_CAT_INFO, nvar, onDisk, and v.
Referenced by release().
void LR::VarVector::setFromFull | ( | int | nbast, |
int | nocc, | ||
const ergo_real * | full_mat | ||
) |
References inMemory, nvar, onDisk, and v.
Referenced by LR::EigenSolver::computeMoments(), LR::LRSolver::lintrans(), LR::LRSolver::operToVec(), LR::LRSolver::setE2diag(), LR::SetOfEqSolver::setRHS(), and VarVector().
void LR::VarVector::setFull | ( | int | nbast, |
int | nocc, | ||
ergo_real * | full_mat | ||
) | const |
References v.
Referenced by LR::LRSolver::lintrans().
|
inline |
< sets the size. Reallocates if needed.
References nvar, onDisk, and v.
Referenced by LR::LRSolver::buildVector(), LR::LRSolver::computeExactE2Diag(), and LR::SetOfEqSolver::getInitialGuess().
|
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 do_output(), LR::dot(), LOG_AREA_LR, LOG_CAT_INFO, nvar, onDisk, template_blas_fabs(), template_blas_sqrt(), and v.
|
inline |
return the X part of the vector.
References v.
Referenced by LR::SetOfEqSolver::addToSpace(), LR::precondition(), and LR::LRSolver::projectOnSubspace().
|
inline |
returns the Y part.
Referenced by LR::SetOfEqSolver::addToSpace(), LR::precondition(), and LR::LRSolver::projectOnSubspace().
|
friend |
|
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 load(), LR::operator*(), LR::operator+=(), release(), and setFromFull().
int LR::VarVector::nvar |
nvar := nocc*nvirt.
Vector length is 2*nvar
Referenced by LR::SetOfEqSolver::addToSpace(), LR::LRSolver::buildVector(), LR::SetOfEqSolver::getInitialGuess(), LR::EigenSolver::getInitialGuess(), LR::SetOfEqSolver::getResidual(), load(), LR::operator*(), LR::operator+=(), operator=(), LR::precondition(), print(), LR::LRSolver::projectOnSubspace(), release(), save(), setFromFull(), setSize(), size(), symorth(), VarVector(), and y().
unsigned LR::VarVector::onDisk |
valid representation on disk
Referenced by operator=(), LR::precondition(), release(), save(), setFromFull(), setSize(), and symorth().
|
private |
vector coefficients
Referenced by load(), LR::operator*(), operator=(), operator[](), print(), release(), save(), setFromFull(), setFull(), setSize(), symorth(), VarVector(), x(), y(), and ~VarVector().