IMP
2.4.0
The Integrative Modeling Platform
IMP Mainpage
Modules
Classes
Examples
include
IMP
kernel
kernel/TripletScore.h
Go to the documentation of this file.
1
/**
2
* \file IMP/kernel/TripletScore.h
3
* \brief Define TripletScore.
4
*
5
* WARNING This file was generated from TripletScore.h
6
* in /tmp/nightly-build-65532/imp-2.4.0/tools/build/container_templates/kernel
7
* by tools/build/make_containers.py.
8
*
9
* Copyright 2007-2015 IMP Inventors. All rights reserved.
10
*/
11
12
#ifndef IMPKERNEL_TRIPLET_SCORE_H
13
#define IMPKERNEL_TRIPLET_SCORE_H
14
15
#include <IMP/kernel/kernel_config.h>
16
#include "
base_types.h
"
17
#include "
ParticleTuple.h
"
18
#include "
DerivativeAccumulator.h
"
19
#include "internal/container_helpers.h"
20
#include <
IMP/base/utility_macros.h
>
21
#include "
model_object_helpers.h
"
22
23
IMPKERNEL_BEGIN_NAMESPACE
24
25
//! Abstract class for scoring object(s) of type ParticleTriplet
26
/** TripletScore will evaluate the score and derivatives
27
for passed object(s) of type ParticleTriplet.
28
29
Use in conjunction with various
30
restraints such as IMP::core::TripletsRestraint or
31
IMP::core::TripletRestraint. The restraints couple the score
32
functions with appropariate lists of object(s) of type ParticleTriplet.
33
34
Implementers should check out IMP_TRIPLET_SCORE().
35
36
\see PredicateTripletRestraint
37
*/
38
class
IMPKERNELEXPORT
TripletScore
:
public
ParticleInputs
,
39
public
base::Object
{
40
public
:
41
typedef
kernel::ParticleTriplet
Argument
;
42
typedef
kernel::ParticleIndexTriplet
IndexArgument
;
43
typedef
const
kernel::ParticleTriplet
&
PassArgument
;
44
typedef
const
kernel::ParticleIndexTriplet
&
PassIndexArgument
;
45
typedef
TripletModifier
Modifier
;
46
TripletScore
(std::string name =
"TripletScore %1%"
);
47
//! Compute the score and the derivative if needed.
48
/** \deprecated_at{2.1} Use the index-based evaluate instead. */
49
IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
50
virtual
double
evaluate(
const
kernel::ParticleTriplet
& vt,
DerivativeAccumulator
*da)
const
;
51
52
//! Compute the score and the derivative if needed.
53
/** evaluate the score and the derivative if needed over vt
54
55
@param m the model of vt
56
@param vt the index in m of an object of type ParticleTriplet
57
@param da a derivative accumulator that reweighting
58
computed derivatives. If nullptr, derivatives
59
will not be computed
60
*/
61
virtual
double
evaluate_index(
kernel::Model
*m,
const
kernel::ParticleIndexTriplet
& vt,
62
DerivativeAccumulator
*da)
const
;
63
64
//! Compute the score and the derivative if needed over a set.
65
/** evaluate the score and the derivative if needed over a set
66
of objects in o
67
68
@param m the model of o
69
@param o objects of type ParticleTriplet, specified by index
70
@param da a derivative accumulator that reweighting
71
computed derivatives. If nullptr, derivatives
72
will not be computed
73
@param lower_bound index of first item in o to evaluate
74
@param upper_bound index of last item in o to evaluate
75
76
@note Implementations
77
for these are provided by the IMP_TRIPLET_SCORE()
78
macro.
79
*/
80
virtual
double
evaluate_indexes(
kernel::Model
*m,
const
kernel::ParticleIndexTriplets
&o,
81
DerivativeAccumulator
*da,
82
unsigned
int
lower_bound,
83
unsigned
int
upper_bound)
const
;
84
85
//! Compute the score and the derivative if needed.
86
/** Compute the score and the derivative if needed as in evaluate_index().
87
but may terminate the computation early if the score is higher than max.
88
89
@return the score if score<= max or some arbitrary value > max otherwise.
90
*/
91
virtual
double
evaluate_if_good_index(
kernel::Model
*m,
const
kernel::ParticleIndexTriplet
& vt,
92
DerivativeAccumulator
*da,
93
double
max)
const
;
94
95
/** Compute the score and the derivative if needed as in evaluate_index().
96
but may terminate the computation early if the total score is higher than max.
97
98
@return the score if score<= max or some arbitrary value > max otherwise.
99
100
Implementations
101
for these are provided by the IMP_TRIPLET_SCORE()
102
macro.
103
*/
104
virtual
double
evaluate_if_good_indexes(
kernel::Model
*m,
105
const
kernel::ParticleIndexTriplets
&o,
106
DerivativeAccumulator
*da,
double
max,
107
unsigned
int
lower_bound,
108
unsigned
int
upper_bound)
const
;
109
/** Decompose this pair score acting on the pair into a set of
110
restraints. The scoring function and derivatives should
111
be equal to the current score. The defualt implementation
112
just returns this object bound to the pair.*/
113
Restraints
create_current_decomposition(
kernel::Model
*m,
114
const
kernel::ParticleIndexTriplet
& vt)
const
;
115
116
protected
:
117
/** Overide this to return your own decomposition.*/
118
virtual
Restraints
do_create_current_decomposition(
kernel::Model
*m,
119
const
kernel::ParticleIndexTriplet
& vt)
const
;
120
121
IMP_REF_COUNTED_DESTRUCTOR
(
TripletScore
);
122
};
123
124
IMPKERNEL_END_NAMESPACE
125
126
#endif
/* IMPKERNEL_TRIPLET_SCORE_H */
DerivativeAccumulator.h
Class for adding derivatives from restraints to the model.
IMP::kernel::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
kernel/DerivativeAccumulator.h:25
IMP::kernel::TripletModifier
A base class for modifiers of kernel::ParticleTripletsTemp.
Definition:
kernel/TripletModifier.h:33
base_types.h
Basic types used by IMP.
IMP_REF_COUNTED_DESTRUCTOR
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Ref counted objects should have private destructors.
Definition:
ref_counted_macros.h:60
IMP::base::Vector< ParticleIndexTriplet >
model_object_helpers.h
Single variable function.
IMP::base::Array
A class to store an fixed array of same-typed values.
Definition:
Array.h:33
utility_macros.h
Various general useful macros for IMP.
IMP::kernel::ParticleInputs
Definition:
kernel/model_object_helpers.h:18
IMP::TripletScore
IMP::kernel::TripletScore TripletScore
Definition:
kernel/doxygen.h:248
IMP::base::Object
Common base class for heavy weight IMP objects.
Definition:
Object.h:106
ParticleTuple.h
Classes to handle individual model particles.
IMP::kernel::TripletScore
Abstract class for scoring object(s) of type ParticleTriplet.
Definition:
kernel/TripletScore.h:38
IMP::kernel::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
kernel/Model.h:73