![]() |
Rosetta
2021.16
|
Classic FadeInterval. More...
#include <FadeInterval.hh>

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) |
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)
|
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 |
||
| ) |
| string core::scoring::hbonds::FadeInterval::get_name | ( | ) | const |
References name_.
| void core::scoring::hbonds::FadeInterval::show | ( | std::ostream & | out | ) | const |
| core::Real core::scoring::hbonds::FadeInterval::value | ( | Real const | x | ) | const |
References dfade_max_, dfade_min_, fmax_, fmin_, max0_, min0_, and smooth_.
| void core::scoring::hbonds::FadeInterval::value_deriv | ( | Real const | x, |
| core::Real & | val, | ||
| core::Real & | deriv | ||
| ) | const |
References dfade_max_, dfade_min_, fmax_, fmin_, max0_, min0_, and smooth_.
|
friend |
|
friend |
|
friend |
|
private |
Referenced by value(), and value_deriv().
|
private |
Referenced by value(), and value_deriv().
|
private |
Referenced by get_fmax(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Referenced by get_fmin(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Referenced by get_max0(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Referenced by get_min0(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Referenced by get_name(), and show().
|
private |
Referenced by get_smooth(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
1.8.7