LR::VarVector Class Reference

Vector of variables parametrising the solution to the linear response equations. More...

#include <slr.h>

List of all members.

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_realx () const
 return the X part of the vector.
ergo_realy () 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_realoperator[] (int i) const
ergo_realoperator[] (int i)
VarVectoroperator= (ergo_real scalar)
VarVectoroperator= (const VarVector &b)
VarVectoroperator= (const VarVectorProxyOp< false, false > &proxy)
VarVectoroperator= (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_realv
 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)

Detailed Description

Vector of variables parametrising the solution to the linear response equations.

It provides some handy operations for compact notation.


Constructor & Destructor Documentation

LR::VarVector::VarVector ( const VarVector a  )  [inline]

References nvar, and v.

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().

LR::VarVector::~VarVector (  )  [inline]

References fName, and v.


Member Function Documentation

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[]().

VarVector& LR::VarVector::operator= ( const VarVectorProxyOp< false, true > &  proxy  )  [inline]
VarVector& LR::VarVector::operator= ( const VarVectorProxyOp< false, false > &  proxy  )  [inline]
VarVector& LR::VarVector::operator= ( const VarVector b  )  [inline]

References nvar, onDisk, and v.

VarVector& LR::VarVector::operator= ( ergo_real  scalar  )  [inline]

References nvar, onDisk, and v.

ergo_real& LR::VarVector::operator[] ( int  i  )  [inline]

References v.

const ergo_real& LR::VarVector::operator[] ( int  i  )  const [inline]

References v.

void LR::VarVector::print ( const char *  comment = NULL  )  [inline]

References nvar, and v.

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 
)
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, onDisk, and v.

Referenced by LR::LRSolver::buildVector(), LR::LRSolver::computeExactE2Diag(), 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 do_output(), LR::dot(), LOG_AREA_LR, LOG_CAT_INFO, nvar, onDisk, template_blas_fabs(), template_blas_sqrt(), and v.

ergo_real* LR::VarVector::x (  )  const [inline]

return the X part of the vector.

References v.

Referenced by LR::SetOfEqSolver::addToSpace(), LR::precondition(), and LR::LRSolver::projectOnSubspace().

ergo_real* LR::VarVector::y (  )  const [inline]

returns the Y part.

References nvar, and v.

Referenced by LR::SetOfEqSolver::addToSpace(), LR::precondition(), and LR::LRSolver::projectOnSubspace().


Friends And Related Function Documentation

ergo_real operator* ( const VarVector a,
const VarVectorProxyOp< true, false > &  b 
) [friend]
ergo_real operator* ( const VarVector a,
const VarVectorProxyOp< false, false > &  b 
) [friend]
ergo_real operator* ( const VarVector a,
const VarVector b 
) [friend]

Member Data Documentation

Present in secondary storage (i.e.

disk) under given file name.

Referenced by load(), save(), and ~VarVector().

valid representation in memory

Referenced by load(), LR::operator*(), LR::operator+=(), release(), and setFromFull().

valid representation on disk

Referenced by operator=(), LR::precondition(), release(), save(), setFromFull(), setSize(), and symorth().


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

Generated on 10 Jul 2018 for ergo by  doxygen 1.6.1