Rosetta 3.5

`#include <FadeInterval.hh>`

[legend]
[legend]

## Public Member Functions

Automatically generated virtual destructor for class deriving directly from ReferenceCount. More...

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_

bool const smooth_

## Detailed Description

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

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

virtual

Automatically generated virtual destructor for class deriving directly from ReferenceCount.

Auto-generated virtual destructor

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

References fmax_.

References fmin_.

References max0_.

References min0_.

References name_.

References smooth_.

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

## Friends And Related Function Documentation

 bool operator!= ( FadeInterval const & a, FadeInterval const & b )
friend
friend
 bool operator== ( FadeInterval const & a, FadeInterval const & b )
friend

## Member Data Documentation

private

Referenced by value(), and value_deriv().

private

Referenced by value(), and value_deriv().

private
private
private
private
private

Referenced by get_name(), and show().