home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.20.2
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
isd
version 2.20.2
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-2023 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
#include <cereal/access.hpp>
16
#include <cereal/types/base_class.hpp>
17
18
IMPISD_BEGIN_NAMESPACE
19
20
//! Score a Scale particle with log(scale)
21
//! the probability is 1/scale
22
23
class
IMPISDEXPORT
JeffreysRestraint
:
public
Restraint
{
24
ParticleIndex
pi_;
25
26
friend
class
cereal::access;
27
template
<
class
Archive>
void
serialize(Archive &ar) {
28
ar(cereal::base_class<Restraint>(
this
), pi_);
29
}
30
IMP_OBJECT_SERIALIZE_DECL
(
JeffreysRestraint
);
31
32
public
:
33
//! Create the restraint.
34
JeffreysRestraint
(
Model
*m,
Particle
*p);
35
36
JeffreysRestraint
() {}
37
38
virtual
double
unprotected_evaluate
(
IMP::DerivativeAccumulator
*accum)
39
const override
;
40
virtual
IMP::ModelObjectsTemp
do_get_inputs
()
const override
;
41
42
IMP_OBJECT_METHODS
(
JeffreysRestraint
);
43
44
/* call for probability */
45
virtual
double
get_probability()
const
{
46
return
exp(-
unprotected_evaluate
(
nullptr
));
47
}
48
};
49
50
IMPISD_END_NAMESPACE
51
52
#endif
/* IMPISD_JEFFREYS_RESTRAINT_H */
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::Index< ParticleIndexTag >
IMP::Restraint::unprotected_evaluate
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
IMP::Vector
A more IMP-like version of the std::vector.
Definition:
Vector.h:42
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:86
IMP_OBJECT_SERIALIZE_DECL
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition:
object_macros.h:95
IMP::isd::JeffreysRestraint
Definition:
JeffreysRestraint.h:23
SingletonScore.h
Define SingletonScore.
IMP::Particle
Class to handle individual particles of a Model object.
Definition:
Particle.h:43
Restraint.h
Abstract base class for all restraints.
IMP::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0
IMP::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
DerivativeAccumulator.h:24
IMP::Restraint
A restraint is a term in an IMP ScoringFunction.
Definition:
Restraint.h:56