Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends | List of all members
core::scoring::hbonds::FadeInterval Class Reference

Classic FadeInterval. More...

#include <FadeInterval.hh>

Inheritance diagram for core::scoring::hbonds::FadeInterval:
Inheritance graph
[legend]

Public Member Functions

 ~FadeInterval () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 FadeInterval ()
 Constructor. More...
 
 FadeInterval (Real const min0, Real const fmin, Real const fmax, Real const max0, bool const smooth=false)
 
 FadeInterval (std::string const &name, Real const min0, Real const fmin, Real const fmax, Real const max0, bool const smooth=false)
 
void value_deriv (Real const x, core::Real &val, core::Real &deriv) const
 
core::Real value (Real const x) const
 
std::string get_name () const
 
Real get_min0 () const
 
Real get_fmin () const
 
Real get_fmax () const
 
Real get_max0 () const
 
bool get_smooth () const
 
void show (std::ostream &out) const
 

Private Attributes

std::string const name_
 
Real const min0_
 
Real const fmin_
 
Real const fmax_
 
Real const max0_
 
core::Real const dfade_min_
 
core::Real const dfade_max_
 
bool const smooth_
 

Friends

bool operator== (FadeInterval const &a, FadeInterval const &b)
 
bool operator!= (FadeInterval const &a, FadeInterval const &b)
 
std::ostream & operator<< (std::ostream &out, FadeInterval const &fade_interval)
 

Detailed Description

Classic FadeInterval.

stores an "fading interval" [a b c d] with a <= b <= c <= d and computes the fraction of containment for x, which is defined to be 0 if x is outside of (a,d), 1 if x is inside of [b,c], and a linear ramp otherwise. ___/--—___ i.e. (x-a)/(b-a) for x in (a,b), and (d-x)/(d-c) for x in (c,d) This is used to ensure that hbond scoring as a sum Er + ExH + ExD goes to zero at the edges.

Notes about discontinuities: if x equals a, b, c, or d then deriv = 0 if x == a == b then value = 0 if x == c == d and a < c then value = 1 if x == c == d and a == c then value = 0 In particular if a == b == c == d then for all x, value == deriv == 0

Smooth FadeInteval

Rather than using a piecewise linear fading function, use a piecewise sigmoid function to have a continuous derivative.

Look for a canonical sigmoid function f(x) such that, f(0) = 1 f(1) = 0 // goes through the the knots f'(0) = 0 f'(1) = 0 // is horizontal at the knots a continuous differative f(x-.5)-.5 is odd // symmetric

I claim, f(x) = 2x^3 - 3x^2 + 1, satisfies these constraints: f(0) = 2(0)^3 - 3(x)^2 + 1 = 1 f(1) = 2(1)^3 - 3(1)^2 + 1 = 2 - 3 + 1 = 0

f'(x) = 6x^2 - 6x = 6x(x-1) f'(0) = 6(0)(0-1) = 0 f'(1) = 6(1)(1-1) = 0

a function g(x) is odd if g(-x) = -g(x) f((-x)-.5)-.5 = 2(-x-.5)^3 - 3(-x-.5)^2 + 1 - .5 = -2x^3 - 6x^2 - 4.5x - .5 -(f(x-.5)-.5) = -2(x-.5)^3 + 3(x-.5)^2 - 1 + .5 = -2x^3 - 6x^2 - 4.5x - .5

Given the knots –a-b—c-d– transform f(x) to fill a-b and c-d to connect the linear regions.

a-b region: let z(x) = (x-a)/(b-a) and z'(x) = 1/(b-a) use g(x) = 1-f(-z(x)) = -2z^3 + 3z^2 and g'(x) = -6z(z-1)*z'(x) c-d region: let z(x) = (x-c)/(d-c) and z'(x) = 1/(d-c) use g(x) = f(z) = 2z^3 - 3z^2 + 1 and g'(x) = 6z(z-1)*z'(x)

Constructor & Destructor Documentation

core::scoring::hbonds::FadeInterval::~FadeInterval ( )
overridedefault

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

core::scoring::hbonds::FadeInterval::FadeInterval ( )

Constructor.

core::scoring::hbonds::FadeInterval::FadeInterval ( Real const  min0,
Real const  fmin,
Real const  fmax,
Real const  max0,
bool const  smooth = false 
)
core::scoring::hbonds::FadeInterval::FadeInterval ( std::string const &  name,
Real const  min0,
Real const  fmin,
Real const  fmax,
Real const  max0,
bool const  smooth = false 
)

Member Function Documentation

Real core::scoring::hbonds::FadeInterval::get_fmax ( ) const

References fmax_.

Real core::scoring::hbonds::FadeInterval::get_fmin ( ) const

References fmin_.

Real core::scoring::hbonds::FadeInterval::get_max0 ( ) const

References max0_.

Real core::scoring::hbonds::FadeInterval::get_min0 ( ) const

References min0_.

string core::scoring::hbonds::FadeInterval::get_name ( ) const

References name_.

bool core::scoring::hbonds::FadeInterval::get_smooth ( ) const

References smooth_.

void core::scoring::hbonds::FadeInterval::show ( std::ostream &  out) const
core::Real core::scoring::hbonds::FadeInterval::value ( Real const  x) const
void core::scoring::hbonds::FadeInterval::value_deriv ( Real const  x,
core::Real val,
core::Real deriv 
) const

Friends And Related Function Documentation

bool operator!= ( FadeInterval const &  a,
FadeInterval const &  b 
)
friend
std::ostream& operator<< ( std::ostream &  out,
FadeInterval const &  fade_interval 
)
friend
bool operator== ( FadeInterval const &  a,
FadeInterval const &  b 
)
friend

Member Data Documentation

core::Real const core::scoring::hbonds::FadeInterval::dfade_max_
private

Referenced by value(), and value_deriv().

core::Real const core::scoring::hbonds::FadeInterval::dfade_min_
private

Referenced by value(), and value_deriv().

Real const core::scoring::hbonds::FadeInterval::fmax_
private
Real const core::scoring::hbonds::FadeInterval::fmin_
private
Real const core::scoring::hbonds::FadeInterval::max0_
private
Real const core::scoring::hbonds::FadeInterval::min0_
private
std::string const core::scoring::hbonds::FadeInterval::name_
private

Referenced by get_name(), and show().

bool const core::scoring::hbonds::FadeInterval::smooth_
private

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