7 #ifndef IMPCORE_HARMONIC_H
8 #define IMPCORE_HARMONIC_H
10 #include <IMP/core/core_config.h>
15 IMPCORE_BEGIN_NAMESPACE
32 k_ * (feature - mean_));
35 virtual double evaluate(
double feature)
const {
36 return 0.5 * k_ * square(feature - mean_);
65 const static Float R = 8.31441 / 4186.8;
66 return R * t / square(sd);
Import IMP/kernel/UnaryFunction.h in the namespace.
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.
Abstract single variable functor class for score functions.
static Float get_k_from_standard_deviation(Float sd, Float t=297.15)
Return the k to use for a given Gaussian standard deviation.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Import IMP/kernel/utility.h in the namespace.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
Import IMP/kernel/unary_function_macros.h in the namespace.
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.
Harmonic function (symmetric about the mean)