9 #ifndef IMPISD_GAUSSIAN_EM_RESTRAINT_H
10 #define IMPISD_GAUSSIAN_EM_RESTRAINT_H
12 #include "isd_config.h"
23 #include <IMP/algebra/eigen3/Eigen/Dense>
24 #include <boost/unordered_map.hpp>
26 IMPISD_BEGIN_NAMESPACE
28 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
29 struct KahanAccumulation{
33 sum(0.0),correction(0.0)
36 struct KahanVectorAccumulation{
37 IMP_Eigen::Vector3d sum;
38 IMP_Eigen::Vector3d correction;
39 KahanVectorAccumulation():
40 sum(IMP_Eigen::Vector3d(0,0,0)),
41 correction(IMP_Eigen::Vector3d(0,0,0))
44 KahanAccumulation KahanSum(KahanAccumulation accumulation,
double value){
45 KahanAccumulation result;
46 double y = value - accumulation.correction;
47 double t = accumulation.sum + y;
48 result.correction = (t - accumulation.sum) - y;
52 KahanVectorAccumulation KahanVectorSum(KahanVectorAccumulation accumulation, IMP_Eigen::Vector3d value){
53 KahanVectorAccumulation result;
54 IMP_Eigen::Vector3d y = value - accumulation.correction;
55 IMP_Eigen::Vector3d t = accumulation.sum + y;
56 result.correction = (t - accumulation.sum) - y;
82 bool update_model=
true,
bool backbone_slope=
false,
83 std::string name=
"GaussianEMRestraint%1%");
85 double get_probability()
const {
86 return exp(-unprotected_evaluate(NULL));
88 void compute_initial_scores();
89 void set_slope(
Float s){slope_=s;}
90 Float get_slope(){
return slope_;}
95 void show(std::ostream &out)
const { out <<
"GEM restraint"; }
105 Float normalization_;
107 Float self_mm_score_;
Declare an efficient stl-compatible map.
A decorator for particles with mass.
Class for adding derivatives from restraints to the model.
Store a list of kernel::ParticlesTemp.
Return all pairs from a SingletonContainer.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Import IMP/kernel/container_macros.h in the namespace.
Import IMP/kernel/PairContainer.h in the namespace.
Creates a restraint between two sets of anchor points "model" and "density".
Return all pairs from a SingletonContainer.
A restraint is a term in an IMP ScoringFunction.
Decorator to hold Gaussian3D.
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.