8 #ifndef IMPSCORE_FUNCTOR_POINT_TO_SPHERE_DISTANCE_H
9 #define IMPSCORE_FUNCTOR_POINT_TO_SPHERE_DISTANCE_H
11 #include <IMP/score_functor/score_functor_config.h>
16 IMPSCOREFUNCTOR_BEGIN_NAMESPACE
26 template <
class BaseDistanceScore>
28 typedef BaseDistanceScore P;
30 return m->get_sphere(pi).get_radius();
36 double distance)
const {
37 return P::get_score(m, pi, distance - get_radius(m, pi[1]));
41 double distance)
const {
42 return P::get_score_and_derivative(m, pi, distance - get_radius(m, pi[1]));
44 double get_maximum_range(
Model *m,
46 return P::get_maximum_range(m, pi) + get_radius(m, pi[1]);
48 bool get_is_trivially_zero(
Model *m,
50 double squared_distance)
const {
51 return squared_distance >
52 algebra::get_squared(P::get_maximum_range(m, pi) +
53 get_radius(m, pi[1]));
57 IMPSCOREFUNCTOR_END_NAMESPACE
Storage of a model, its restraints, constraints and particles.
Class for storing model, its restraints, constraints, and particles.
Functions to deal with very common math operations.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
Helper macros for throwing and handling exceptions.