7#ifndef IMPCORE_HARMONIC_UPPER_BOUND_H
8#define IMPCORE_HARMONIC_UPPER_BOUND_H
10#include <IMP/core/core_config.h>
12#include <cereal/access.hpp>
13#include <cereal/types/base_class.hpp>
15IMPCORE_BEGIN_NAMESPACE
23 friend class cereal::access;
24 template<
class Archive>
void serialize(Archive &ar) {
25 ar(cereal::base_class<Harmonic>(
this));
32 virtual double evaluate(
double feature)
const override {
Upper bound harmonic function (non-zero when feature > mean).
virtual double evaluate(double feature) const override
Calculate score with respect to the given feature.
virtual DerivativePair evaluate_with_derivative(double feature) const override
Calculate score and derivative with respect to the given feature.
HarmonicUpperBound(Float mean, Float k)
Float get_mean() const
Return the mean of this function.
Harmonic(Float mean, Float k)
virtual double evaluate(double feature) const override
Calculate score with respect to the given feature.
virtual DerivativePair evaluate_with_derivative(double feature) const override
Calculate score and derivative with respect to the given feature.
double Float
Basic floating-point value (could be float, double...).
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.