home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.6.1
The Integrative Modeling Platform
IMP Manual
Reference Guide
Modules
Classes
Examples
include
IMP
SingletonScore.h
Go to the documentation of this file.
1
// Autogenerated by ../../../../tmp/nightly-build-59000/imp-2.6.1/tools/build/make_containers.py
2
// from ../../../../tmp/nightly-build-59000/imp-2.6.1/tools/build/container_templates/kernel/ClassnameScore.h
3
// Do not edit - any changes will be lost!
4
5
/**
6
* \file IMP/SingletonScore.h
7
* \brief Define SingletonScore.
8
*
9
* Copyright 2007-2016 IMP Inventors. All rights reserved.
10
*/
11
12
#ifndef IMPKERNEL_SINGLETON_SCORE_H
13
#define IMPKERNEL_SINGLETON_SCORE_H
14
15
#include <IMP/kernel_config.h>
16
#include "
base_types.h
"
17
#include "
DerivativeAccumulator.h
"
18
#include "internal/container_helpers.h"
19
#include <
IMP/utility_macros.h
>
20
#include "
model_object_helpers.h
"
21
22
IMPKERNEL_BEGIN_NAMESPACE
23
24
//! Abstract class for scoring object(s) of type ParticleIndex.
25
/** SingletonScore will evaluate the score and derivatives
26
for passed object(s) of type ParticleIndex.
27
28
Use in conjunction with various
29
restraints such as IMP::container::SingletonsRestraint or
30
IMP::core::SingletonRestraint. The restraints couple the score
31
functions with appropriate lists of object(s) of type ParticleIndex.
32
33
Implementers should check out IMP_SINGLETON_SCORE().
34
35
\see PredicateSingletonRestraint
36
*/
37
class
IMPKERNELEXPORT
SingletonScore
:
public
ParticleInputs
,
38
public
Object
{
39
public
:
40
typedef
Particle
*
Argument
;
41
typedef
ParticleIndex
IndexArgument
;
42
typedef
Particle
*
PassArgument
;
43
typedef
ParticleIndex
PassIndexArgument
;
44
typedef
SingletonModifier
Modifier
;
45
SingletonScore
(std::string name =
"SingletonScore %1%"
);
46
47
//! Compute the score and the derivative if needed.
48
/** @param m the model of vt
49
@param vt the index in m of an object of type Particle
50
@param da a DerivativeAccumulator that weights
51
computed derivatives. If nullptr, derivatives
52
will not be computed.
53
*/
54
virtual
double
evaluate_index(
Model
*m,
ParticleIndex
vt,
55
DerivativeAccumulator
*da)
const
= 0;
56
57
//! Compute the score and the derivative if needed over a set.
58
/** @param m the model of o
59
@param o objects of type Particle, specified by index
60
@param da a derivative accumulator that weights
61
computed derivatives. If nullptr, derivatives
62
will not be computed.
63
@param lower_bound index of first item in o to evaluate
64
@param upper_bound index of last item in o to evaluate
65
66
@note Implementations for these are provided by
67
the IMP_SINGLETON_SCORE() macro.
68
*/
69
virtual
double
evaluate_indexes(
Model
*m,
const
ParticleIndexes
&o,
70
DerivativeAccumulator
*da,
71
unsigned
int
lower_bound,
72
unsigned
int
upper_bound)
const
;
73
74
//! Compute the score and the derivative if needed, only if "good".
75
/** This functions similarly to evaluate_index(),
76
but may terminate the computation early if the score is higher than max.
77
78
@return the score if score<= max or some arbitrary value > max otherwise.
79
*/
80
virtual
double
evaluate_if_good_index(
Model
*m,
ParticleIndex
vt,
81
DerivativeAccumulator
*da,
82
double
max)
const
;
83
84
/** Compute the score and the derivative if needed over a set, only if "good".
85
This functions similarly to evaluate_indexes(), but may terminate
86
the computation early if the total score is higher than max.
87
88
@return the score if score<= max or some arbitrary value > max otherwise.
89
90
@note Implementations for these are provided by the IMP_SINGLETON_SCORE()
91
macro.
92
*/
93
virtual
double
evaluate_if_good_indexes(
Model
*m,
94
const
ParticleIndexes
&o,
95
DerivativeAccumulator
*da,
double
max,
96
unsigned
int
lower_bound,
97
unsigned
int
upper_bound)
const
;
98
99
//! Decompose this pair score acting on the pair into a set of restraints.
100
/** The scoring function and derivatives should
101
be equal to the current score. The default implementation
102
just returns this object bound to the pair. */
103
Restraints
create_current_decomposition(
Model
*m,
104
ParticleIndex
vt)
const
;
105
106
protected
:
107
//! Overide this to return your own decomposition.
108
virtual
Restraints
do_create_current_decomposition(
Model
*m,
109
ParticleIndex
vt)
const
;
110
111
IMP_REF_COUNTED_DESTRUCTOR
(
SingletonScore
);
112
};
113
114
IMPKERNEL_END_NAMESPACE
115
116
#endif
/* IMPKERNEL_SINGLETON_SCORE_H */
IMP::SingletonModifier
A base class for modifiers of ParticlesTemp.
Definition:
SingletonModifier.h:32
base_types.h
Basic types used by IMP.
DerivativeAccumulator.h
Class for adding derivatives from restraints to the model.
IMP::Index< ParticleIndexTag >
IMP::ParticleInputs
Definition:
model_object_helpers.h:18
IMP_REF_COUNTED_DESTRUCTOR
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Ref counted objects should have private destructors.
Definition:
ref_counted_macros.h:60
IMP::Vector< ParticleIndex >
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:72
IMP::Object
Common base class for heavy weight IMP objects.
Definition:
Object.h:106
IMP::SingletonScore
Abstract class for scoring object(s) of type ParticleIndex.
Definition:
SingletonScore.h:37
model_object_helpers.h
Single variable function.
utility_macros.h
Various general useful macros for IMP.
IMP::Particle
Class to handle individual model particles.
Definition:
Particle.h:37
IMP::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
DerivativeAccumulator.h:25