![]() |
QMCPACK
|
Custom container for set of attributes for a set of species. More...
Public Types | |
using | Scalar_t = double |
using | SpeciesAttrib_t = std::vector< Scalar_t > |
using | AttribList_t = std::vector< SpeciesAttrib_t > |
Public Member Functions | |
int | size () const |
return the number of species More... | |
int | getTotalNum () const |
return the number of species More... | |
void | setTotalNum (const unsigned n) |
set the number of species More... | |
int | numAttributes () const |
return the number of attributes in our list More... | |
int | addSpecies (const std::string &aname) |
When a name species does not exist, add a new species. More... | |
int | addAttribute (const std::string &aname) |
for a new attribute, allocate the data, !More often used to get the index of a species More... | |
int | getAttribute (const std::string &aname) const |
When a name species does not exist, return attribute.size() More... | |
bool | hasAttribute (const std::string &aname) const |
Check for attribute presence This replaces code that gets numAttributes then tries to addAttribute for a particular name and compares the numAttributes and index of the new Attribute. More... | |
double | operator() (int i, int j) const |
double & | operator() (int i, int j) |
assignment operator More... | |
void | create (unsigned m) |
int | findSpecies (const std::string &name) const |
if the input species is not found, add a new species More... | |
int | findAttribute (const std::string &name) const |
almost all code ignores this and just uses addAttribute for the same purpose. More... | |
int | findIndex (const std::string &name, const std::vector< std::string > &alist) const |
const std::string & | getSpeciesName (int index) const |
Public Attributes | |
unsigned | TotalNum = 0 |
The number of species. More... | |
std::vector< std::string > | speciesName |
Species name list. More... | |
std::vector< std::string > | attribName |
attribute name list More... | |
AttribList_t | d_attrib |
List of species attributes. More... | |
Custom container for set of attributes for a set of species.
A confusingly equivalent of std::map<std::string, <std::map<std::string, Scalar>> implemented as two sets of key vectors and a single vector of Scalars. It leaks its implementation details i.e. the indexing to the vectors. Reduces readability and increases semantic load. Looks like premature optimization.
Definition at line 33 of file SpeciesSet.h.
using AttribList_t = std::vector<SpeciesAttrib_t> |
Definition at line 38 of file SpeciesSet.h.
using Scalar_t = double |
Definition at line 36 of file SpeciesSet.h.
using SpeciesAttrib_t = std::vector<Scalar_t> |
Definition at line 37 of file SpeciesSet.h.
int addAttribute | ( | const std::string & | aname | ) |
for a new attribute, allocate the data, !More often used to get the index of a species
aname | a unique name of an attribute |
Definition at line 45 of file SpeciesSet.cpp.
References SpeciesSet::attribName, SpeciesSet::d_attrib, qmcplusplus::n, and SpeciesSet::TotalNum.
Referenced by RadialJastrowBuilder::buildComponent(), qmcplusplus::create_C_pbc_particlesets(), qmcplusplus::createElectronParticleSet(), QMCGaussianParserBase::createElectronSet(), ParticleSet::createSK(), qmcplusplus::doSOECPotentialTest(), qmcplusplus::generateCuspInfo(), ForceChiesaPBCAA::initBreakup(), StressPBC::initBreakup(), CoulombPBCAB::initBreakup(), QMCGaussianParserBase::QMCGaussianParserBase(), ParticleSet::resetGroups(), EnergyDensityEstimator::set_ptcl(), QMCUpdateBase::setDefaults(), qmcplusplus::setSpeciesProperty(), qmcplusplus::setup_He_wavefunction(), qmcplusplus::test_cartesian_ao(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_dirac_ao(), qmcplusplus::test_hcpBe_rotation(), qmcplusplus::test_He(), qmcplusplus::test_He_mw(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_J1_spline(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), qmcplusplus::test_Ne(), qmcplusplus::testElecCase(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().
int addSpecies | ( | const std::string & | aname | ) |
When a name species does not exist, add a new species.
aname | Unique name of the species be added. |
Definition at line 33 of file SpeciesSet.cpp.
References SpeciesSet::create(), SpeciesSet::findSpecies(), SpeciesSet::speciesName, and SpeciesSet::TotalNum.
Referenced by qmcplusplus::create_C_pbc_particlesets(), qmcplusplus::createElectronParticleSet(), QMCGaussianParserBase::createElectronSet(), qmcplusplus::doSOECPotentialTest(), qmcplusplus::get_two_species_particleset(), qmcplusplus::setup_He_wavefunction(), qmcplusplus::test_cartesian_ao(), qmcplusplus::TEST_CASE(), qmcplusplus::test_CoulombPBCAA_3p(), qmcplusplus::test_diamond_2x1x1_xml_input(), qmcplusplus::test_dirac_ao(), qmcplusplus::test_hcpBe_rotation(), qmcplusplus::test_He(), qmcplusplus::test_He_mw(), qmcplusplus::test_He_sto3g_xml_input(), qmcplusplus::test_J1_spline(), qmcplusplus::test_J3_polynomial3D(), qmcplusplus::test_LCAO_DiamondC_2x1x1_cplx(), qmcplusplus::test_LCAO_DiamondC_2x1x1_real(), qmcplusplus::test_lcao_spinor(), qmcplusplus::test_lcao_spinor_excited(), qmcplusplus::test_lcao_spinor_ion_derivs(), qmcplusplus::test_LiH_msd(), qmcplusplus::test_LiH_msd_xml_input(), qmcplusplus::test_LiH_msd_xml_input_with_positron(), qmcplusplus::test_Ne(), qmcplusplus::testElecCase(), and qmcplusplus::testTrialWaveFunction_diamondC_2x1x1().
void create | ( | unsigned | m | ) |
m | the number of species to be added |
Definition at line 20 of file SpeciesSet.cpp.
References SpeciesSet::d_attrib, qmcplusplus::Units::distance::m, SpeciesSet::speciesName, and SpeciesSet::TotalNum.
Referenced by SpeciesSet::addSpecies().
|
inline |
almost all code ignores this and just uses addAttribute for the same purpose.
Definition at line 128 of file SpeciesSet.h.
References SpeciesSet::attribName, and SpeciesSet::findIndex().
Referenced by SpinDensityNew::getSpeciesSize(), and EinsplineSetBuilder::ReadOrbitalInfo_ESHDF().
|
inline |
Definition at line 130 of file SpeciesSet.h.
Referenced by SpeciesSet::findAttribute().
|
inline |
if the input species is not found, add a new species
name | a name of species |
Definition at line 114 of file SpeciesSet.h.
References SpeciesSet::speciesName.
Referenced by BackflowBuilder::addOneBody(), SpeciesSet::addSpecies(), LCAOrbitalBuilder::createBasisSet(), LCAOrbitalBuilder::createBasisSetH5(), RadialJastrowBuilder::createJ1(), LatticeDeviationEstimator::LatticeDeviationEstimator(), SlaterDetBuilder::putDeterminant(), eeI_JastrowBuilder::putkids(), and ECPotentialBuilder::useXmlFormat().
int getAttribute | ( | const std::string & | aname | ) | const |
When a name species does not exist, return attribute.size()
aname | Unique name of the species to be looked up. |
Definition at line 60 of file SpeciesSet.cpp.
References SpeciesSet::attribName.
Referenced by StressPBC::evalConsts_AA(), StressPBC::evaluateLR_AA(), OneBodyDensityMatrices::OneBodyDensityMatrices(), and SpeciesKineticEnergy::SpeciesKineticEnergy().
|
inline |
Definition at line 142 of file SpeciesSet.h.
References SpeciesSet::speciesName.
Referenced by XMLParticleParser::checkGrouping().
|
inline |
return the number of species
Definition at line 55 of file SpeciesSet.h.
References SpeciesSet::TotalNum.
Referenced by BackflowBuilder::addOneBody(), QMCGaussianParserBase::createIonSet(), RadialJastrowBuilder::createJ1(), XMLSaveParticle::createNode(), ParticleSet::createSK(), JeeIOrbitalSoA< FT >::init(), J1OrbitalSoA< FT >::initialize(), L2Potential::L2Potential(), LocalECPotential::LocalECPotential(), NonLocalECPotential::NonLocalECPotential(), ECPotentialBuilder::put(), ParticleSet::resetGroups(), SkAllEstimator::SkAllEstimator(), SkEstimator::SkEstimator(), SkPot::SkPot(), SoaLocalizedBasisSet< COT, ORBT >::SoaLocalizedBasisSet(), and SOECPotential::SOECPotential().
bool hasAttribute | ( | const std::string & | aname | ) | const |
Check for attribute presence This replaces code that gets numAttributes then tries to addAttribute for a particular name and compares the numAttributes and index of the new Attribute.
aname | Unique name of the species to be looked up. |
Definition at line 70 of file SpeciesSet.cpp.
References SpeciesSet::attribName.
Referenced by OneBodyDensityMatrices::OneBodyDensityMatrices().
|
inline |
return the number of attributes in our list
Definition at line 59 of file SpeciesSet.h.
References SpeciesSet::d_attrib.
Referenced by ParticleSet::createSK(), DensityMatrices1B::initialize(), and ParticleSet::resetGroups().
|
inline |
i | attribute index |
j | species index |
Definition at line 94 of file SpeciesSet.h.
References SpeciesSet::d_attrib.
|
inline |
assignment operator
i | attribute index |
j | species index |
Definition at line 102 of file SpeciesSet.h.
References SpeciesSet::d_attrib.
|
inline |
set the number of species
Definition at line 57 of file SpeciesSet.h.
References qmcplusplus::n, and SpeciesSet::TotalNum.
|
inline |
return the number of species
Definition at line 53 of file SpeciesSet.h.
References SpeciesSet::TotalNum.
Referenced by SpinDensityNew::accumulate(), OneBodyDensityMatrices::evaluateMatrix(), OneBodyDensityMatrices::generateParticleBasis(), OneBodyDensityMatrices::generateSampleRatios(), SpinDensityNew::getFullDataSize(), SpinDensityNew::getSpeciesSize(), DensityMatrices1B::initialize(), OneBodyDensityMatrices::OneBodyDensityMatrices(), PairCorrEstimator::PairCorrEstimator(), SlaterDetBuilder::putDeterminant(), eeI_JastrowBuilder::putkids(), SpinDensityNew::registerOperatorEstimator(), OneBodyDensityMatrices::registerOperatorEstimator(), SpinDensityNew::report(), SpinDensity::SpinDensity(), and StaticStructureFactor::StaticStructureFactor().
std::vector<std::string> attribName |
attribute name list
Definition at line 47 of file SpeciesSet.h.
Referenced by SpeciesSet::addAttribute(), SpeciesSet::findAttribute(), SpeciesSet::getAttribute(), and SpeciesSet::hasAttribute().
AttribList_t d_attrib |
List of species attributes.
Definition at line 50 of file SpeciesSet.h.
Referenced by SpeciesSet::addAttribute(), SpeciesSet::create(), SpeciesSet::numAttributes(), and SpeciesSet::operator()().
std::vector<std::string> speciesName |
Species name list.
Definition at line 44 of file SpeciesSet.h.
Referenced by SpeciesSet::addSpecies(), SpeciesSet::create(), XMLSaveParticle::createNode(), LatticeDeviationEstimator::evaluate(), SpeciesSet::findSpecies(), SpeciesSet::getSpeciesName(), DensityMatrices1B::initialize(), OneBodyDensityMatrices::OneBodyDensityMatrices(), ParticleSet::print(), SlaterDetBuilder::putDeterminant(), SpinDensityNew::registerOperatorEstimator(), OneBodyDensityMatrices::registerOperatorEstimator(), SpinDensityNew::report(), XMLSaveParticle::reset(), ParticleSet::species_from_index(), SpinDensity::SpinDensity(), and StaticStructureFactor::StaticStructureFactor().
unsigned TotalNum = 0 |
The number of species.
Definition at line 41 of file SpeciesSet.h.
Referenced by SpeciesSet::addAttribute(), SpeciesSet::addSpecies(), SpeciesSet::create(), StressPBC::evalConsts_AA(), StressPBC::evaluateLR_AA(), SpeciesSet::getTotalNum(), SpeciesSet::setTotalNum(), and SpeciesSet::size().