7 #ifndef IMPKERNEL_UNARY_FUNCTION_H
8 #define IMPKERNEL_UNARY_FUNCTION_H
10 #include <IMP/kernel_config.h>
13 #include <cereal/access.hpp>
14 #include <cereal/types/base_class.hpp>
16 IMPKERNEL_BEGIN_NAMESPACE
41 return evaluate(feature);
52 return evaluate_with_derivative(feature);
58 friend class cereal::access;
60 template<
class Archive>
void serialize(Archive &ar) {
61 ar(cereal::base_class<Object>(
this));
67 IMPKERNEL_END_NAMESPACE
virtual double evaluate(double feature) const
Calculate score with respect to the given feature.
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Set up destructor for a ref counted object.
Common base class for heavy weight IMP objects.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
A shared base class to help in debugging and things.
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.