IMP Reference Guide
develop.5651aa123e,2024/07/23
The Integrative Modeling Platform

A function that is harmonic over an bounded interval. More...
#include <IMP/core/TruncatedHarmonic.h>
A function that is harmonic over an bounded interval.
This is a harmonic function of the form $f(x) = 0.5 k (xcenter)^2$ within a bounded interval around a center value, in the bounded interval where $xcenter<threshold$, i.e. up to a threshold offset from the center. Beyond the threshold offset, the function asymptotically converges to the limit value.
[in]  DIRECTION  This template parameter determines whether the function is nonzero only for input values that are greater than the center (UPPER), lower than the center (LOWER), or both (BOTH). In Python code, these choices can be specified using the types TruncatedHarmonicUpperBound, TruncatedHarmonicLowerBound, and TruncatedHarmonic, respectively. 
For example, if the center equals to 5, the threshold to 2, and the direction is BOTH (see below), then the function is harmonic in the interval [3,7], and beyond that interval it converges to the limit value in either direction. If the direction is LOWER, then the function is harmonic in the interval [3,5], it converges to the limit value for values lower thans 3, and is 0 for values higher than 5. If it is UPPER, then the function is harmonic in the interval [5,7], it is 0 for values lower than 5, and it converges to the limit value for values higher than 7.
Definition at line 57 of file TruncatedHarmonic.h.
Public Member Functions  
TruncatedHarmonic (Float center, Float k, Float threshold, Float limit)  
TruncatedHarmonic (Float center, Float k, Float threshold)  
virtual double  evaluate (double feature) const override 
Calculate score with respect to the given feature. More...  
virtual DerivativePair  evaluate_with_derivative (double feature) const override 
Calculate score and derivative with respect to the given feature. More...  
virtual std::string  get_type_name () const override 
virtual ::IMP::VersionInfo  get_version_info () const override 
Get information about the module and version of the object. More...  
Public Member Functions inherited from IMP::UnaryFunction  
UnaryFunction (std::string name="UnaryFunction%1%")  
Public Member Functions inherited from IMP::Object  
virtual void  clear_caches () 
CheckLevel  get_check_level () const 
LogLevel  get_log_level () const 
void  set_check_level (CheckLevel l) 
void  set_log_level (LogLevel l) 
Set the logging level used in this object. More...  
void  set_was_used (bool tf) const 
void  show (std::ostream &out=std::cout) const 
const std::string &  get_name () const 
void  set_name (std::string name) 
Additional Inherited Members  
Protected Member Functions inherited from IMP::Object  
Object (std::string name)  
Construct an object with the given name. More...  
virtual void  do_destroy () 
IMP::core::TruncatedHarmonic< DIRECTION >::TruncatedHarmonic  (  Float  center, 
Float  k,  
Float  threshold,  
Float  limit  
) 
[in]  center  The center point for the truncated harmonic. 
[in]  k  The spring constant for the truncated harmonic. 
[in]  threshold  How far the harmonic term extends from the center. 
[in]  limit  The value to which the function converges above the threshold. 
Definition at line 69 of file TruncatedHarmonic.h.
IMP::core::TruncatedHarmonic< DIRECTION >::TruncatedHarmonic  (  Float  center, 
Float  k,  
Float  threshold  
) 
Same as other constructor, but automatically set limit to a reasonable default value.
Definition at line 72 of file TruncatedHarmonic.h.

overridevirtual 
Calculate score with respect to the given feature.
[in]  feature  Value of feature being tested. 
Reimplemented from IMP::UnaryFunction.
Definition at line 82 of file TruncatedHarmonic.h.

overridevirtual 
Calculate score and derivative with respect to the given feature.
[in]  feature  Value of feature being tested. 
Reimplemented from IMP::UnaryFunction.
Definition at line 74 of file TruncatedHarmonic.h.

overridevirtual 
Get information about the module and version of the object.
Reimplemented from IMP::Object.
Definition at line 88 of file TruncatedHarmonic.h.