11#ifndef RD_DISTVIOLATIONCONTRIBS_H
12#define RD_DISTVIOLATIONCONTRIBS_H
26 double l,
double w = 1.0)
44 void getGrad(
double *pos,
double *grad)
const override;
49 void addContrib(
unsigned int idx1,
unsigned int idx2,
double ub,
double lb,
50 double weight = 1.0) {
51 d_contribs.emplace_back(idx1, idx2, ub, lb, weight);
53 bool empty()
const {
return d_contribs.empty(); }
54 unsigned int size()
const {
return d_contribs.size(); }
57 std::vector<DistViolationContribsParams> d_contribs;
void addContrib(unsigned int idx1, unsigned int idx2, double ub, double lb, double weight=1.0)
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
unsigned int size() const
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
DistViolationContribs * copy() const override
return a copy
DistViolationContribs()=default
DistViolationContribs(ForceFields::ForceField *owner)
Constructor.
abstract base class for contributions to ForceFields
A class to store forcefields and handle minimization.
#define RDKIT_DISTGEOMETRY_EXPORT
double weight
used to adjust relative contribution weights
double lb
lower bound on the distance
double ub
upper bound on the distance
unsigned int idx1
index of end1 in the ForceField's positions
unsigned int idx2
index of end2 in the ForceField's positions
DistViolationContribsParams(unsigned int i1, unsigned int i2, double u, double l, double w=1.0)