home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.20.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
isd
version 2.20.0
UniformPrior.h
Go to the documentation of this file.
1
/**
2
* \file IMP/isd/UniformPrior.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_UNIFORM_PRIOR_H
10
#define IMPISD_UNIFORM_PRIOR_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
//! Uniform distribution with harmonic boundaries
21
22
class
IMPISDEXPORT
UniformPrior
:
public
Restraint
23
{
24
ParticleIndex
pi_;
25
double
upperb_;
26
double
lowerb_;
27
double
k_;
28
29
friend
class
cereal::access;
30
template
<
class
Archive>
void
serialize(Archive &ar) {
31
ar(cereal::base_class<Restraint>(
this
), pi_, upperb_, lowerb_, k_);
32
}
33
IMP_OBJECT_SERIALIZE_DECL
(
UniformPrior
);
34
35
public
:
36
//! Create the restraint.
37
UniformPrior
(
IMP::Model
* m,
Particle
*p,
double
k,
double
upperb,
38
double
lowerb, std::string name=
"UniformPrior%1%"
);
39
40
UniformPrior
() {}
41
42
virtual
double
43
unprotected_evaluate
(
IMP::DerivativeAccumulator
*accum)
44
const override
;
45
virtual
IMP::ModelObjectsTemp
do_get_inputs
()
const override
;
46
IMP_OBJECT_METHODS
(
UniformPrior
);
47
48
/* call for probability */
49
virtual
double
get_probability()
const
50
{
51
return
exp(-
unprotected_evaluate
(
nullptr
));
52
}
53
54
//! \return Information for writing to RMF files
55
RestraintInfo
*
get_static_info
()
const override
;
56
57
//! \return Information for writing to RMF files
58
RestraintInfo
*
get_dynamic_info
()
const override
;
59
60
};
61
62
IMPISD_END_NAMESPACE
63
64
#endif
/* IMPISD_UNIFORM_PRIOR_H */
IMP::Restraint::get_static_info
virtual RestraintInfo * get_static_info() const
Definition:
Restraint.h:178
IMP::Restraint::get_dynamic_info
virtual RestraintInfo * get_dynamic_info() const
Definition:
Restraint.h:190
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::isd::UniformPrior
Uniform distribution with harmonic boundaries.
Definition:
UniformPrior.h:22
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
SingletonScore.h
Define SingletonScore.
IMP::RestraintInfo
Report key:value information on restraints.
Definition:
RestraintInfo.h:47
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