IMP logo
IMP Reference Guide  2.6.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-2016 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_JEFFREYS_RESTRAINT_H
10 #define IMPISD_JEFFREYS_RESTRAINT_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/SingletonScore.h>
14 #include <IMP/Restraint.h>
15 
16 IMPISD_BEGIN_NAMESPACE
17 
18 //! Score a Scale particle with log(scale)
19 //! the probability is 1/scale
20 
21 class IMPISDEXPORT JeffreysRestraint : public Restraint {
23 
24  public:
25  //! Create the restraint.
27 
28  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
29  const IMP_OVERRIDE;
31 
33 
34  /* call for probability */
35  virtual double get_probability() const {
36  return exp(-unprotected_evaluate(nullptr));
37  }
38 };
39 
40 IMPISD_END_NAMESPACE
41 
42 #endif /* IMPISD_JEFFREYS_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
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Define SingletonScore.
Class to handle individual model particles.
Definition: Particle.h:37
Abstract base class for all restraints.
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