IMP logo
Public Member Functions | Static Public Member Functions
IMP::core::TruncatedHarmonic< DIRECTION > Class Template Reference

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 to be an upper bound, lower bound, or both directions. 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
+ Inheritance diagram for IMP::core::TruncatedHarmonic< DIRECTION >:

List of all members.

Public Member Functions

 TruncatedHarmonic (Float center, Float k, Float threshold, Float limit)
 TruncatedHarmonic (Float center, Float k, Float threshold)
- Public Member Functions inherited from IMP::UnaryFunction
virtual double evaluate (double feature) const
 Calculate score with respect to the given feature.
virtual DerivativePair evaluate_with_derivative (double feature) const
 Calculate score and derivative with respect to the given feature.
- Public Member Functions inherited from IMP::base::Object
std::size_t __hash__ () const
virtual std::string get_type_name () const =0
 Return a string identifying the type of the object.
virtual IMP::base::VersionInfo get_version_info () const =0
 Get information about the module and version of the object.
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
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)

Static Public Member Functions

static TruncatedHarmonicget_from (IMP::base::Object *o)

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 harmonic.
[in]kThe spring constant for the 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.
template<int DIRECTION>
IMP::core::TruncatedHarmonic< DIRECTION >::TruncatedHarmonic ( Float  center,
Float  k,
Float  threshold 
)

Set limit to a reasonable value.


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

Generated on Tue May 22 2012 23:33:32 for IMP by doxygen 1.8.1