#include <Array1D.h>
Public Member Functions | |
int | dim1 () const |
Gets the number of elements in the array's first dimension. | |
int | size () const |
Gets the total number of elements in the array. | |
T * | array () |
Gets a pointer to an array containing the array elements. | |
void | allocate (int i) |
Allocates memory for the array. | |
void | resize (int i) |
This is for compatability with std::vector. | |
void | clear () |
This is for compatability with std::vector. | |
void | deallocate () |
Deallocates memory for the array. | |
T | operator* (const Array1D &rhs) |
Returns the dot product of two arrays. | |
Array1D | operator+ (const Array1D &rhs) |
Returns the sum of two arrays. | |
void | operator+= (const Array1D< T > &rhs) |
void | operator= (const Array1D &rhs) |
Sets two arrays equal. | |
void | operator= (const T C) |
Sets all of the elements in an array equal to the same value. | |
Array1D | operator* (const double rhs) |
Returns the product of an array and a double. | |
void | operator*= (const T C) |
Sets this array equal to itself times a scalar value. | |
void | operator/= (const T C) |
Sets this array equal to itself divided by a scalar value. | |
Array1D | operator- (const Array1D &rhs) |
Returns the difference of two arrays. | |
void | quaternion_conjugate () |
Conjugates a quaternion. | |
Array1D | quaternion_product (const Array1D &rhs) |
Returns the product of two quaternions. | |
void | rotate (Array1D axis, double angle) |
Rotates a vector by an angle about a normalized axis. | |
void | rotateQ (Array1D axis, double angle) |
Rotates a point by an angle about an axis, using a very general approach with quaternions. | |
Array1D< T > | cross (Array1D< T > &rhs) |
Returns the cross product of two vectors. | |
T | mag () |
Array1D () | |
Creates an array. | |
Array1D (int i) | |
Creates an array and allocates memory. | |
Array1D (int i, double shift, double range, long &iseed) | |
Create a random array. | |
Array1D (const Array1D &rhs) | |
Creates an array and sets it equal to another array. | |
~Array1D () | |
Destroys the array and cleans up the memory. | |
T & | operator() (int i) |
Accesses element (i) of the array. | |
T | get (int i) const |
It's nice to have a const accessor. | |
T & | operator[] (int i) |
void | printArray1D (ostream &strm, int numSigFig, int columnSpace, int maxI, char sep, bool sci) const |
This makes it easier to print out the Array1D for input into Mathematica. | |
int | read (istream &strm, T initialization, string label) |
This function assumes that the Array1D was initialized to the expected number of parameters. | |
Private Attributes | |
int | n_1 |
Number of elements in the array's first dimension. | |
T * | pArray |
Array containing the data. | |
Friends | |
ostream & | operator<< (ostream &strm, const Array1D< T > &rhs) |
Prints the array to a stream. |
All of the memory allocation and deallocation details are dealt with by the class.
Some of the methods can now be run with ATLAS. Some of the other methods (e.g. rotation) can also be sent to ATLAS, but these aren't bottlenecks...
Definition at line 32 of file Array1D.h.
Array1D< T >::Array1D | ( | int | i, | |
double | shift, | |||
double | range, | |||
long & | iseed | |||
) | [inline] |
Create a random array.
It uses the UNIX rand function, which will produce a uniform random number, [0,1)
shift | will be added to the random value | |
range | after adding shift, we'll multiply by range | |
iseed | will be used to initialize srand, if iseed > 0 |
int Array1D< T >::dim1 | ( | ) | const [inline] |
Gets the number of elements in the array's first dimension.
Definition at line 55 of file Array1D.h.
Referenced by QMCBasisFunction::angularGrid(), QMCBasisFunction::basisFunctionsOnGrid(), QMCMikesBracketingStepLengthSelector::bracket(), QMCNuclearForces::calcCoefficients(), QMCSCFJastrow::calculate_CorrelatedSampling(), QMCSCFJastrow::calculate_OrbitalDerivatives(), QMCJastrowParameters::calculate_penalty_function(), QMCSCFJastrow::calculate_Psi_quantities(), QMCWalker::calculateDerivatives(), QMCWalker::calculateElectronDensities(), QMCWalker::calculateObservables(), QMCElectronNucleusCuspParameters::calculateSigmaSq(), QMCPsiPotential::CountGaussians(), Array1D< QMCProperty >::cross(), CKGeneticAlgorithm1::crossover(), AtomicOrbitalInverter::eval_gaussians(), QMCNuclearForces::evaluate(), QMCJastrowElectronNuclear::evaluate(), Polynomial::evaluate(), Polynomial::evaluateAll(), QMCManager::gatherExtraProperties(), QMCManager::gatherForces(), QMCManager::gatherHistograms(), Array2D< QMCProperty >::generalizedEigenvectors(), QMCEigenSearch::get_a_diag(), QMCDerivativeProperties::getCorrelatedSamples(), QMCJastrowParameters::getJWParameters(), Polynomial::getNumberCoefficients(), QMCWavefunction::getNumberOrbitals(), QMCDerivativeProperties::getParameterHamiltonian(), QMCDerivativeProperties::getParameterHessian(), QMCDerivativeProperties::getParameterOverlap(), QMCEigenSearch::getParameters(), QMCJastrowParameters::getPoles(), QMCSlater::getPsi(), Polynomial::getRoots(), QMCNuclearForces::getTemperTerm(), QMCPolynomial::hasNonNegativeZeroes(), QMCWalkerData::initialize(), QMCSlater::initialize(), QMCRun::initialize(), QMCNuclearForces::initialize(), QMCJastrowElectronNuclear::initialize(), QMCJastrowElectronElectron::initialize(), Polynomial::initialize(), AtomicOrbitalInverter::initialize(), QMCBasisFunction::initializeInterpolation(), QMCBasisFunction::initializeInterpolations(), Yukawa2CorrelationFunction::initializeParameters(), Williamson2CorrelationFunction::initializeParameters(), Umrigar2CorrelationFunction::initializeParameters(), PadeCorrelationFunction::initializeParameters(), JuliusCorrelationFunction::initializeParameters(), FixedCuspPadeCorrelationFunction::initializeParameters(), CambridgeThreeBodyCorrelationFunction::initializeParameters(), Cambridge2CorrelationFunction::initializeParameters(), Anderson2CorrelationFunction::initializeParameters(), CKGeneticAlgorithm1::initializePopulation(), QMCThreeBodyCorrelationFunctionParameters::initializeThreeBodyCorrelationFunctionParameters(), CubicSpline::initializeWithDerivativeValues(), LinearSpline::initializeWithFunctionValues(), CubicSpline::initializeWithFunctionValues(), AtomicOrbitalInverter::invert_gaussians(), QMCThreeBodyJastrow::jastrowOnGrid(), QMCJastrowElectronNuclear::jastrowOnGrid(), QMCJastrowElectronElectron::jastrowOnGrid(), QMCPsiPotential::LoadOrbitals(), QMCReadAndEvaluateConfigs::locally_CalculateProperties(), DistributionInverter::make_F_and_F_inverse(), QMCWavefunction::makeCoefficients(), QMCReadAndEvaluateConfigs::MPI_reduce(), CKGeneticAlgorithm1::mutate(), QMCPropertyArrays::newSample(), QMCObjectiveFunction::numerical_grad(), QMCPropertyArrays::operator+(), operator<<(), QMCWalker::operator=(), QMCLineSearch::optimize(), QMCEigenSearch::optimize(), QMCCorrelatedSamplingVMCOptimization::optimize(), QMCThreeBodyJastrow::packageDerivatives(), QMCJastrowParameters::print(), Polynomial::print(), QMCInput::printAIParameters(), QMCElectronNucleusCuspParameters::printParameters(), QMCRun::propagateWalkers(), QMCMikesBracketingStepLengthSelector::quadratic_rebracketer(), QMCWavefunction::read(), QMCThreeBodyCorrelationFunctionParameters::read(), QMCJastrowParameters::read(), QMCMolecule::readGeometry(), QMCMolecule::readPsuedoPotential(), QMCPropertyArrays::readXML(), QMCLinearizeStepLength::rescalingJCP(), QMCLinearizeStepLength::rescalingPRL(), QMCPropertyArrays::setCalcForces(), QMCThreeBodyCorrelationFunctionParameters::setFreeParameters(), QMCJastrowParameters::setJWParameters(), QMCWavefunction::setORParameters(), QMCCorrelationFunctionParameters::setParameters(), Array2D< QMCProperty >::setRow(), QMCPropertyArrays::toXML(), CubicSpline::toXML(), QMCSlater::update_Ds(), QMCSCFJastrow::update_SCF(), QMCThreeBodyJastrow::updateAll(), QMCJastrowElectronElectron::updateAll(), QMCThreeBodyJastrow::updateOne(), QMCPsiPotential::UseWavefunction(), QMCReadAndEvaluateConfigs::workerCalculateProperties(), QMCManager::writeElectronDensityHistograms(), QMCManager::writeForces(), QMCPropertyArrays::zeroOut(), QMCThreeBodyCorrelationFunctionParameters::zeroOutDerivatives(), Polynomial::zroots(), QMCJastrow::~QMCJastrow(), QMCJastrowElectronElectron::~QMCJastrowElectronElectron(), QMCJastrowElectronNuclear::~QMCJastrowElectronNuclear(), QMCNuclearForces::~QMCNuclearForces(), QMCPropertyArrays::~QMCPropertyArrays(), and QMCSlater::~QMCSlater().
int Array1D< T >::size | ( | ) | const [inline] |
Gets the total number of elements in the array.
Definition at line 65 of file Array1D.h.
Referenced by QMCEigenSearch::get_a_diag(), DistributionInverter::initialize(), QMCPropertyArrays::newSample(), QMCPropertyArrays::operator+(), operator<<(), QMCPropertyArrays::QMCPropertyArrays(), QMCPropertyArrays::readXML(), QMCPropertyArrays::toXML(), QMCPropertyArrays::zeroOut(), and QMCPropertyArrays::~QMCPropertyArrays().
T* Array1D< T >::array | ( | ) | [inline] |
Gets a pointer to an array containing the array elements.
The ordering of this array is NOT specified.
Definition at line 75 of file Array1D.h.
Referenced by QMCBasisFunction::basisFunctionsOnGrid(), QMCBasisFunction::evaluateBasisFunctions(), QMCManager::gatherDensities(), QMCManager::gatherExtraProperties(), QMCManager::gatherForces(), QMCManager::gatherHistograms(), Array2D< QMCProperty >::generalizedEigenvectors(), QMCReadAndEvaluateConfigs::MPI_reduce(), QMCCorrelatedSamplingVMCOptimization::optimize(), QMCMolecule::readPsuedoPotential(), and Array2D< QMCProperty >::setRow().
void Array1D< T >::allocate | ( | int | i | ) | [inline] |
Allocates memory for the array.
i | size of the array's first dimension. |
Definition at line 85 of file Array1D.h.
Referenced by QMCSlater::allocate(), Array1D< QMCProperty >::Array1D(), QMCMikesBracketingStepLengthSelector::bracket(), QMCSCFJastrow::calculate_CorrelatedSampling(), QMCSCFJastrow::calculate_Psi_quantities(), QMCWalker::calculateObservables(), Array2D< QMCProperty >::determinant_and_inverse(), QMCElectronNucleusCusp::determineRc(), Array2D< QMCProperty >::eigenvaluesRS(), QMCHarmonicOscillator::evaluate(), QMCPotential_Energy::evaluatePsuedoPotential(), QMCElectronNucleusCuspParameters::fitReplacementOrbital(), QMCManager::gatherHistograms(), Array2D< QMCProperty >::generalizedEigenvectors(), QMCDerivativeProperties::getCorrelatedSamples(), QMCNuclearForces::getDensities(), QMCThreeBodyCorrelationFunctionParameters::getFree(), QMCDerivativeProperties::getParameterGradient(), QMCSlater::getPsi(), QMCWalkerData::initialize(), QMCRun::initialize(), QMCPotential_Energy::initialize(), QMCNuclearForces::initialize(), QMCJastrowElectronNuclear::initialize(), QMCJastrowElectronElectron::initialize(), QMCJastrow::initialize(), QMCBasisFunction::initialize(), Polynomial::initialize(), AtomicOrbitalInverter::initialize(), QMCDansWalkerInitialization::initializeArrays(), ZeroThreeBodyCorrelationFunction::initializeParameters(), Williamson2CorrelationFunction::initializeParameters(), CambridgeThreeBodyCorrelationFunction::initializeParameters(), Anderson2CorrelationFunction::initializeParameters(), QMCThreeBodyCorrelationFunctionParameters::initializeThreeBodyCorrelationFunctionParameters(), CubicSpline::initializeWithDerivativeValues(), LinearSpline::initializeWithFunctionValues(), CubicSpline::initializeWithFunctionValues(), QMCReadAndEvaluateConfigs::locally_CalculateProperties(), DistributionInverter::make_F_and_F_inverse(), QMCReadAndEvaluateConfigs::MPI_reduce(), QMCObjectiveFunction::numerical_grad(), QMCWalker::operator=(), Array1D< QMCProperty >::operator=(), operator>>(), QMCEigenSearch::optimize(), QMCCorrelatedSamplingVMCOptimization::optimize(), QMCThreeBodyJastrow::packageDerivatives(), QMCRun::propagateWalkers(), QMCCorrelationFunctionParameters::QMCCorrelationFunctionParameters(), QMCPropertyArrays::QMCPropertyArrays(), QMCThreeBodyCorrelationFunctionParameters::QMCThreeBodyCorrelationFunctionParameters(), QMCMikesBracketingStepLengthSelector::quadratic_rebracketer(), QMCWavefunction::read(), QMCThreeBodyCorrelationFunctionParameters::read(), QMCJastrowParameters::read(), QMCCorrelationFunctionParameters::read(), QMCMolecule::readGeometry(), QMCMolecule::readPsuedoPotential(), Array1D< QMCProperty >::resize(), QMCReadAndEvaluateConfigs::rootCalculateProperties(), QMCPropertyArrays::setCalcDensity(), QMCPropertyArrays::setCalcForces(), QMCThreeBodyCorrelationFunctionParameters::setFreeParameters(), QMCJastrowParameters::setJWParameters(), QMCThreeBodyCorrelationFunctionParameters::setTotalParameters(), QMCThreeBodyCorrelationFunctionParameters::totalToFree(), QMCSlater::update_Ds(), QMCSCFJastrow::update_SCF(), QMCNuclearForces::waveMemorization(), QMCReadAndEvaluateConfigs::workerCalculateProperties(), and QMCPropertyArrays::zeroOut().
void Array1D< T >::resize | ( | int | i | ) | [inline] |
This is for compatability with std::vector.
It just calls allocate(int i).
Definition at line 120 of file Array1D.h.
Referenced by QMCWalker::initialize().
void Array1D< T >::clear | ( | ) | [inline] |
This is for compatability with std::vector.
It just deallocates.
Definition at line 129 of file Array1D.h.
Referenced by QMCWalker::~QMCWalker().
void Array1D< T >::deallocate | ( | ) | [inline] |
Deallocates memory for the array.
Definition at line 138 of file Array1D.h.
Referenced by Array1D< QMCProperty >::allocate(), QMCWalker::calculateDerivatives(), QMCWalker::calculateObservables(), Array1D< QMCProperty >::clear(), Array2D< QMCProperty >::deallocate(), Array2D< QMCProperty >::eigenvaluesRS(), QMCNuclearForces::evaluate(), QMCElectronNucleusCuspParameters::fitReplacementOrbital(), QMCManager::gatherHistograms(), Array2D< QMCProperty >::generalizedEigenvectors(), QMCEigenSearch::optimize(), QMCCorrelatedSamplingVMCOptimization::optimize(), QMCRun::propagateWalkers(), QMCThreeBodyCorrelationFunctionParameters::read(), QMCCorrelationFunctionParameters::read(), QMCPropertyArrays::setCalcDensity(), QMCPropertyArrays::setCalcForces(), QMCSlater::update_Ds(), QMCSCFJastrow::update_SCF(), QMCThreeBodyJastrow::updateAll(), QMCThreeBodyJastrow::updateOne(), QMCNuclearForces::waveMemorization(), QMCManager::writeElectronDensityHistograms(), QMCPropertyArrays::zeroOut(), Array1D< QMCProperty >::~Array1D(), CambridgeThreeBodyCorrelationFunction::~CambridgeThreeBodyCorrelationFunction(), QMCCorrelationFunctionParameters::~QMCCorrelationFunctionParameters(), QMCDansWalkerInitialization::~QMCDansWalkerInitialization(), QMCJastrow::~QMCJastrow(), QMCJastrowElectronElectron::~QMCJastrowElectronElectron(), QMCJastrowElectronNuclear::~QMCJastrowElectronNuclear(), QMCNuclearForces::~QMCNuclearForces(), QMCPropertyArrays::~QMCPropertyArrays(), QMCSlater::~QMCSlater(), QMCThreeBodyCorrelationFunctionParameters::~QMCThreeBodyCorrelationFunctionParameters(), and QMCWalker::~QMCWalker().
void Array1D< T >::operator= | ( | const T | C | ) | [inline] |
void Array1D< T >::operator*= | ( | const T | C | ) | [inline] |
Sets this array equal to itself times a scalar value.
Definition at line 317 of file Array1D.h.
Referenced by Array1D< QMCProperty >::operator/=().
void Array1D< T >::operator/= | ( | const T | C | ) | [inline] |
void Array1D< T >::quaternion_conjugate | ( | ) | [inline] |
Returns the product of two quaternions.
rhs | quaternion to multiply by this quaternion. |
Definition at line 384 of file Array1D.h.
Referenced by Array1D< QMCProperty >::rotateQ().
Rotates a vector by an angle about a normalized axis.
It uses a rotation matrix, and is ~6-7 times faster than rotateQ.
This procedure takes 9+12 = 21 multiplications and 1+15=16 additions, for a total of 37 operations, and 2 trig operations.
angle | ||
axis | 3D coords of axis of unit length about which we are rotating. |
Definition at line 413 of file Array1D.h.
Referenced by QMCDansWalkerInitialization::dist_energy_level(), and QMCWalker::moveElectronsUmrigar93AcceleratedSampling().
T Array1D< T >::mag | ( | ) | [inline] |
Definition at line 498 of file Array1D.h.
Referenced by QMCWavefunction::getCINorm(), and QMCWavefunction::normalizeCI().
T& Array1D< T >::operator() | ( | int | i | ) | [inline] |
T Array1D< T >::get | ( | int | i | ) | const [inline] |
It's nice to have a const accessor.
Definition at line 592 of file Array1D.h.
Referenced by _SVDFwBackSubst(), QMCThreeBodyCorrelationFunctionParameters::freeToTotal(), QMCThreeBodyCorrelationFunctionParameters::getFree(), QMCPropertyArrays::matchParametersTo(), QMCThreeBodyCorrelationFunctionParameters::setTotalParameters(), QMCThreeBodyCorrelationFunctionParameters::totalDerivativesAccumulate(), QMCThreeBodyCorrelationFunctionParameters::totalDerivativesToFree(), and QMCThreeBodyCorrelationFunctionParameters::totalToFree().
T& Array1D< T >::operator[] | ( | int | i | ) | [inline] |
void Array1D< T >::printArray1D | ( | ostream & | strm, | |
int | numSigFig, | |||
int | columnSpace, | |||
int | maxI, | |||
char | sep, | |||
bool | sci | |||
) | const [inline] |
This makes it easier to print out the Array1D for input into Mathematica.
In Mathematica, you will still have to replace all the scientific notational "e" with "*^".
Definition at line 625 of file Array1D.h.
Referenced by QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix().
int Array1D< T >::read | ( | istream & | strm, | |
T | initialization, | |||
string | label | |||
) | [inline] |
This function assumes that the Array1D was initialized to the expected number of parameters.
This function will read into Array1D a set of parameters, separated by whitespace. It will read in as many numbers as it can until it runs into a letter [a-zA-Z]. At that point, if too many parameters were entered, it will print a warning, using 'label' to help the user find the problem.
If too few parameters were entered, then it will initialize the rest to the provided initialization value.
strm | the input stream where the parameters are ready to be read | |
initialization | the value to use to fill in missing entries | |
label | printed with the warning for loading too many variables |
Definition at line 664 of file Array1D.h.
Referenced by QMCThreeBodyCorrelationFunctionParameters::read(), and QMCCorrelationFunctionParameters::read().
ostream& operator<< | ( | ostream & | strm, | |
const Array1D< T > & | rhs | |||
) | [friend] |
Number of elements in the array's first dimension.
Definition at line 40 of file Array1D.h.
Referenced by Array1D< QMCProperty >::allocate(), Array1D< QMCProperty >::Array1D(), Array1D< QMCProperty >::cross(), Array1D< QMCProperty >::deallocate(), Array1D< QMCProperty >::dim1(), Array1D< QMCProperty >::get(), Array1D< QMCProperty >::mag(), Array1D< QMCProperty >::operator()(), Array1D< QMCProperty >::operator*(), Array1D< QMCProperty >::operator*=(), Array1D< QMCProperty >::operator+(), Array1D< QMCProperty >::operator+=(), Array1D< QMCProperty >::operator-(), Array1D< QMCProperty >::operator=(), Array1D< QMCProperty >::operator[](), Array1D< QMCProperty >::printArray1D(), Array1D< QMCProperty >::quaternion_conjugate(), Array1D< QMCProperty >::quaternion_product(), Array1D< QMCProperty >::read(), Array1D< QMCProperty >::rotate(), Array1D< QMCProperty >::rotateQ(), and Array1D< QMCProperty >::size().
Array containing the data.
Definition at line 46 of file Array1D.h.
Referenced by Array1D< QMCProperty >::allocate(), Array1D< QMCProperty >::array(), Array1D< QMCProperty >::Array1D(), Array1D< QMCProperty >::cross(), Array1D< QMCProperty >::deallocate(), Array1D< QMCProperty >::get(), Array1D< QMCProperty >::mag(), Array1D< QMCProperty >::operator()(), Array1D< QMCProperty >::operator*(), Array1D< QMCProperty >::operator*=(), Array1D< QMCProperty >::operator+(), Array1D< QMCProperty >::operator+=(), Array1D< QMCProperty >::operator-(), Array1D< QMCProperty >::operator=(), Array1D< QMCProperty >::operator[](), Array1D< QMCProperty >::printArray1D(), Array1D< QMCProperty >::quaternion_conjugate(), Array1D< QMCProperty >::quaternion_product(), Array1D< QMCProperty >::read(), Array1D< QMCProperty >::rotate(), and Array1D< QMCProperty >::rotateQ().