IMP logo
IMP Reference Guide  2.14.0
The Integrative Modeling Platform
IMP::core::TruncatedHarmonic< DIRECTION > Class Template Reference

A function that is harmonic over an interval. More...

#include <IMP/core/TruncatedHarmonic.h>

+ Inheritance diagram for IMP::core::TruncatedHarmonic< DIRECTION >:

Detailed Description

template<int DIRECTION>
class IMP::core::TruncatedHarmonic< DIRECTION >

A function that is harmonic over an interval.

This function is harmonic between center and threshold and then asymptotically converges to the limit value.

The function form above the threshold is currently limit-b/(x-o) where x is the offset from the center and b,o are constants chosen to make the function smooth and continuous. This form may change without notice unless someone tells us it is important that it does not.

Parameters
[in]DIRECTIONWhether the harmonic is of an upper bound, lower bound, or both directions type. It should be one of the BoundDirection enum values. If it is LOWER, than the function is 0 for all values above the passed center.
See Also
Harmonic
HarmonicLowerBound
HarmonicUpperBound

Definition at line 43 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
 Calculate score with respect to the given feature. More...
 
virtual DerivativePair evaluate_with_derivative (double feature) const
 Calculate score and derivative with respect to the given feature. More...
 
virtual std::string get_type_name () const
 
virtual ::IMP::VersionInfo get_version_info () const
 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 ()
 

Constructor & Destructor Documentation

template<int DIRECTION>
IMP::core::TruncatedHarmonic< DIRECTION >::TruncatedHarmonic ( Float  center,
Float  k,
Float  threshold,
Float  limit 
)
Parameters
[in]centerThe center point for the truncated harmonic.
[in]kThe spring constant for the truncated harmonic.
[in]thresholdHow far the harmonic term extends from the center.
[in]limitThe value to which the function converges above the threshold.
Note
I don't like having 4 floats on the initializer list, but don't really see an alternative. There are a few sanity checks, so the order is a bit hard to get wrong.

Definition at line 55 of file TruncatedHarmonic.h.

template<int DIRECTION>
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 58 of file TruncatedHarmonic.h.

Member Function Documentation

template<int DIRECTION>
virtual double IMP::core::TruncatedHarmonic< DIRECTION >::evaluate ( double  feature) const
virtual

Calculate score with respect to the given feature.

Parameters
[in]featureValue of feature being tested.
Returns
Score

Reimplemented from IMP::UnaryFunction.

Definition at line 68 of file TruncatedHarmonic.h.

template<int DIRECTION>
virtual DerivativePair IMP::core::TruncatedHarmonic< DIRECTION >::evaluate_with_derivative ( double  feature) const
virtual

Calculate score and derivative with respect to the given feature.

Parameters
[in]featureValue of feature being tested.
Returns
a DerivativePair containing the score and its partial derivative with respect to the given feature.

Reimplemented from IMP::UnaryFunction.

Definition at line 60 of file TruncatedHarmonic.h.

template<int DIRECTION>
virtual ::IMP::VersionInfo IMP::core::TruncatedHarmonic< DIRECTION >::get_version_info ( ) const
virtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 74 of file TruncatedHarmonic.h.


The documentation for this class was generated from the following file: