IMP logo
IMP Reference Guide  develop.cb6747d2d1,2024/03/28
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-2022 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 
60  const override;
61  virtual IMP::ModelObjectsTemp do_get_inputs() const 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
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
A more IMP-like version of the std::vector.
Definition: Vector.h:50
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:143
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:43
Abstract base class for all restraints.
Normal probability distribution as a restraint.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:56