RDKit
Open-source cheminformatics and machine learning.
ChiralViolationContrib.h
Go to the documentation of this file.
1 //
2 // Created by Santosh Putta, Nov 2006
3 //
4 #ifndef __RD_CHIRALVIOLATIONCONTRIB_H__
5 #define __RD_CHIRALVIOLATIONCONTRIB_H__
6 
7 #include <ForceField/Contrib.h>
8 
9 namespace DistGeom {
10  class ChiralSet;
11 
12  //! A term to capture the violation of chirality at an atom center
13  //!
15  public:
16  ChiralViolationContrib() : d_idx1(0), d_idx2(0), d_idx3(0), d_idx4(0),
17  d_volLower(0.0), d_volUpper(0.0), d_weight(0.0){};
18 
19  //! Constructor
20  /*!
21  \param owner pointer to the owning forcefield
22  \param cset a chiral set containing the four chiral atom ids (in sequence)
23  and the upper and lower limits on the signed chiral volume
24  \param weight (optional) the weight to be used for this contrib
25 
26  */
27  ChiralViolationContrib(ForceFields::ForceField *owner, const ChiralSet *cset, double weight=1.0);
28 
29  //! return the contribution of this contrib to the energy of a given state
30  double getEnergy(double *pos) const;
31 
32  //! calculate the contribution of this contrib to the gradient at a given state
33  void getGrad(double *pos, double *grad) const;
34  virtual ChiralViolationContrib *copy() const { return new ChiralViolationContrib(*this); };
35 
36  private:
37  unsigned int d_idx1, d_idx2, d_idx3, d_idx4;
38  double d_volLower;
39  double d_volUpper;
40  double d_weight;
41  };
42 }
43 
44 #endif
double getEnergy(double *pos) const
return the contribution of this contrib to the energy of a given state
abstract base class for contributions to ForceFields
Definition: Contrib.h:17
void getGrad(double *pos, double *grad) const
calculate the contribution of this contrib to the gradient at a given state
Class used to store a quartet of points and chiral volume bounds on them.
Definition: ChiralSet.h:22
A class to store forcefields and handle minimization.
Definition: ForceField.h:56
virtual ChiralViolationContrib * copy() const
return a copy