10void ErfcBuf::reset(std::vector<Atom>
const& atoms,
size_t const valuesPerPair)
12 f.resize(atoms.size());
13 for(
size_t i = 0; i < atoms.size(); ++i)
15 f[i].resize(atoms[i].numNeighbors * valuesPerPair);
16 fill(
f[i].begin(),
f[i].end(), -1.0);
22 const size_t neighIndex,
23 const size_t valIndex,
27 if (
f.at(atomIndex).at(j) == -1.0)
29 f[atomIndex][j] = erfc(x);
31 return f[atomIndex][j];
std::vector< std::vector< double > > f
2d vector to store already calculated results.
size_t numValuesPerPair
Typically one needs erfc(a_i * rij), where the number of a_i's correspond to numValuesPerPair.
double getf(size_t const atomIndex, size_t const neighIndex, size_t const valIndex, double const x)
Either returns already stored value erfc(x) or calculates it if not yet stored.