 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef __RD_FORCEFIELD_H__
12 #define __RD_FORCEFIELD_H__
15 #include <boost/smart_ptr.hpp>
16 #include <boost/foreach.hpp>
21 namespace ForceFieldsHelper {
24 unsigned int idx2,
unsigned int idx3,
unsigned int idx4,
25 double *dihedral = NULL,
double *cosPhi = NULL,
29 unsigned int idx2,
unsigned int idx3,
unsigned int idx4,
30 double *dihedral = NULL,
double *cosPhi = NULL,
35 double *dihedral = NULL,
double *cosPhi = NULL,
44 typedef boost::shared_ptr<const ForceFieldContrib>
ContribPtr;
83 : d_dimension(dimension), df_init(false), d_numPoints(0), dp_distMat(0){};
104 double calcEnergy(std::vector<double> *contribs = NULL)
const;
119 double calcEnergy(
double *pos);
130 void calcGrad(
double *forces)
const;
141 void calcGrad(
double *pos,
double *forces);
155 unsigned int maxIts = 200,
double forceTol = 1e-4,
156 double energyTol = 1e-6);
175 int minimize(
unsigned int maxIts = 200,
double forceTol = 1e-4,
176 double energyTol = 1e-6);
203 double distance(
unsigned int i,
unsigned int j,
double *pos = 0);
218 double distance(
unsigned int i,
unsigned int j,
double *pos = 0)
const;
230 unsigned int d_dimension;
237 unsigned int d_matSize = 0;
242 void scatter(
double *pos)
const;
248 void gather(
double *pos);
251 void initDistanceMatrix();
std::vector< ContribPtr > ContribPtrVect
const ContribPtrVect & contribs() const
boost::shared_ptr< const ForceFieldContrib > ContribPtr
unsigned int dimension() const
returns the dimension of the forcefield
ContribPtrVect d_contribs
contributions to the energy
A class to store forcefields and handle minimization.
unsigned int numPoints() const
returns the number of points the ForceField is handling
void RDKIT_FORCEFIELD_EXPORT computeDihedral(const RDGeom::PointPtrVect &pos, unsigned int idx1, unsigned int idx2, unsigned int idx3, unsigned int idx4, double *dihedral=NULL, double *cosPhi=NULL, RDGeom::Point3D r[4]=NULL, RDGeom::Point3D t[2]=NULL, double d[2]=NULL)
RDGeom::PointPtrVect d_positions
pointers to the points we're using
abstract base class for contributions to ForceFields
ContribPtrVect & contribs()
returns a reference to our contribs (a ContribPtrVect)
RDGeom::PointPtrVect & positions()
returns a reference to our points (a PointPtrVect)
double * dp_distMat
our internal distance matrix
#define RDKIT_FORCEFIELD_EXPORT
const INT_VECT & fixedPoints() const
std::vector< int > INT_VECT
std::vector< Snapshot > SnapshotVect
ForceField(unsigned int dimension=3)
construct with a dimension
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
void RDKIT_FORCEFIELD_EXPORT normalizeAngleDeg(double &angleDeg)
unsigned int d_numPoints
the number of active points
const RDGeom::PointPtrVect & positions() const
std::vector< RDGeom::Point * > PointPtrVect