home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
develop.0cdeb1214d,2025/11/22
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
score_functor
version 20251122.develop.0cdeb1214d
distance_pair_score_macros.h
Go to the documentation of this file.
1
/**
2
* \file IMP/score_functor/distance_pair_score_macros.h
3
* \brief Various important macros
4
* for implementing decorators.
5
*
6
* Copyright 2007-2022 IMP Inventors. All rights reserved.
7
*
8
*/
9
10
#ifndef IMPSCORE_FUNCTOR_DISTANCE_PAIR_SCORE_MACROS_H
11
#define IMPSCORE_FUNCTOR_DISTANCE_PAIR_SCORE_MACROS_H
12
13
#include "
DistancePairScore.h
"
14
#include <cereal/access.hpp>
15
#include <cereal/types/base_class.hpp>
16
17
#if defined(SWIG) || defined(IMP_DOXYGEN)
18
/** Use this macro to define PairScores based on the
19
IMP::score_functor::DistancePairScore as it works around various
20
complications caused by SWIG.
21
22
To use it do something like
23
IMP_FUNCTOR_DISTANCE_PAIR_SCORE(DistancePairScore,
24
score_functor::UnaryFunctionEvaluate,
25
(UnaryFunction *uf, std::string name
26
= "DistancePairScore%1%"), (uf), );
27
*/
28
#define IMP_FUNCTOR_DISTANCE_PAIR_SCORE(Name, Functor, Args, PassArgs, Accessors) \
29
class Name : public IMP::PairScore { \
30
typedef IMP::score_functor::DistancePairScore<Functor> P; \
31
\
32
public: \
33
Name Args; \
34
Name() {} \
35
double evaluate_index(Model *m, \
36
const ParticleIndexPair &pip, \
37
DerivativeAccumulator *da) const; \
38
ModelObjectsTemp do_get_inputs( \
39
Model *m, const ParticleIndexes &pis) const; \
40
Accessors \
41
IMP_OBJECT_METHODS(Name); \
42
}
43
44
#else
45
#define IMP_FUNCTOR_DISTANCE_PAIR_SCORE(Name, Functor, Args, PassArgs, Accessors) \
46
class Name : public IMP::score_functor::DistancePairScore<Functor> { \
47
typedef IMP::score_functor::DistancePairScore<Functor> P; \
48
friend class cereal::access; \
49
template<class Archive> void serialize(Archive &ar) { \
50
ar(cereal::base_class< \
51
IMP::score_functor::DistancePairScore<Functor> >(this)); \
52
} \
53
IMP_OBJECT_SERIALIZE_DECL(Name); \
54
\
55
public: \
56
Name Args : P(Functor PassArgs, name) {} \
57
Name() {} \
58
Accessors \
59
IMP_OBJECT_METHODS(Name); \
60
}
61
#endif
62
63
#endif
/* IMPSCORE_FUNCTOR_DISTANCE_PAIR_SCORE_MACROS_H */
DistancePairScore.h
A Score on the distance between a pair of particles.