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>
41 "SphereDistancePairScore%1%"),
54 HarmonicUpperBoundSphereDistanceScore,
56 std::string name =
"HarmonicUpperBoundSphereDistancePairScore%1%"),
75 double get_rest_length()
const {
return x0_; }
76 double get_stiffness()
const {
return k_; }
100 HarmonicSphereDistanceScore,
101 (
double x0,
double k,
103 "HarmonicSphereDistancePairScore%1%"),
108 inline double HarmonicUpperBoundSphereDiameterPairScore::evaluate_index(
112 m->get_sphere(p[0]).get_center() - m->get_sphere(p[1]).get_center();
113 static const double MIN_DISTANCE = .00001;
114 double distance = delta.get_magnitude();
115 double shifted_distance = distance - x0_ + m->get_sphere(p[0]).get_radius() +
116 m->get_sphere(p[1]).get_radius();
117 if (shifted_distance < 0)
return 0;
118 double score = .5 * k_ * square(shifted_distance);
119 if (da && distance > MIN_DISTANCE) {
120 double deriv = k_ * shifted_distance;
122 m->add_to_coordinate_derivatives(p[0], uv * deriv, *da);
123 m->add_to_coordinate_derivatives(p[1], -uv * deriv, *da);
186 std::string name =
"SoftSpherePairScore%1%"),
189 IMPCORE_END_NAMESPACE
Various important macros for implementing decorators.
Abstract class for scoring object(s) of type ParticleIndexPair.
A harmonic upper bound on the distance between two spheres.
Key< 0 > FloatKey
The type used to identify float attributes in the Particles.
A Score on the distance between a pair of particles.
#define IMP_PAIR_SCORE_METHODS(Name)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#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.
A harmonic score on the positive directed distance between a pair of particles. The score equals zero...
A more IMP-like version of the std::vector.
Class for storing model, its restraints, constraints, and particles.
A harmonic score on the directed distance between a pair of particles, centered at 0...
A smart pointer to a ref-counted Object that is a class member.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
A harmonic score on the negative directed distance between a pair of particles. The score equals zero...
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 lists of object pointers.
Decorator for a sphere-like particle.
A score on the normalized distance between the surfaces of two spheres.
Abstract single variable functor class for score functions.
virtual double evaluate_index(Model *m, const ParticleIndexPair &vt, DerivativeAccumulator *da) const =0
Compute the score and the derivative if needed.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.