IMP
2.1.1
The Integrative Modeling Platform
IMP Mainpage
All IMP Modules
Related Pages
Modules
Namespaces
Classes
Files
Examples
Indexes
File List
File Members
kernel/TripletPredicate.h
Go to the documentation of this file.
1
/**
2
* \file IMP/kernel/TripletPredicate.h
3
* \brief Define TripletPredicate.
4
*
5
* WARNING This file was generated from TripletPredicate.h
6
* in /tmp/nightly-build-61576/imp-2.1.1/tools/build/container_templates/kernel
7
* by tools/maintenance/setup_containers.py.
8
*
9
* Copyright 2007-2013 IMP Inventors. All rights reserved.
10
*/
11
12
#ifndef IMPKERNEL_TRIPLET_PREDICATE_H
13
#define IMPKERNEL_TRIPLET_PREDICATE_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 "
model_object_helpers.h
"
21
22
IMPKERNEL_BEGIN_NAMESPACE
23
24
//! Abstract predicate function
25
/** A predicate is a function which returns one of a discrete set of
26
values (eg -1, 0, 1 depending on whether a value is negative, zero
27
or positive). TripletPredicates will evaluate the predicate for the passed
28
particles.
29
30
Implementers should check out IMP_TRIPLET_PREDICATE().
31
*/
32
class
IMPKERNELEXPORT
TripletPredicate
:
public
ParticleInputs
,
33
public
base::Object
{
34
public
:
35
typedef
ParticleTriplet
Argument
;
36
typedef
ParticleIndexTriplet
IndexArgument
;
37
TripletPredicate
(std::string name =
"TripletPredicate %1%"
);
38
/** \deprecated_at{2.1} Use the index based version.*/
39
IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
40
virtual
int
get_value(
const
ParticleTriplet
& vt)
const
;
41
42
/** \deprecated_at{2.1} Use the index based version.*/
43
IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
44
virtual
Ints
get_value(
const
ParticleTripletsTemp
&o)
const
;
45
46
#if !defined(IMP_DOXYGEN) && !defined(SWIG)
47
virtual
void
remove_if_equal(
kernel::Model
*m,
ParticleIndexTriplets
&ps,
int
v)
const
;
48
virtual
void
remove_if_not_equal(
kernel::Model
*m,
ParticleIndexTriplets
&ps,
int
v)
const
;
49
#endif
50
51
//! Compute the predicate and the derivative if needed.
52
virtual
int
get_value_index(
kernel::Model
*m,
const
ParticleIndexTriplet
& vt)
const
;
53
54
//! Enable them to be use as functors
55
/** But beware of slicing.
56
*/
57
int
operator()
(
kernel::Model
*m,
const
ParticleIndexTriplet
& vt)
const
{
58
return
get_value_index(m, vt);
59
}
60
61
virtual
Ints
get_value_index(
kernel::Model
*m,
const
ParticleIndexTriplets
&o)
const
{
62
Ints
ret(o.size());
63
for
(
unsigned
int
i = 0; i < o.size(); ++i) {
64
ret[i] += get_value_index(m, o[i]);
65
}
66
return
ret;
67
}
68
69
IMP_REF_COUNTED_DESTRUCTOR
(
TripletPredicate
);
70
};
71
72
IMPKERNEL_END_NAMESPACE
73
74
#endif
/* IMPKERNEL_TRIPLET_PREDICATE_H */
DerivativeAccumulator.h
Class for adding derivatives from restraints to the model.
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:
base/ref_counted_macros.h:61
IMP::base::Vector< Int >
IMP::kernel::TripletPredicate
Abstract predicate function.
Definition:
kernel/TripletPredicate.h:32
model_object_helpers.h
Single variable function.
IMP::base::Array
A class to store an fixed array of same-typed values.
Definition:
base/Array.h:33
IMP::kernel::ParticleInputs
Definition:
kernel/model_object_helpers.h:18
IMP::kernel::TripletPredicate::operator()
int operator()(kernel::Model *m, const ParticleIndexTriplet &vt) const
Enable them to be use as functors.
Definition:
kernel/TripletPredicate.h:57
IMP::base::Object
Common base class for heavy weight IMP objects.
Definition:
base/declare_Object.h:123
ParticleTuple.h
Classes to handle individual model particles.
IMP::TripletPredicate
IMP::kernel::TripletPredicate TripletPredicate
Definition:
kernel/doxygen.h:245
IMP::kernel::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
kernel/declare_Model.h:72