8 #ifndef IMPCORE_SURFACE_TETHERED_CHAIN_H
9 #define IMPCORE_SURFACE_TETHERED_CHAIN_H
11 #include <IMP/core/core_config.h>
15 IMPCORE_BEGIN_NAMESPACE
47 double N = (double) N_;
48 beta_ = 3. / 2. / N / b_ / b_;
49 z_min_ = 0.01 / sqrt(2 * beta_);
50 z_min_deriv_ = -141.4072141 * sqrt(beta_);
51 z_min_int_ = 5.2585466 - std::log(beta_) / 2.;
56 : N_(link_num), b_(link_length) {
63 double feature)
const override {
64 if (feature < z_min_) {
69 std::log(2 * beta_ * feature),
70 2. * beta_ * feature - 1. / feature);
74 virtual double evaluate(
double feature)
const override {
75 return evaluate_with_derivative(feature).first;
102 return 1. / sqrt(2 * beta_);
107 return sqrt(
PI / beta_) / 2.;
113 double beta_, z_min_, z_min_deriv_, z_min_int_;
116 IMPCORE_END_NAMESPACE
double get_link_length() const
Get length of each chain link.
static const double PI
the constant pi
virtual double evaluate(double feature) const override
Calculate score with respect to the given feature.
Various useful constants.
double get_distance_at_minimum() const
Get the distance at which the score is at its minimum value.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Single variable function.
Score on surface-to-end distance of chain tethered to impenetrable surface.
int get_link_number() const
Get number of links in chain.
void set_link_number(int N)
Set the number of links in chain.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
void set_link_length(double b)
Set the length of each chain link.
double get_average_distance() const
Get the average distance from the surface.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
virtual DerivativePair evaluate_with_derivative(double feature) const override
Calculate score and derivative with respect to the given feature.
Abstract single variable functor class for score functions.