8 #ifndef IMPSCORE_FUNCTOR_SHIFT_H
9 #define IMPSCORE_FUNCTOR_SHIFT_H
11 #include <IMP/score_functor/score_functor_config.h>
15 IMPSCOREFUNCTOR_BEGIN_NAMESPACE
20 template <
class BaseDistanceScore>
21 class Shift:
public BaseDistanceScore {
22 typedef BaseDistanceScore P;
25 Shift(
double x0, BaseDistanceScore base): P(base),
27 template <
unsigned int D>
29 double distance)
const {
30 return P::get_score(m,pi, distance-x0_);
32 template <
unsigned int D>
35 double distance)
const {
36 return P::get_score_and_derivative(m, p, distance-x0_);
38 template <
unsigned int D>
39 double get_maximum_range(
Model *m,
41 return P::get_maximum_range(m, pi)-x0_;
43 bool get_is_trivially_zero(
Model *m,
const ParticleIndexPair& pi,
44 double squared_distance)
const {
45 return squared_distance
46 > algebra::get_squared(P::get_maximum_range(m,pi)+x0_);
50 IMPSCOREFUNCTOR_END_NAMESPACE