IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
GaussianRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/GaussianRestraint.h
3  * \brief A lognormal restraint that uses the ISPA model to model NOE-derived
4  * distance fit.
5  *
6  * Copyright 2007-2018 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPISD_GAUSSIAN_RESTRAINT_H
11 #define IMPISD_GAUSSIAN_RESTRAINT_H
12 
13 #include <IMP/isd/isd_config.h>
14 #include <IMP/isd/FNormal.h>
15 #include <IMP/Particle.h>
16 #include <IMP/Restraint.h>
17 
18 IMPISD_BEGIN_NAMESPACE
19 
20 //! Normal probability distribution as a restraint
21 class IMPISDEXPORT GaussianRestraint : public Restraint {
22  private:
23  PointerMember<FNormal> normal_;
25  double x_;
26  Pointer<Particle> pmu_;
27  double mu_;
28  Pointer<Particle> psigma_;
29  double sigma_;
30  bool isx_, ismu_, issigma_; // true if it's a particle
31  double chi_;
32 
33  private:
34  void set_chi(double chi) { chi_ = chi; }
35  void check_particles();
36  void create_normal();
37 
38  public:
39  //! Gaussian restraint
40  /** The restraint is a 3-particle restraint, linking together the mean,
41  * observed value and variance, which can all be either Nuisances or doubles.
42  * If F is the identity function, this is a gaussian (e.g. harmonic)
43  * restraint.
44  */
46  Particle *sigma);
47  GaussianRestraint(double x, Particle *mu, Particle *sigma);
48  GaussianRestraint(Particle *x, double mu, Particle *sigma);
49  GaussianRestraint(Particle *x, Particle *mu, double sigma);
50  GaussianRestraint(double x, double mu, Particle *sigma);
51  GaussianRestraint(Particle *x, double mu, double sigma);
52  GaussianRestraint(double x, Particle *mu, double sigma);
53 
54  /* call for probability */
55  double get_probability() const { return exp(-unprotected_evaluate(nullptr)); }
56 
57  double get_chi() const { return chi_; }
58 
59  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
60  const IMP_OVERRIDE;
63 };
64 
65 IMPISD_END_NAMESPACE
66 
67 #endif /* IMPISD_GAUSSIAN_RESTRAINT_H */
Normal distribution of Function.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A more IMP-like version of the std::vector.
Definition: Vector.h:39
A smart pointer to a reference counted object.
Definition: Pointer.h:87
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Class to handle individual particles of a Model object.
Definition: Particle.h:41
Abstract base class for all restraints.
Normal probability distribution as a restraint.
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.
Definition: Restraint.h:54