10 #ifndef IMPPMI_COMPOSITE_RESTRAINT_H
11 #define IMPPMI_COMPOSITE_RESTRAINT_H
12 #include "pmi_config.h"
18 IMPPMI_BEGIN_NAMESPACE
36 typedef boost::unordered_map<CacheKey, double> Cache;
37 typedef boost::unordered_map<CacheKeyPot, double> CachePot;
45 int exparg_grid_size_;
48 inline double calc_prob (
double dist)
const{
49 double argvalue=(dist-coffd_)/l_;
53 double maxarg=std::max(argvalue,argmin_);
55 double minarg=std::min(maxarg,argmax_);
56 unsigned k =
static_cast<unsigned>( std::floor(minarg*invdx_)+exparg_grid_size_);
61 prob=(1.0-plateau_)/(1.0+std::exp(-argvalue));
71 double get_probability_per_particle_excluding(
unsigned int ipart,
72 Ints excluded_ps, Cache& cache, CachePot& cachepot)
const;
80 double coffd,
double l,
bool tabprob,
double plateau,
81 std::string name=
"CompositeRestraint%1%");
86 unsigned int get_number_of_elements()
const {
return pis_.size();}
98 virtual double get_probability()
const
100 return exp(-unprotected_evaluate(
nullptr));
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros to help in defining tuple classes.
A more IMP-like version of the std::vector.
Take Decorator, Particle or ParticleIndex.
Class for storing model, its restraints, constraints, and particles.
A restraint for ambiguous cross-linking MS data and multiple state approach.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Abstract base class for all restraints.
int Int
Basic integer value.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.