IMP  2.1.1
The Integrative Modeling Platform
vonMisesKappaConjugateRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/vonMisesKappaConjugateRestraint.h
3  * \brief Conjugate prior for \f$\kappa\f$ in the von Mises distribution.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_VON_MISES_KAPPA_CONJUGATE_RESTRAINT_H
10 #define IMPISD_VON_MISES_KAPPA_CONJUGATE_RESTRAINT_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/SingletonScore.h>
14 #include <IMP/kernel/Restraint.h>
15 #include <IMP/restraint_macros.h>
16 
17 IMPISD_BEGIN_NAMESPACE
18 
19 //! Conjugate prior for the concentration parameter of a von Mises distribution.
20 /** \f[ p(\kappa|c,R_0) = \frac{\exp(\kappa R_0)}{I_0(\kappa)^c} \f]
21  \f$0 < R_0 \le c\f$
22  where \f$kappa\f$ is the concentration parameter.
23  Default values: \f$R_0=1\f$ and \f$c=10\f$
24  */
26 {
28  double old_kappaval;
29  bool bessel_init_;
30  double I0_,I1_;
31  double c_,R0_;
32 
33 public:
34  //! Create the restraint.
36  double c=10.0, double R0=0.0);
37 
38  /** This macro declares the basic needed methods: evaluate and show
39  */
40  virtual double
41  unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
42  const IMP_OVERRIDE;
43  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
45 
46  virtual double get_probability() const;
47 
48 private:
49 
50  void update_bessel(double kappaval); // update memoized bessel value
51  double get_kappa() const;
52 
53 };
54 
55 IMPISD_END_NAMESPACE
56 
57 #endif /* IMPISD_VON_MISES_KAPPA_CONJUGATE_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
IMP::base::Vector< IMP::base::WeakPointer< kernel::ModelObject > > ModelObjectsTemp
A smart pointer to a reference counted object.
Definition: base/Pointer.h:87
Import IMP/kernel/restraint_macros.h in the namespace.
Conjugate prior for the concentration parameter of a von Mises distribution.
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.
Import IMP/kernel/SingletonScore.h in the namespace.
Class for storing model, its restraints, constraints, and particles.