8 #ifndef IMPCORE_SPHERE_DISTANCE_PAIR_SCORE_H
9 #define IMPCORE_SPHERE_DISTANCE_PAIR_SCORE_H
11 #include <IMP/core/core_config.h>
21 IMPCORE_BEGIN_NAMESPACE
25 typedef score_functor::SphereDistance<score_functor::UnaryFunctionEvaluate>
37 "SphereDistancePairScore%1%"),
50 HarmonicUpperBoundSphereDistanceScore,
52 std::string name =
"HarmonicUpperBoundSphereDistancePairScore%1%"),
71 double get_rest_length()
const {
return x0_; }
72 double get_stiffness()
const {
return k_; }
93 HarmonicSphereDistanceScore,
96 "HarmonicSphereDistancePairScore%1%"),
101 inline double HarmonicUpperBoundSphereDiameterPairScore::evaluate_index(
105 m->get_sphere(p[0]).get_center() - m->get_sphere(p[1]).get_center();
106 static const double MIN_DISTANCE = .00001;
107 double distance = delta.get_magnitude();
108 double shifted_distance = distance - x0_ + m->get_sphere(p[0]).get_radius() +
109 m->get_sphere(p[1]).get_radius();
110 if (shifted_distance < 0)
return 0;
111 double score = .5 * k_ * square(shifted_distance);
112 if (da && distance > MIN_DISTANCE) {
113 double deriv = k_ * shifted_distance;
115 m->add_to_coordinate_derivatives(p[0], uv * deriv, *da);
116 m->add_to_coordinate_derivatives(p[1], -uv * deriv, *da);
179 std::string name =
"SoftSpherePairScore%1%"),
182 IMPCORE_END_NAMESPACE
Various important macros for implementing decorators.
A harmonic upper bound on the distance between two spheres.
Class for adding derivatives from restraints to the model.
A Score on the distance between a pair of particles.
virtual double evaluate_index(kernel::Model *m, const ParticleIndexPair &vt, DerivativeAccumulator *da) const
Compute the score and the derivative if needed.
A smart pointer to a ref-counted Object that is a class memeber.
IMP::kernel::UnaryFunction UnaryFunction
#define IMP_FUNCTOR_DISTANCE_PAIR_SCORE(Name, Functor, Args, PassArgs)
A Score on the distance between a pair of particles.
A harmonic score on the distance between two spheres.
A harmonic upper bound on the diameter of the span of two spheres.
#define IMP_PAIR_SCORE_METHODS(Name)
A Score on the distance between a pair of particles.
Abstract single variable functor class for score functions.
A class to store an fixed array of same-typed values.
A Score on the distance between a pair of particles.
virtual ModelObjectsTemp do_get_inputs(kernel::Model *m, const ParticleIndexes &pis) const
A Score on the distance between a pair of particles.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A score on a weighted distance between the surfaces of two spheres.
A Score on the distance between a pair of particles.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
Decorator for a sphere-like particle.
A score on the normalized distance between the surfaces of two spheres.
Key< 0, true > FloatKey
The type used to identify float attributes in the Particles.
Class for storing model, its restraints, constraints, and particles.