8#ifndef IMPCORE_SURFACE_TETHERED_CHAIN_H
9#define IMPCORE_SURFACE_TETHERED_CHAIN_H
11#include <IMP/core/core_config.h>
15IMPCORE_BEGIN_NAMESPACE
43class SurfaceTetheredChain :
public UnaryFunction {
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.;
55 SurfaceTetheredChain(
int link_num,
double link_length)
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 {
102 return 1. / sqrt(2 * beta_);
107 return sqrt(PI / beta_) / 2.;
113 double beta_, z_min_, z_min_deriv_, z_min_int_;
Single variable function.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
void set_link_number(int N)
Set the number of links in chain.
int get_link_number() const
Get number of links in chain.
virtual DerivativePair evaluate_with_derivative(double feature) const override
Calculate score and derivative with respect to the given feature.
virtual double evaluate(double feature) const override
Calculate score with respect to the given feature.
double get_link_length() const
Get length of each chain link.
double get_distance_at_minimum() const
Get the distance at which the score is at its minimum value.
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.
Various useful constants.
std::pair< double, double > DerivativePair
A pair representing a function value with its first derivative.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.