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.
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.