8 #ifndef IMPSCORE_FUNCTOR_SPHERE_DISTANCE_H
9 #define IMPSCORE_FUNCTOR_SPHERE_DISTANCE_H
11 #include <IMP/score_functor/score_functor_config.h>
16 IMPSCOREFUNCTOR_BEGIN_NAMESPACE
20 template <
class BaseDistanceScore>
26 typedef BaseDistanceScore P;
29 return m->get_sphere(pi[0]).get_radius() +
30 m->get_sphere(pi[1]).get_radius();
36 double distance)
const {
37 return P::get_score(m, pi, distance - get_rsum(m, pi));
41 double distance)
const {
42 return P::get_score_and_derivative(m, pi, distance - get_rsum(m, pi));
46 return P::get_maximum_range(m, pi) + get_rsum(m, pi);
50 double squared_distance)
const {
51 return squared_distance >
52 algebra::get_squared(P::get_maximum_range(m, pi) + get_rsum(m, pi));
56 IMPSCOREFUNCTOR_END_NAMESPACE
A class to store an fixed array of same-typed values.
Functions to deal with very common math operations.
Storage of a model, its restraints, constraints and particles.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
Exception definitions and assertions.
Class for storing model, its restraints, constraints, and particles.