IMP logo
IMP Reference Guide  2.6.1
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-2016 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/Particle.h>
15 #include <IMP/Restraint.h>
16 
17 IMPISD_BEGIN_NAMESPACE
18 
19 //! Normal probability distribution as a restraint
20 class IMPISDEXPORT GaussianRestraint : public Restraint {
21  private:
23  double x_;
24  Pointer<Particle> pmu_;
25  double mu_;
26  Pointer<Particle> psigma_;
27  double sigma_;
28  bool isx_, ismu_, issigma_; // true if it's a particle
29  double chi_;
30 
31  private:
32  void set_chi(double chi) { chi_ = chi; }
33  void check_particles();
34 
35  public:
36  //! Gaussian restraint
37  /** The restraint is a 3-particle restraint, linking together the mean,
38  * observed value and variance, which can all be either Nuisances or doubles.
39  * If F is the identity function, this is a gaussian (e.g. harmonic)
40  * restraint.
41  */
43  Particle *sigma);
44  GaussianRestraint(double x, Particle *mu, Particle *sigma);
45  GaussianRestraint(Particle *x, double mu, Particle *sigma);
46  GaussianRestraint(Particle *x, Particle *mu, double sigma);
47  GaussianRestraint(double x, double mu, Particle *sigma);
48  GaussianRestraint(Particle *x, double mu, double sigma);
49  GaussianRestraint(double x, Particle *mu, double sigma);
50 
51  /* call for probability */
52  double get_probability() const { return exp(-unprotected_evaluate(nullptr)); }
53 
54  double get_chi() const { return chi_; }
55 
56  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
57  const IMP_OVERRIDE;
60 };
61 
62 IMPISD_END_NAMESPACE
63 
64 #endif /* IMPISD_GAUSSIAN_RESTRAINT_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A smart pointer to a reference counted object.
Definition: Pointer.h:87
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Class to handle individual model particles.
Definition: Particle.h:37
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:52