7 #ifndef IMPCORE_TRUNCATED_HARMONIC_H
8 #define IMPCORE_TRUNCATED_HARMONIC_H
10 #include <IMP/core/core_config.h>
11 #include "internal/truncated_harmonic.h"
16 IMPCORE_BEGIN_NAMESPACE
18 enum BoundDirection {LOWER, BOTH, UPPER};
38 template <
int DIRECTION>
54 d_(center, k, threshold, limit){
59 d_(center, k, threshold, k*square(threshold-center)){
64 ((DIRECTION == LOWER && (feature > d_.c_))
65 || (DIRECTION == UPPER && (feature < d_.c_)))?
66 0: d_.evaluate_with_derivative(feature).second);
68 virtual double evaluate(
double feature)
const IMP_OVERRIDE {
69 return ((DIRECTION == LOWER && (feature > d_.c_))
70 || (DIRECTION == UPPER && (feature < d_.c_)))?
71 0: d_.evaluate(feature);
75 internal::TruncatedHarmonicData d_;