7 #ifndef IMPISD_VON_MISES_H
8 #define IMPISD_VON_MISES_H
10 #include <IMP/isd/isd_config.h>
15 #include <boost/math/special_functions/bessel.hpp>
17 IMPISD_BEGIN_NAMESPACE
31 vonMises(
double x,
double mu,
double kappa)
33 force_set_kappa(kappa);
37 virtual double evaluate()
const
39 return logterm_ - kappa_*cos(x_-mu_);
42 virtual double evaluate_derivative_x()
const
43 {
return kappa_*sin(x_-mu_); }
45 virtual double evaluate_derivative_mu()
const
46 {
return -kappa_*sin(x_-mu_); }
48 virtual double evaluate_derivative_kappa()
const
49 {
return -cos(x_-mu_) + I1_/I0_; }
52 virtual double density()
const
54 return exp(kappa_*cos(x_-mu_))/(2*
IMP::PI*I0_);
58 void set_x(
double x) {
61 void set_mu(
double mu) {
64 void set_kappa(
double kappa) {
65 if (kappa_ != kappa) {
66 force_set_kappa(kappa);
75 void force_set_kappa(
double kappa) {
77 I0_ = boost::math::cyl_bessel_i(0, kappa);
78 I1_ = boost::math::cyl_bessel_i(1, kappa);
81 double x_,mu_,kappa_,I0_,I1_,logterm_;
static const double PI
the constant pi
Import IMP/kernel/constants.h in the namespace.
Import IMP/kernel/macros.h in the namespace.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Storage of a model, its restraints, constraints and particles.
Common base class for heavy weight IMP objects.