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);
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.
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)