#include <QMCEquilibrationArray.h>
Public Member Functions | |
QMCEquilibrationArray () | |
Creates a zeroed out instance of the class. | |
void | zeroOut () |
Sets all of the data in the object to zero. | |
void | setCalcDensity (bool calcDensity, int nbasisfunctions) |
Tells the object if basis function densities are being calculated. | |
void | setCalcForces (bool calcForces, int dim1, int dim2) |
Tells the object if basis function densities are being calculated. | |
void | newSample (QMCProperties *timeStepProperties, double totalWeight, int nWalkers) |
Adds a new data sample to the live objects in the array and updates decorr_objects if necessary. | |
QMCProperties * | chooseDecorrObject () |
Gets the element of the array that has the lowest variance for the total energy and updates the current_index. | |
Stopwatch * | getPropagationStopwatch () |
Gets the propagation stopwatch for the element of the array with the lowest variance for the total energy. | |
Stopwatch * | getEquilibrationStopwatch () |
Gets the equilibration stopwatch for the element of the array with the lowest variance for the total energy. | |
void | startTimers () |
Starts the propagation stopwatches in the active elements of the array and the equilibration stopwatches in the inactive elements. | |
void | stopTimers () |
Stops the timers. | |
void | toXML (ostream &strm) |
Writes the state of the object to an XML stream. | |
bool | readXML (istream &strm) |
Reads the state of the object from an XML stream. | |
Private Member Functions | |
int | getDecorrObjectIndex () |
Returns the index of the element of the array with the lowest variance for the total energy. | |
long | power (int a, int b) |
Returns a^b. | |
Private Attributes | |
QMCExtendedProperties | Eq_Array [EQ] |
The array of QMCExtendedProperties objects. | |
QMCExtendedProperties | ZeroProperties |
This object has no samples in it. | |
int | decorr_objects |
The number of active objects in the array. | |
bool | calc_density |
True if basis function density is being calculated. | |
int | nBasisFunc |
Only has a value if calc_density = true. | |
bool | calc_forces |
True if nuclear forces are being calculated. | |
Array2D< double > | ten_thousand_samples |
This array stores the expectation value and standard deviation of each object after it has been active for 10000 samples. | |
int | over_ten_thousand |
The object with the lowest variance in the energy is the one with the optimal number of equilibration steps.
Definition at line 18 of file QMCEquilibrationArray.h.
QMCEquilibrationArray::QMCEquilibrationArray | ( | ) |
Creates a zeroed out instance of the class.
Definition at line 5 of file QMCEquilibrationArray.cpp.
References Array2D< T >::allocate(), calc_density, EQ, nBasisFunc, over_ten_thousand, ten_thousand_samples, and zeroOut().
int QMCEquilibrationArray::getDecorrObjectIndex | ( | ) | [private] |
Returns the index of the element of the array with the lowest variance for the total energy.
Definition at line 94 of file QMCEquilibrationArray.cpp.
References QMCProperties::energy, Eq_Array, QMCProperty::getAverage(), QMCProperty::getBlockStandardDeviation(), QMCExtendedProperties::getProperties(), over_ten_thousand, and ten_thousand_samples.
Referenced by chooseDecorrObject(), getEquilibrationStopwatch(), and getPropagationStopwatch().
long QMCEquilibrationArray::power | ( | int | a, | |
int | b | |||
) | [private] |
Returns a^b.
This function had to be included because some compilers don't allow pow to be called with two integer arguments.
a | base. | |
b | power. |
Definition at line 248 of file QMCEquilibrationArray.cpp.
Referenced by newSample(), and readXML().
void QMCEquilibrationArray::zeroOut | ( | ) |
Sets all of the data in the object to zero.
Definition at line 15 of file QMCEquilibrationArray.cpp.
References decorr_objects, EQ, Eq_Array, over_ten_thousand, QMCExtendedProperties::setStartingStep(), ten_thousand_samples, QMCExtendedProperties::zeroOut(), and ZeroProperties.
Referenced by QMCRun::initialize(), QMCEquilibrationArray(), and QMCRun::zeroOut().
void QMCEquilibrationArray::setCalcDensity | ( | bool | calcDensity, | |
int | nbasisfunctions | |||
) |
Tells the object if basis function densities are being calculated.
Definition at line 27 of file QMCEquilibrationArray.cpp.
References calc_density, EQ, and nBasisFunc.
Referenced by QMCRun::initialize().
void QMCEquilibrationArray::setCalcForces | ( | bool | calcForces, | |
int | dim1, | |||
int | dim2 | |||
) |
Tells the object if basis function densities are being calculated.
Definition at line 40 of file QMCEquilibrationArray.cpp.
References calc_forces, and EQ.
Referenced by QMCRun::initialize().
void QMCEquilibrationArray::newSample | ( | QMCProperties * | timeStepProperties, | |
double | totalWeight, | |||
int | nWalkers | |||
) |
Adds a new data sample to the live objects in the array and updates decorr_objects if necessary.
timeStepProperties | new sample. | |
totalWeight | total weight of the new sample. | |
nWalkers | number of walkers that generated the sample. |
Definition at line 53 of file QMCEquilibrationArray.cpp.
References decorr_objects, QMCProperties::energy, Eq_Array, QMCProperty::getAverage(), QMCProperty::getBlockStandardDeviation(), QMCExtendedProperties::getProperties(), over_ten_thousand, power(), QMCExtendedProperties::setStartingStep(), and ten_thousand_samples.
Referenced by QMCRun::calculateObservables().
QMCProperties * QMCEquilibrationArray::chooseDecorrObject | ( | ) |
Gets the element of the array that has the lowest variance for the total energy and updates the current_index.
Definition at line 83 of file QMCEquilibrationArray.cpp.
References Eq_Array, getDecorrObjectIndex(), QMCExtendedProperties::getProperties(), and ZeroProperties.
Referenced by QMCRun::getProperties().
Stopwatch * QMCEquilibrationArray::getPropagationStopwatch | ( | ) |
Gets the propagation stopwatch for the element of the array with the lowest variance for the total energy.
Definition at line 128 of file QMCEquilibrationArray.cpp.
References Eq_Array, getDecorrObjectIndex(), QMCExtendedProperties::getPropagationStopwatch(), and ZeroProperties.
Referenced by QMCRun::getPropagationStopwatch(), startTimers(), and stopTimers().
Stopwatch * QMCEquilibrationArray::getEquilibrationStopwatch | ( | ) |
Gets the equilibration stopwatch for the element of the array with the lowest variance for the total energy.
Definition at line 137 of file QMCEquilibrationArray.cpp.
References Eq_Array, getDecorrObjectIndex(), QMCExtendedProperties::getEquilibrationStopwatch(), and ZeroProperties.
Referenced by QMCRun::getEquilibrationStopwatch(), startTimers(), and stopTimers().
void QMCEquilibrationArray::startTimers | ( | ) |
Starts the propagation stopwatches in the active elements of the array and the equilibration stopwatches in the inactive elements.
Definition at line 146 of file QMCEquilibrationArray.cpp.
References decorr_objects, EQ, Eq_Array, QMCExtendedProperties::getEquilibrationStopwatch(), getEquilibrationStopwatch(), getPropagationStopwatch(), Stopwatch::start(), and ZeroProperties.
Referenced by QMCRun::startTimers().
void QMCEquilibrationArray::stopTimers | ( | ) |
Stops the timers.
Definition at line 155 of file QMCEquilibrationArray.cpp.
References EQ, Eq_Array, QMCExtendedProperties::getEquilibrationStopwatch(), getEquilibrationStopwatch(), QMCExtendedProperties::getPropagationStopwatch(), getPropagationStopwatch(), Stopwatch::isRunning(), Stopwatch::stop(), and ZeroProperties.
Referenced by QMCRun::stopTimers().
void QMCEquilibrationArray::toXML | ( | ostream & | strm | ) |
Writes the state of the object to an XML stream.
strm | stream to write data to. |
Definition at line 168 of file QMCEquilibrationArray.cpp.
References decorr_objects, Eq_Array, over_ten_thousand, and ten_thousand_samples.
Referenced by QMCRun::toXML().
bool QMCEquilibrationArray::readXML | ( | istream & | strm | ) |
Reads the state of the object from an XML stream.
strm | stream to read data from. |
Definition at line 183 of file QMCEquilibrationArray.cpp.
References decorr_objects, EQ, Eq_Array, over_ten_thousand, power(), QMCExtendedProperties::setStartingStep(), ten_thousand_samples, QMCExtendedProperties::zeroOut(), and ZeroProperties.
Referenced by QMCRun::readXML().
QMCExtendedProperties QMCEquilibrationArray::Eq_Array[EQ] [private] |
The array of QMCExtendedProperties objects.
Definition at line 25 of file QMCEquilibrationArray.h.
Referenced by chooseDecorrObject(), getDecorrObjectIndex(), getEquilibrationStopwatch(), getPropagationStopwatch(), newSample(), readXML(), startTimers(), stopTimers(), toXML(), and zeroOut().
This object has no samples in it.
It is returned if the algorithm doesn't think any of the objects are equilibrated yet.
Definition at line 31 of file QMCEquilibrationArray.h.
Referenced by chooseDecorrObject(), getEquilibrationStopwatch(), getPropagationStopwatch(), readXML(), startTimers(), stopTimers(), and zeroOut().
int QMCEquilibrationArray::decorr_objects [private] |
The number of active objects in the array.
Definition at line 36 of file QMCEquilibrationArray.h.
Referenced by newSample(), readXML(), startTimers(), toXML(), and zeroOut().
bool QMCEquilibrationArray::calc_density [private] |
True if basis function density is being calculated.
Definition at line 57 of file QMCEquilibrationArray.h.
Referenced by QMCEquilibrationArray(), and setCalcDensity().
int QMCEquilibrationArray::nBasisFunc [private] |
Only has a value if calc_density = true.
Definition at line 62 of file QMCEquilibrationArray.h.
Referenced by QMCEquilibrationArray(), and setCalcDensity().
bool QMCEquilibrationArray::calc_forces [private] |
True if nuclear forces are being calculated.
Definition at line 67 of file QMCEquilibrationArray.h.
Referenced by setCalcForces().
Array2D<double> QMCEquilibrationArray::ten_thousand_samples [private] |
This array stores the expectation value and standard deviation of each object after it has been active for 10000 samples.
Definition at line 73 of file QMCEquilibrationArray.h.
Referenced by getDecorrObjectIndex(), newSample(), QMCEquilibrationArray(), readXML(), toXML(), and zeroOut().
int QMCEquilibrationArray::over_ten_thousand [private] |
Definition at line 75 of file QMCEquilibrationArray.h.
Referenced by getDecorrObjectIndex(), newSample(), QMCEquilibrationArray(), readXML(), toXML(), and zeroOut().