11 #ifndef __RD_FORCEFIELD_H__ 12 #define __RD_FORCEFIELD_H__ 15 #include <boost/smart_ptr.hpp> 16 #include <boost/foreach.hpp> 23 typedef boost::shared_ptr<const ForceFieldContrib>
ContribPtr;
62 : d_dimension(dimension), df_init(false), d_numPoints(0), dp_distMat(0){};
83 double calcEnergy(std::vector<double> *contribs = NULL)
const;
98 double calcEnergy(
double *pos);
109 void calcGrad(
double *forces)
const;
120 void calcGrad(
double *pos,
double *forces);
134 unsigned int maxIts = 200,
double forceTol = 1e-4,
135 double energyTol = 1e-6);
154 int minimize(
unsigned int maxIts = 200,
double forceTol = 1e-4,
155 double energyTol = 1e-6);
166 const ContribPtrVect &
contribs()
const {
return d_contribs; };
182 double distance(
unsigned int i,
unsigned int j,
double *pos = 0);
197 double distance(
unsigned int i,
unsigned int j,
double *pos = 0)
const;
209 unsigned int d_dimension;
221 void scatter(
double *pos)
const;
227 void gather(
double *pos);
230 void initDistanceMatrix();
unsigned int numPoints() const
returns the number of points the ForceField is handling
const ContribPtrVect & contribs() const
boost::shared_ptr< const ForceFieldContrib > ContribPtr
ContribPtrVect & contribs()
returns a reference to our contribs (a ContribPtrVect)
RDGeom::PointPtrVect d_positions
pointers to the points we're using
unsigned int dimension() const
returns the dimension of the forcefield
std::vector< RDGeom::Point * > PointPtrVect
ContribPtrVect d_contribs
contributions to the energy
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
abstract base class for contributions to ForceFields
std::vector< int > INT_VECT
ForceField(unsigned int dimension=3)
construct with a dimension
#define RDKIT_FORCEFIELD_EXPORT
std::vector< Snapshot > SnapshotVect
int minimize(unsigned int dim, double *pos, double gradTol, unsigned int &numIters, double &funcVal, EnergyFunctor func, GradientFunctor gradFunc, unsigned int snapshotFreq, RDKit::SnapshotVect *snapshotVect, double funcTol=TOLX, unsigned int maxIts=MAXITS)
Do a BFGS minimization of a function.
bool df_init
whether or not we've been initialized
const RDGeom::PointPtrVect & positions() const
double * dp_distMat
our internal distance matrix
A class to store forcefields and handle minimization.
const INT_VECT & fixedPoints() const
unsigned int d_numPoints
the number of active points
std::vector< ContribPtr > ContribPtrVect