IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::core::Cosine Class Reference

Cosine function. More...

#include <IMP/core/Cosine.h>

Inheritance diagram for IMP::core::Cosine:

Detailed Description

Cosine function.

This evaluates the function |k| - k cos(nf + a) where k is a force constant, n the periodicity, a the phase, and f the input value. This is most commonly used for dihedral angle restraints, e.g. in the CHARMM force field.

Definition at line 25 of file Cosine.h.

Public Member Functions

 Cosine (Float force_constant, int periodicity, Float phase)
 Constructor.
void do_show (std::ostream &out) const
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.
Float get_force_constant () const
int get_periodicity () const
Float get_phase () const
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.
Public Member Functions inherited from IMP::UnaryFunction
 UnaryFunction (std::string name="UnaryFunction%1%")
Public Member Functions inherited from IMP::Object
CheckLevel get_check_level () const
 get_derived_object (self)
 Return this object cast to the most derived subclass.
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.
const std::string & get_name () const
 Get the (not necessarily unique) name of this object.
void set_name (std::string name)
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
virtual void clear_caches ()

Additional Inherited Members

Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name.
virtual void do_destroy ()

Constructor & Destructor Documentation

◆ Cosine() [1/2]

IMP::core::Cosine::Cosine ( Float force_constant,
int periodicity,
Float phase )

Constructor.

Parameters
[in]force_constantForce constant (score units)
[in]periodicityPeriodicity (generally 1-6)
[in]phasePhase (radians)

Definition at line 32 of file Cosine.h.

◆ Cosine() [2/2]

IMP::core::Cosine::Cosine ( )

Definition at line 37 of file Cosine.h.

◆ ~Cosine()

virtual IMP::core::Cosine::~Cosine ( )
virtual

Definition at line 48 of file Cosine.h.

Member Function Documentation

◆ evaluate()

virtual double IMP::core::Cosine::evaluate ( double feature) const
overridevirtual

Calculate score with respect to the given feature.

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

Reimplemented from IMP::UnaryFunction.

◆ evaluate_with_derivative()

virtual DerivativePair IMP::core::Cosine::evaluate_with_derivative ( double feature) const
overridevirtual

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.

◆ get_force_constant()

Float IMP::core::Cosine::get_force_constant ( ) const

Definition at line 44 of file Cosine.h.

◆ get_periodicity()

int IMP::core::Cosine::get_periodicity ( ) const

Definition at line 45 of file Cosine.h.

◆ get_phase()

Float IMP::core::Cosine::get_phase ( ) const

Definition at line 46 of file Cosine.h.

◆ get_type_name()

virtual std::string IMP::core::Cosine::get_type_name ( ) const
overridevirtual

Reimplemented from IMP::Object.

Definition at line 48 of file Cosine.h.

◆ get_version_info()

virtual ::IMP::VersionInfo IMP::core::Cosine::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 48 of file Cosine.h.

Here is the call graph for this function:

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