7 #ifndef IMPCORE_HARMONIC_H
8 #define IMPCORE_HARMONIC_H
10 #include <IMP/core/core_config.h>
14 IMPCORE_BEGIN_NAMESPACE
31 k_ * (feature - mean_));
34 virtual double evaluate(
double feature)
const {
35 return 0.5 * k_ * square(feature - mean_);
64 const static Float R = 8.31441 / 4186.8;
65 return R * t / square(sd);
Float get_k() const
Return the spring constant.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Single variable function.
void set_k(Float k)
Set the spring constant.
virtual double evaluate(double feature) const
Calculate score with respect to the given feature.
void set_mean(Float mean)
Set the mean of this function.
static Float get_k_from_standard_deviation(Float sd, Float t=297.15)
Return the k to use for a given Gaussian standard deviation.
For backwards compatibility.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
Float get_mean() const
Return the mean of this function.
double Float
Basic floating-point value (could be float, double...)
Harmonic(Float mean, Float k)
virtual DerivativePair evaluate_with_derivative(double feature) const
Calculate score and derivative with respect to the given feature.
Abstract single variable functor class for score functions.
Harmonic function (symmetric about the mean)