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,
102 std::string name =
"HarmonicSphereDistancePairScore%1%"),
105 double get_x0()
const {
return get_score_functor().get_x0(); }
106 double get_k()
const {
return get_score_functor().get_k(); });
110 inline double HarmonicUpperBoundSphereDiameterPairScore::evaluate_index(
114 m->get_sphere(std::get<0>(p)).get_center()
115 - m->get_sphere(std::get<1>(p)).get_center();
116 static const double MIN_DISTANCE = .00001;
117 double distance = delta.get_magnitude();
118 double shifted_distance
119 = distance - x0_ + m->get_sphere(std::get<0>(p)).get_radius() +
120 m->get_sphere(std::get<1>(p)).get_radius();
121 if (shifted_distance < 0)
return 0;
122 double score = .5 * k_ * square(shifted_distance);
123 if (da && distance > MIN_DISTANCE) {
124 double deriv = k_ * shifted_distance;
126 m->add_to_coordinate_derivatives(std::get<0>(p), uv * deriv, *da);
127 m->add_to_coordinate_derivatives(std::get<1>(p), -uv * deriv, *da);
190 std::string name =
"SoftSpherePairScore%1%"),
193 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.
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_FUNCTOR_DISTANCE_PAIR_SCORE(Name, Functor, Args, PassArgs, Accessors)
#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.
Class for adding derivatives from restraints to the model.