home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.5.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Modules
Classes
Examples
include
IMP
PairPredicate.h
Go to the documentation of this file.
1
// Autogenerated by ../../../../tmp/nightly-build-6636/imp-2.5.0/tools/build/make_containers.py
2
// from ../../../../tmp/nightly-build-6636/imp-2.5.0/tools/build/container_templates/kernel/ClassnamePredicate.h
3
// Do not edit - any changes will be lost!
4
5
/**
6
* \file IMP/PairPredicate.h
7
* \brief Define PairPredicate.
8
*
9
* Copyright 2007-2015 IMP Inventors. All rights reserved.
10
*/
11
12
#ifndef IMPKERNEL_PAIR_PREDICATE_H
13
#define IMPKERNEL_PAIR_PREDICATE_H
14
15
#include <IMP/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). PairPredicates will evaluate the predicate for the passed
28
particles.
29
30
Implementers should check out IMP_PAIR_PREDICATE().
31
*/
32
class
IMPKERNELEXPORT
PairPredicate
:
public
ParticleInputs
,
33
public
Object
{
34
public
:
35
typedef
ParticlePair
Argument
;
36
typedef
ParticleIndexPair
IndexArgument
;
37
PairPredicate
(std::string name =
"PairPredicate %1%"
);
38
/** \deprecated_at{2.1} Use the index based version.*/
39
IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
40
virtual
int
get_value(
const
ParticlePair
& 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
ParticlePairsTemp
&o)
const
;
45
46
#if !defined(IMP_DOXYGEN) && !defined(SWIG)
47
virtual
void
remove_if_equal(
Model
*m,
ParticleIndexPairs
&ps,
48
int
v)
const
;
49
virtual
void
remove_if_not_equal(
Model
*m,
ParticleIndexPairs
&ps,
50
int
v)
const
;
51
#endif
52
53
//! Compute the predicate and the derivative if needed.
54
virtual
int
get_value_index(
Model
*m,
const
ParticleIndexPair
& vt)
const
;
55
56
//! Enable them to be use as functors
57
/** But beware of slicing.
58
*/
59
int
operator()
(
Model
*m,
const
ParticleIndexPair
& vt)
const
{
60
return
get_value_index(m, vt);
61
}
62
63
virtual
Ints
get_value_index(
Model
*m,
64
const
ParticleIndexPairs
&o)
const
{
65
Ints
ret(o.size());
66
for
(
unsigned
int
i = 0; i < o.size(); ++i) {
67
ret[i] += get_value_index(m, o[i]);
68
}
69
return
ret;
70
}
71
72
IMP_REF_COUNTED_DESTRUCTOR
(PairPredicate);
73
};
74
75
IMPKERNEL_END_NAMESPACE
76
77
#endif
/* IMPKERNEL_PAIR_PREDICATE_H */
IMP::Array
A class to store an fixed array of same-typed values.
Definition:
Array.h:33
IMP::PairPredicate::operator()
int operator()(Model *m, const ParticleIndexPair &vt) const
Enable them to be use as functors.
Definition:
PairPredicate.h:59
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
ParticleTuple.h
Classes to handle individual model particles.
IMP::Vector< Int >
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
model_object_helpers.h
Single variable function.
IMP::PairPredicate
Abstract predicate function.
Definition:
PairPredicate.h:32