7 #ifndef IMPCORE_COSINE_H
8 #define IMPCORE_COSINE_H
10 #include <IMP/core/core_config.h>
12 #include <cereal/access.hpp>
13 #include <cereal/types/base_class.hpp>
14 #include <cereal/types/polymorphic.hpp>
16 IMPCORE_BEGIN_NAMESPACE
33 : force_constant_(force_constant),
34 periodicity_(periodicity),
40 double feature)
const override;
42 virtual double evaluate(
double feature)
const override;
46 void do_show(std::ostream &out)
const;
49 Float force_constant_;
53 friend class cereal::access;
55 template<
class Archive>
void serialize(Archive &ar) {
56 ar(cereal::base_class<UnaryFunction>(
this),
57 force_constant_, periodicity_, phase_);
virtual double evaluate(double feature) const
Calculate score with respect to the given feature.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Single variable function.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
virtual DerivativePair evaluate_with_derivative(double feature) const
Calculate score and derivative with respect to the given feature.
double Float
Basic floating-point value (could be float, double...)
Cosine(Float force_constant, int periodicity, Float phase)
Constructor.
Abstract single variable functor class for score functions.