|
Rosetta 3.5
|
Classic FadeInterval. More...
#include <FadeInterval.hh>


Public Member Functions | |
| virtual | ~FadeInterval () |
| Automatically generated virtual destructor for class deriving directly from ReferenceCount. 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, double &val, double &deriv) const |
| double | 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_ |
| double const | dfade_min_ |
| double 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)
Definition at line 92 of file FadeInterval.hh.
|
virtual |
Automatically generated virtual destructor for class deriving directly from ReferenceCount.
Auto-generated virtual destructor
Definition at line 30 of file FadeInterval.cc.
| core::scoring::hbonds::FadeInterval::FadeInterval | ( | ) |
Constructor.
Definition at line 39 of file FadeInterval.cc.
| core::scoring::hbonds::FadeInterval::FadeInterval | ( | Real const | min0, |
| Real const | fmin, | ||
| Real const | fmax, | ||
| Real const | max0, | ||
| bool const | smooth = false |
||
| ) |
Definition at line 50 of file FadeInterval.cc.
| 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 |
||
| ) |
Definition at line 68 of file FadeInterval.cc.
| Real core::scoring::hbonds::FadeInterval::get_fmax | ( | ) | const |
Definition at line 160 of file FadeInterval.cc.
References fmax_.
| Real core::scoring::hbonds::FadeInterval::get_fmin | ( | ) | const |
Definition at line 154 of file FadeInterval.cc.
References fmin_.
| Real core::scoring::hbonds::FadeInterval::get_max0 | ( | ) | const |
Definition at line 166 of file FadeInterval.cc.
References max0_.
| Real core::scoring::hbonds::FadeInterval::get_min0 | ( | ) | const |
Definition at line 148 of file FadeInterval.cc.
References min0_.
| string core::scoring::hbonds::FadeInterval::get_name | ( | ) | const |
Definition at line 142 of file FadeInterval.cc.
References name_.
| bool core::scoring::hbonds::FadeInterval::get_smooth | ( | ) | const |
Definition at line 172 of file FadeInterval.cc.
References smooth_.
| void core::scoring::hbonds::FadeInterval::show | ( | std::ostream & | out) | const |
Definition at line 208 of file FadeInterval.cc.
References fmax_, fmin_, max0_, min0_, name_, and smooth_.
Referenced by core::scoring::hbonds::operator<<().
| double core::scoring::hbonds::FadeInterval::value | ( | Real const | x) | const |
Definition at line 117 of file FadeInterval.cc.
References dfade_max_, dfade_min_, fmax_, fmin_, max0_, min0_, and smooth_.
| void core::scoring::hbonds::FadeInterval::value_deriv | ( | Real const | x, |
| double & | val, | ||
| double & | deriv | ||
| ) | const |
Definition at line 88 of file FadeInterval.cc.
References dfade_max_, dfade_min_, fmax_, fmin_, max0_, min0_, and smooth_.
|
friend |
Definition at line 191 of file FadeInterval.cc.
|
friend |
Definition at line 199 of file FadeInterval.cc.
|
friend |
Definition at line 178 of file FadeInterval.cc.
|
private |
Definition at line 168 of file FadeInterval.hh.
Referenced by value(), and value_deriv().
|
private |
Definition at line 167 of file FadeInterval.hh.
Referenced by value(), and value_deriv().
|
private |
Definition at line 165 of file FadeInterval.hh.
Referenced by get_fmax(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Definition at line 164 of file FadeInterval.hh.
Referenced by get_fmin(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Definition at line 166 of file FadeInterval.hh.
Referenced by get_max0(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Definition at line 163 of file FadeInterval.hh.
Referenced by get_min0(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
|
private |
Definition at line 162 of file FadeInterval.hh.
Referenced by get_name(), and show().
|
private |
Definition at line 169 of file FadeInterval.hh.
Referenced by get_smooth(), core::scoring::hbonds::operator==(), show(), value(), and value_deriv().
1.8.4