8#ifndef IMPSCORE_FUNCTOR_SCORE_UNARY_FUNCTION_H
9#define IMPSCORE_FUNCTOR_SCORE_UNARY_FUNCTION_H
11#include <IMP/score_functor/score_functor_config.h>
15IMPSCOREFUNCTOR_BEGIN_NAMESPACE
19template <
class Score,
int D = 2>
24 ScoreUnaryFunction(
const Score &score, std::string name =
"UnaryFunction%1%")
25 : UnaryFunction(name), score_(score) {}
29 return score_.get_score_and_derivative(
33 virtual double evaluate(
double feature)
const override {
39 const Score &get_score()
const {
return score_; }
45IMPSCOREFUNCTOR_END_NAMESPACE
A Score on the distance between a pair of particles.
Single variable function.
A class to store a fixed array of same-typed values.
Abstract single variable functor class for score functions.
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.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
Helper macros for implementing IMP Objects.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A functor for computing a distance based score for D particles.