Loading...
Searching...
No Matches
DistViolationContrib.h
Go to the documentation of this file.
//
// Copyright (C) 2004-2006 Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef __RD_DISTVIOLATIONCONTRIB_H__
#define __RD_DISTVIOLATIONCONTRIB_H__
#include <ForceField/Contrib.h>
namespace DistGeom {
//! DEPRECATED: use DistViolationContribs instead
//! A term to capture the violation of the upper and lower bounds by
//! distance between two points
class RDKIT_DISTGEOMETRY_EXPORT DistViolationContrib
: public ForceFields::ForceFieldContrib {
public:
DistViolationContrib() {}
//! Constructor
/*!
\param owner pointer to the owning ForceField
\param idx1 index of end1 in the ForceField's positions
\param idx2 index of end2 in the ForceField's positions
\param ub Upper bound on the distance
\param lb Lower bound on the distance
\param weight optional weight for this contribution
*/
DistViolationContrib(ForceFields::ForceField *owner, unsigned int idx1,
unsigned int idx2, double ub, double lb,
double weight = 1.0);
double getEnergy(double *pos) const override;
void getGrad(double *pos, double *grad) const override;
DistViolationContrib *copy() const override {
return new DistViolationContrib(*this);
}
private:
unsigned int d_end1Idx{0}, d_end2Idx{0}; //!< indices of end points
double d_ub{
1000.0}; //!< upper bound on the distance between d_end1Idx, d_end2Idx
double d_lb{
0.0}; //!< lower bound on the distance between d_end1Idx, d_end2Idx
double d_weight{1.0}; //!< used to adjust relative contribution weights
};
} // namespace DistGeom
#endif
Contrib.h
DistGeom::DistViolationContrib
Definition DistViolationContrib.h:21
DistGeom::DistViolationContrib::getEnergy
double getEnergy(double *pos) const override
returns our contribution to the energy of a position
DistGeom::DistViolationContrib::copy
DistViolationContrib * copy() const override
return a copy
Definition DistViolationContrib.h:41
DistGeom::DistViolationContrib::DistViolationContrib
DistViolationContrib()
Definition DistViolationContrib.h:23
DistGeom::DistViolationContrib::DistViolationContrib
DistViolationContrib(ForceFields::ForceField *owner, unsigned int idx1, unsigned int idx2, double ub, double lb, double weight=1.0)
Constructor.
DistGeom::DistViolationContrib::getGrad
void getGrad(double *pos, double *grad) const override
calculates our contribution to the gradients of a position
ForceFields::ForceFieldContrib
abstract base class for contributions to ForceFields
Definition Contrib.h:18
ForceFields::ForceField
A class to store forcefields and handle minimization.
Definition ForceField.h:79
export.h
RDKIT_DISTGEOMETRY_EXPORT
#define RDKIT_DISTGEOMETRY_EXPORT
Definition export.h:129
DistGeom
Definition BoundsMatrix.h:20