ergo
mat::PuriStepInfo Class Reference

Contains information about the matrix before a purification step and about the step. More...

#include <PuriStepInfo.h>

Inheritance diagram for mat::PuriStepInfo:
mat::PuriStepInfoDebug< Treal, TdebugPolicy >

List of all members.

Public Member Functions

 PuriStepInfo (int nn=-1, int noc=-1, Treal eigvalConvCrit=0.0)
 ~PuriStepInfo ()
bool converged () const
void setChosenThresh (Treal const thr)
Treal getChosenThresh () const
void setActualThresh (Treal const thr)
Treal getActualThresh () const
void setEstimatedStepsLeft (int const stepsleft)
int getEstimatedStepsLeft () const
void setTraceX (Treal const trX)
void setTraceX2 (Treal const trX2)
Treal getTraceX () const
Treal getTraceX2 () const
void setPoly ()
int getPoly () const
void setXmX2EuclNorm (Interval< Treal > const XmX2eucl)
 Sets XmX2EuclNorm bounds.
Interval< Treal > getXmX2EuclNorm () const
void setEigVecPtr (Tvector *eigVecPtr_)
 Improves homo and lumo bounds if the new ones are better.
Tvector const *const getEigVecPtr () const
void improveHomoLumo (Interval< Treal > const homoInt, Interval< Treal > const lumoInt)
Interval< Treal > const & getHomo () const
Interval< Treal > const & getLumo () const
Interval< Treal > const & getEigInterval () const
void exchangeInfoWithNext (PuriStepInfo< Treal, Tvector, TdebugPolicy > &next)
void setCorrectOccupation ()
 Set correct occ.
int getCorrectOccupation () const
Treal subspaceError () const
void improveEigInterval (Interval< Treal > const eInt)
 Improve eigenvalue bounds and delta if possible.
void setNnzX (size_t const nzX)
size_t getNnzX () const
void setNnzX2 (size_t const nzX2)
size_t getNnzX2 () const
void computeEigAccLoss ()
 Computes a probable upper bound of the accuracy that is lost in the eigenvalues of X * X because of limited relative precision in the storage of X.
Treal getEigAccLoss () const
Treal getN0 () const
Treal getN1 () const
Treal getDelta () const
void checkIntervals (const char *descriptionString) const
template<typename Tmatrix >
void computeExactValues (Tmatrix const &X, Tmatrix const &X2)
void setMemUsageBeforeTrunc ()
void setMemUsageInXmX2Diff (MemUsage::Values &memUsage)
void setTimeThresh (float t)
void setTimeSquare (float t)
void setTimeXmX2Norm (float t)
void setTimeTotal (float t)
void setTimeXX2Write (float t)
void setTimeXX2Read (float t)
MemUsage::Values getMemUsageBeforeTrunc ()
MemUsage::Values getMemUsageInXmX2Diff ()
float getTimeThresh ()
float getTimeSquare ()
float getTimeXmX2Norm ()
float getTimeTotal ()
float getTimeXX2Write ()
float getTimeXX2Read ()
bool homoIsAccuratelyKnown (Treal accuracyLimit) const
bool lumoIsAccuratelyKnown (Treal accuracyLimit) const
bool getLumoWasComputed ()
bool getHomoWasComputed ()

Protected Member Functions

void computen0n1 ()
 Compute n0 and n1 Called by improveEigInterval.

Protected Attributes

int n
 System size.
int nocc
 Number of occupied orbitals.
Treal traceX
 Trace of the matrix X.
Treal traceX2
 Trace of the squared matrix X^2.
int poly
 Choice of polynomial 0 for x^2 and 1 for 2 * x - x^2.
Treal chosenThresh
 Chosen threshold value applied before step.
Treal actualThresh
 Actual threshold value applied before step.
int estimatedStepsLeft
 Estimated steps left in purification.
Interval< Treal > eigInterval
 Interval containing the eigenvalue spectrum.
Treal delta
 Largest possible deviation from the [0 1] interval.
int correctOccupation
 Takes the values: 1 meaning all eigenvalues supposed to go to 1 are larger than 0.5 and all eigenvalues supposed to go to 0 are smaller than 0.5 for sure.
Interval< Treal > XmX2EuclNorm
 Interval containing the euclidean norm ||X-X^2||_2 before step.
Tvector * eigVecPtr
 Eigenvector possibly containing the homo or lumo eigenvector.
bool lumoWasComputed
 Flag indicating if lumo was computed.
bool homoWasComputed
 Flag indicating if homo was computed.
Treal n0
 Lower bound on the number of eigenvalues in [lambdaMin, 0.5].
Treal n1
 Lower bound on the number of eigenvalues in [0.5, 1 + delta].
Interval< Treal > homo
 Interval containing the homo eigenvalue.
Interval< Treal > lumo
 Interval containing the lumo eigenvalue.
Treal eigConvCrit
 Tolerated deviation from 0 and 1 of converged eigenvalues.
size_t nnzX
 Number of nonzeros in the matrix X.
size_t nnzX2
 Number of nonzeros in the matrix X2.
Treal eigAccLoss
 A probable upper bound of the accuracy that is lost in the eigenvalues of X * X because of limited relative precision in the storage of X.
MemUsage::Values memUsageBeforeTrunc
MemUsage::Values memUsageInXmX2Diff
float timeThresh
float timeSquare
float timeXmX2Norm
float timeTotal
float timeXX2Write
float timeXX2Read

Detailed Description

Contains information about the matrix before a purification step and about the step.

All info is for the truncated matrix in the current step. We use inheritance for test class so that empty base class optimization can be used in case of an empty test class.


Constructor & Destructor Documentation

mat::PuriStepInfo::PuriStepInfo ( int  nn = -1,
int  noc = -1,
Treal  eigvalConvCrit = 0.0 
) [inline, explicit]
mat::PuriStepInfo::~PuriStepInfo ( ) [inline]

Member Function Documentation

void mat::PuriStepInfo::checkIntervals ( const char *  descriptionString) const [inline]
void mat::PuriStepInfo::computeEigAccLoss ( )

Computes a probable upper bound of the accuracy that is lost in the eigenvalues of X * X because of limited relative precision in the storage of X.

References template_blas_sqrt(), and ASSERTALWAYS.

Referenced by mat::Purification::stepComputeInfo().

template<typename Tmatrix >
void mat::PuriStepInfo::computeExactValues ( Tmatrix const &  X,
Tmatrix const &  X2 
) [inline]
void mat::PuriStepInfo::computen0n1 ( ) [protected]

Compute n0 and n1 Called by improveEigInterval.

References template_blas_sqrt().

bool mat::PuriStepInfo::converged ( ) const [inline]
Treal mat::PuriStepInfo::getActualThresh ( ) const [inline]

Referenced by mat::operator<<().

Treal mat::PuriStepInfo::getChosenThresh ( ) const [inline]
int mat::PuriStepInfo::getCorrectOccupation ( ) const [inline]

Referenced by mat::operator<<().

Treal mat::PuriStepInfo::getDelta ( ) const [inline]
Treal mat::PuriStepInfo::getEigAccLoss ( ) const [inline]
Interval<Treal> const& mat::PuriStepInfo::getEigInterval ( ) const [inline]
Tvector const* const mat::PuriStepInfo::getEigVecPtr ( ) const [inline]
int mat::PuriStepInfo::getEstimatedStepsLeft ( ) const [inline]
Interval<Treal> const& mat::PuriStepInfo::getHomo ( ) const [inline]
bool mat::PuriStepInfo::getHomoWasComputed ( ) [inline]
Interval<Treal> const& mat::PuriStepInfo::getLumo ( ) const [inline]
bool mat::PuriStepInfo::getLumoWasComputed ( ) [inline]
MemUsage::Values mat::PuriStepInfo::getMemUsageBeforeTrunc ( ) [inline]
MemUsage::Values mat::PuriStepInfo::getMemUsageInXmX2Diff ( ) [inline]
Treal mat::PuriStepInfo::getN0 ( ) const [inline]

Referenced by mat::operator<<().

Treal mat::PuriStepInfo::getN1 ( ) const [inline]

Referenced by mat::operator<<().

size_t mat::PuriStepInfo::getNnzX ( ) const [inline]

Referenced by mat::operator<<().

size_t mat::PuriStepInfo::getNnzX2 ( ) const [inline]

Referenced by mat::operator<<().

int mat::PuriStepInfo::getPoly ( ) const [inline]

Referenced by mat::operator<<().

float mat::PuriStepInfo::getTimeSquare ( ) [inline]
float mat::PuriStepInfo::getTimeThresh ( ) [inline]
float mat::PuriStepInfo::getTimeTotal ( ) [inline]
float mat::PuriStepInfo::getTimeXmX2Norm ( ) [inline]
float mat::PuriStepInfo::getTimeXX2Read ( ) [inline]
float mat::PuriStepInfo::getTimeXX2Write ( ) [inline]
Treal mat::PuriStepInfo::getTraceX ( ) const [inline]

Referenced by mat::operator<<().

Treal mat::PuriStepInfo::getTraceX2 ( ) const [inline]

Referenced by mat::operator<<().

Interval<Treal> mat::PuriStepInfo::getXmX2EuclNorm ( ) const [inline]
bool mat::PuriStepInfo::homoIsAccuratelyKnown ( Treal  accuracyLimit) const [inline]
Parameters:
accuracyLimitHOMO estimation is considered to be accurate if the error is smaller than this value.
void mat::PuriStepInfo::improveEigInterval ( Interval< Treal > const  eInt)

Improve eigenvalue bounds and delta if possible.

Returns delta.

Referenced by mat::Purification::Purification(), mat::Purification::stepComputeInfo(), and exchangeInfoWithNext().

void mat::PuriStepInfo::improveHomoLumo ( Interval< Treal > const  homoInt,
Interval< Treal > const  lumoInt 
)
bool mat::PuriStepInfo::lumoIsAccuratelyKnown ( Treal  accuracyLimit) const [inline]
Parameters:
accuracyLimitLUMO estimation is considered to be accurate if the error is smaller than this value.
void mat::PuriStepInfo::setActualThresh ( Treal const  thr) [inline]
void mat::PuriStepInfo::setChosenThresh ( Treal const  thr) [inline]
void mat::PuriStepInfo::setCorrectOccupation ( ) [inline]

Set correct occ.

void mat::PuriStepInfo::setEigVecPtr ( Tvector *  eigVecPtr_) [inline]

Improves homo and lumo bounds if the new ones are better.

Uses XmX2EuclNorm if possible.

Referenced by mat::Purification::stepComputeInfo().

void mat::PuriStepInfo::setEstimatedStepsLeft ( int const  stepsleft) [inline]
void mat::PuriStepInfo::setMemUsageBeforeTrunc ( ) [inline]
void mat::PuriStepInfo::setMemUsageInXmX2Diff ( MemUsage::Values memUsage) [inline]
void mat::PuriStepInfo::setNnzX ( size_t const  nzX) [inline]
void mat::PuriStepInfo::setNnzX2 ( size_t const  nzX2) [inline]
void mat::PuriStepInfo::setPoly ( )
void mat::PuriStepInfo::setTimeSquare ( float  t) [inline]
void mat::PuriStepInfo::setTimeThresh ( float  t) [inline]
void mat::PuriStepInfo::setTimeTotal ( float  t) [inline]
void mat::PuriStepInfo::setTimeXmX2Norm ( float  t) [inline]
void mat::PuriStepInfo::setTimeXX2Read ( float  t) [inline]
void mat::PuriStepInfo::setTimeXX2Write ( float  t) [inline]
void mat::PuriStepInfo::setTraceX ( Treal const  trX) [inline]
void mat::PuriStepInfo::setTraceX2 ( Treal const  trX2) [inline]
void mat::PuriStepInfo::setXmX2EuclNorm ( Interval< Treal > const  XmX2eucl) [inline]

Sets XmX2EuclNorm bounds.

Referenced by mat::Purification::stepComputeInfo().

Treal mat::PuriStepInfo::subspaceError ( ) const

Member Data Documentation

Takes the values: 1 meaning all eigenvalues supposed to go to 1 are larger than 0.5 and all eigenvalues supposed to go to 0 are smaller than 0.5 for sure.

0 otherwise

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setCorrectOccupation(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getCorrectOccupation().

Treal mat::PuriStepInfo::delta [protected]

Largest possible deviation from the [0 1] interval.

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getDelta().

Treal mat::PuriStepInfo::eigAccLoss [protected]

A probable upper bound of the accuracy that is lost in the eigenvalues of X * X because of limited relative precision in the storage of X.

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getEigAccLoss().

Treal mat::PuriStepInfo::eigConvCrit [protected]

Tolerated deviation from 0 and 1 of converged eigenvalues.

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::converged().

Estimated steps left in purification.

Used to chose threshold. -1 indicates no estimation possible.

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setEstimatedStepsLeft(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getEstimatedStepsLeft().

Flag indicating if homo was computed.

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getHomoWasComputed().

Flag indicating if lumo was computed.

(Eigenvector exists.)

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getLumoWasComputed().

Treal mat::PuriStepInfo::n0 [protected]

Lower bound on the number of eigenvalues in [lambdaMin, 0.5].

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getN0().

Treal mat::PuriStepInfo::n1 [protected]

Lower bound on the number of eigenvalues in [0.5, 1 + delta].

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getN1().

int mat::PuriStepInfo::nocc [protected]
int mat::PuriStepInfo::poly [protected]

Choice of polynomial 0 for x^2 and 1 for 2 * x - x^2.

Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getPoly().


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