10#ifndef IMPPMI_COMPOSITE_RESTRAINT_H
11#define IMPPMI_COMPOSITE_RESTRAINT_H
12#include "pmi_config.h"
30 IMP_NAMED_TUPLE_2(CacheKey, CacheKeys,
33 IMP_NAMED_TUPLE_2(CacheKeyPot, CacheKeyPots,
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();}
97 virtual double get_probability()
const
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Abstract base class for all restraints.
Class for adding derivatives from restraints to the model.
Take Decorator, Particle or ParticleIndex.
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
A more IMP-like version of the std::vector.
virtual double unprotected_evaluate(DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
virtual ModelObjectsTemp do_get_inputs() const override
CompositeRestraint(Model *m, ParticleIndexesAdaptor handle_particle_indexes, double coffd, double l, bool tabprob, double plateau, std::string name="CompositeRestraint%1%")
Create the restraint.
int Int
Basic integer value.
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros to help in defining tuple classes.