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
19 template <
class BaseDistanceScore>
20 class Shift :
public BaseDistanceScore {
21 typedef BaseDistanceScore P;
25 Shift(
double x0, BaseDistanceScore base) : P(base), x0_(x0) {}
26 template <
unsigned int D>
27 double get_score(
Model *m,
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(
41 return P::get_maximum_range(m, pi) - x0_;
43 bool get_is_trivially_zero(
Model *m,
45 double squared_distance)
const {
46 return squared_distance >
47 algebra::get_squared(P::get_maximum_range(m, pi) + x0_);
51 IMPSCOREFUNCTOR_END_NAMESPACE
Various general useful functions for IMP.
A class to store an fixed array of same-typed values.
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.