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;
27 static double get_rsum(
Model *m,
28 const ParticleIndexPair &pi) {
29 return m->get_sphere(pi[0]).get_radius()
30 + m->get_sphere(pi[1]).get_radius();
35 double get_score(
Model *m,
const ParticleIndexPair& pi,
36 double distance)
const {
37 return P::get_score(m, pi, distance-get_rsum(m, pi));
40 double distance)
const {
41 return P::get_score_and_derivative(m, pi, distance-get_rsum(m, pi));
43 double get_maximum_range(
Model *m,
const ParticleIndexPair& pi)
const {
44 return P::get_maximum_range(m, pi) + get_rsum(m, pi);
46 bool get_is_trivially_zero(
Model *m,
const ParticleIndexPair& pi,
47 double squared_distance)
const {
48 return squared_distance
49 > algebra::get_squared(P::get_maximum_range(m, pi) + get_rsum(m, pi));
53 IMPSCOREFUNCTOR_END_NAMESPACE