ergo
|
Contains information about the matrix before a purification step and about the step. More...
#include <PuriStepInfo.h>
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 |
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.
mat::PuriStepInfo::PuriStepInfo | ( | int | nn = -1 , |
int | noc = -1 , |
||
Treal | eigvalConvCrit = 0.0 |
||
) | [inline, explicit] |
mat::PuriStepInfo::~PuriStepInfo | ( | ) | [inline] |
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().
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] |
void mat::PuriStepInfo::exchangeInfoWithNext | ( | PuriStepInfo< Treal, Tvector, TdebugPolicy > & | next | ) |
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] |
Referenced by mat::Purification::step(), and mat::Purification::stepComputeInfo().
Interval<Treal> const& mat::PuriStepInfo::getEigInterval | ( | ) | const [inline] |
Referenced by mat::Purification::stepComputeInfo(), and mat::operator<<().
Tvector const* const mat::PuriStepInfo::getEigVecPtr | ( | ) | const [inline] |
int mat::PuriStepInfo::getEstimatedStepsLeft | ( | ) | const [inline] |
Interval<Treal> const& mat::PuriStepInfo::getHomo | ( | ) | const [inline] |
Referenced by mat::Purification::step(), and mat::operator<<().
bool mat::PuriStepInfo::getHomoWasComputed | ( | ) | [inline] |
Interval<Treal> const& mat::PuriStepInfo::getLumo | ( | ) | const [inline] |
Referenced by mat::Purification::step(), and mat::operator<<().
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] |
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::converged(), and mat::operator<<().
bool mat::PuriStepInfo::homoIsAccuratelyKnown | ( | Treal | accuracyLimit | ) | const [inline] |
accuracyLimit | HOMO 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 | ||
) |
References ASSERTALWAYS, mat::sqrtInt(), mat::Interval::length(), mat::Interval::low(), and template_blas_sqrt().
Referenced by mat::Purification::Purification(), and exchangeInfoWithNext().
bool mat::PuriStepInfo::lumoIsAccuratelyKnown | ( | Treal | accuracyLimit | ) | const [inline] |
accuracyLimit | LUMO estimation is considered to be accurate if the error is smaller than this value. |
void mat::PuriStepInfo::setActualThresh | ( | Treal const | thr | ) | [inline] |
Referenced by mat::Purification::Purification(), and mat::Purification::step().
void mat::PuriStepInfo::setChosenThresh | ( | Treal const | thr | ) | [inline] |
Referenced by mat::Purification::Purification(), and mat::Purification::step().
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] |
Referenced by mat::Purification::Purification(), and mat::Purification::step().
void mat::PuriStepInfo::setMemUsageInXmX2Diff | ( | MemUsage::Values & | memUsage | ) | [inline] |
void mat::PuriStepInfo::setNnzX | ( | size_t const | nzX | ) | [inline] |
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setNnzX2 | ( | size_t const | nzX2 | ) | [inline] |
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setPoly | ( | ) |
References ASSERTALWAYS, and template_blas_fabs().
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setTimeSquare | ( | float | t | ) | [inline] |
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setTimeThresh | ( | float | t | ) | [inline] |
Referenced by mat::Purification::Purification(), and mat::Purification::step().
void mat::PuriStepInfo::setTimeTotal | ( | float | t | ) | [inline] |
Referenced by mat::Purification::Purification(), and mat::Purification::step().
void mat::PuriStepInfo::setTimeXmX2Norm | ( | float | t | ) | [inline] |
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setTimeXX2Read | ( | float | t | ) | [inline] |
void mat::PuriStepInfo::setTimeXX2Write | ( | float | t | ) | [inline] |
void mat::PuriStepInfo::setTraceX | ( | Treal const | trX | ) | [inline] |
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setTraceX2 | ( | Treal const | trX2 | ) | [inline] |
Referenced by mat::Purification::stepComputeInfo().
void mat::PuriStepInfo::setXmX2EuclNorm | ( | Interval< Treal > const | XmX2eucl | ) | [inline] |
Sets XmX2EuclNorm bounds.
Referenced by mat::Purification::stepComputeInfo().
Treal mat::PuriStepInfo::subspaceError | ( | ) | const |
References mat::Interval::length().
Treal mat::PuriStepInfo::actualThresh [protected] |
Actual threshold value applied before step.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setActualThresh(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getActualThresh(), and exchangeInfoWithNext().
Treal mat::PuriStepInfo::chosenThresh [protected] |
Chosen threshold value applied before step.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setChosenThresh(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getChosenThresh().
int mat::PuriStepInfo::correctOccupation [protected] |
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().
Interval<Treal> mat::PuriStepInfo::eigInterval [protected] |
Interval containing the eigenvalue spectrum.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getEigInterval(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::checkIntervals().
Tvector* mat::PuriStepInfo::eigVecPtr [protected] |
Eigenvector possibly containing the homo or lumo eigenvector.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::~PuriStepInfo(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setEigVecPtr(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getEigVecPtr().
int mat::PuriStepInfo::estimatedStepsLeft [protected] |
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().
Interval<Treal> mat::PuriStepInfo::homo [protected] |
Interval containing the homo eigenvalue.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::converged(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getHomo(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::checkIntervals(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::homoIsAccuratelyKnown(), and exchangeInfoWithNext().
bool mat::PuriStepInfo::homoWasComputed [protected] |
Flag indicating if homo was computed.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getHomoWasComputed().
Interval<Treal> mat::PuriStepInfo::lumo [protected] |
Interval containing the lumo eigenvalue.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::converged(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getLumo(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::checkIntervals(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::lumoIsAccuratelyKnown(), and exchangeInfoWithNext().
bool mat::PuriStepInfo::lumoWasComputed [protected] |
Flag indicating if lumo was computed.
(Eigenvector exists.)
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getLumoWasComputed().
int mat::PuriStepInfo::n [protected] |
System size.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::computeExactValues().
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().
size_t mat::PuriStepInfo::nnzX [protected] |
Number of nonzeros in the matrix X.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setNnzX(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getNnzX().
size_t mat::PuriStepInfo::nnzX2 [protected] |
Number of nonzeros in the matrix X2.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setNnzX2(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getNnzX2().
int mat::PuriStepInfo::nocc [protected] |
Number of occupied orbitals.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::computeExactValues().
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().
float mat::PuriStepInfo::timeSquare [protected] |
float mat::PuriStepInfo::timeThresh [protected] |
float mat::PuriStepInfo::timeTotal [protected] |
float mat::PuriStepInfo::timeXmX2Norm [protected] |
float mat::PuriStepInfo::timeXX2Read [protected] |
float mat::PuriStepInfo::timeXX2Write [protected] |
Treal mat::PuriStepInfo::traceX [protected] |
Trace of the matrix X.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setTraceX(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getTraceX().
Treal mat::PuriStepInfo::traceX2 [protected] |
Trace of the squared matrix X^2.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setTraceX2(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getTraceX2().
Interval<Treal> mat::PuriStepInfo::XmX2EuclNorm [protected] |
Interval containing the euclidean norm ||X-X^2||_2 before step.
Referenced by mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::setXmX2EuclNorm(), mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::getXmX2EuclNorm(), and mat::PuriStepInfo< Treal, Tvector, TdebugPolicy >::checkIntervals().