IMP  2.0.1
The Integrative Modeling Platform
JeffreysRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/JeffreysRestraint.h
3  * \brief A restraint on a scale parameter.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_JEFFREYS_RESTRAINT_H
10 #define IMPISD_JEFFREYS_RESTRAINT_H
11 
12 #include <IMP/restraint_macros.h>
13 #include <IMP/isd/isd_config.h>
14 #include <IMP/SingletonScore.h>
15 #include <IMP/isd/ISDRestraint.h>
16 
17 IMPISD_BEGIN_NAMESPACE
18 
19 //! Score a Scale particle with log(scale)
20 //! the probability is 1/scale
21 
22 class IMPISDEXPORT JeffreysRestraint : public ISDRestraint
23 {
24  Pointer<Particle> p_;
25 
26 public:
27  //! Create the restraint.
29 
30  /** This macro declares the basic needed methods: evaluate and show
31  */
33 
34  /* call for probability */
35  virtual double get_probability() const
36  {
37  return exp(-unprotected_evaluate(nullptr));
38  }
39 
40 };
41 
42 IMPISD_END_NAMESPACE
43 
44 #endif /* IMPISD_JEFFREYS_RESTRAINT_H */