IMP  2.1.0
The Integrative Modeling Platform
LognormalRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/LognormalRestraint.h
3  * \brief A lognormal restraint that uses the ISPA model to model NOE-derived
4  * distance fit.
5  *
6  * Copyright 2007-2013 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPISD_LOGNORMAL_RESTRAINT_H
11 #define IMPISD_LOGNORMAL_RESTRAINT_H
12 
13 #include <IMP/restraint_macros.h>
14 #include <IMP/isd/isd_config.h>
15 #include <IMP/kernel/Particle.h>
16 #include <IMP/kernel/Restraint.h>
17 
18 IMPISD_BEGIN_NAMESPACE
19 
20 //! Normal probability distribution as a restraint
21 class IMPISDEXPORT LognormalRestraint : public kernel::Restraint
22 {
23 private:
25  double x_;
27  double mu_;
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 
37 public:
38  //! Gaussian restraint
39  /** The restraint is a 3-particle restraint, linking together the mean,
40  * observed value and variance, which can all be either Nuisances or doubles.
41  * If F is the identity function, this is a gaussian (e.g. harmonic)
42  * restraint.
43  */
45  *sigma);
49  LognormalRestraint(double x, double mu, kernel::Particle *sigma);
50  LognormalRestraint(kernel::Particle *x, double mu, double sigma);
51  LognormalRestraint(double x, kernel::Particle *mu, double sigma);
52 
53  /* call for probability */
54  double get_probability() const
55  {
56  return exp(-unprotected_evaluate(nullptr));
57  }
58 
59  double get_chi() const
60  {return chi_; }
61 
62 
63  virtual double
64  unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
65  const IMP_OVERRIDE;
66  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
68 
69 };
70 
71 IMPISD_END_NAMESPACE
72 
73 #endif /* IMPISD_LOGNORMAL_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
A smart pointer to a reference counted object.
Definition: base/Pointer.h:87
Import IMP/kernel/restraint_macros.h in the namespace.
Abstract base class for all restraints.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Class to handle individual model particles.
Classes to handle individual model particles.
virtual ModelObjectsTemp do_get_inputs() const =0
Normal probability distribution as a restraint.