IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
typedefs.h
Go to the documentation of this file.
1/**
2 * \file typedefs.h
3 * \brief description
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 */
7
8#ifndef IMPNPCTRANSPORT_TYPEDEFS_H
9#define IMPNPCTRANSPORT_TYPEDEFS_H
10
11#include "npctransport_config.h"
12#include <IMP/core/Typed.h>
13#include <boost/unordered_set.hpp>
14#include <utility>
15#include <iostream>
16
17IMPNPCTRANSPORT_BEGIN_NAMESPACE
18
19//! an interaction that involves particles of two types
20typedef std::pair<IMP::core::ParticleType, IMP::core::ParticleType>
23
24//! convenience method for creating and interaction type in swig
25inline IMPNPCTRANSPORTEXPORT
28{
29 return InteractionType(t0,t1);
30}
31
32//! an interaction type canonized to (t0,t1) s.t. t0 >= t1,
33//! so order doesn't matter
34inline IMPNPCTRANSPORTEXPORT
37{
38 return (t0 >= t1) ? InteractionType(t0,t1) : InteractionType(t1,t0);
39}
40
41
42//! ParticleIndexPair canonized to (pi0',pi1') s.t. pi0' >= pi1'
43//! so order doesn't matter
46{
47 return (pi0 >= pi1)
48 ? ParticleIndexPair(pi0, pi1)
49 : ParticleIndexPair(pi1, pi0);
50}
51
52//! ParticleIndexPair canonized to (pi0',pi1') s.t. pi0' >= pi1'
53//! so order doesn't matter
56{
57 return make_unordered_particle_index_pair(pip[0], pip[1]);
58}
59
60typedef boost::unordered_set<core::ParticleType> ParticleTypeSet;
61
62IMPNPCTRANSPORT_END_NAMESPACE
63
64#ifndef SWIG
65inline std::ostream& operator<<
66( std::ostream& o, IMP::npctransport::InteractionType const& it );
67
68inline std::ostream& operator<<
69( std::ostream& o, IMP::npctransport::InteractionType const& it )
70{
71 o << "(" << it.first << "," << it.second << ")";
72 return o;
73}
74#endif
75
76
77#endif /* IMPNPCTRANSPORT_TYPEDEFS_H */
A particle with a user-defined type.
Key< 34897493 > ParticleType
An IMP::Key object for identifying types of particles by strings.
Definition Typed.h:28
InteractionType make_unordered_interaction_type(IMP::core::ParticleType t0, IMP::core::ParticleType t1)
Definition typedefs.h:35
std::pair< IMP::core::ParticleType, IMP::core::ParticleType > InteractionType
an interaction that involves particles of two types
Definition typedefs.h:21
IMP::Vector< InteractionType > InteractionTypes
Definition typedefs.h:22
IMP::ParticleIndexPair make_unordered_particle_index_pair(IMP::ParticleIndex pi0, IMP::ParticleIndex pi1)
Definition typedefs.h:45
InteractionType make_ordered_interaction_type(IMP::core::ParticleType t0, IMP::core::ParticleType t1)
convenience method for creating and interaction type in swig
Definition typedefs.h:26
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
Definition base_types.h:202
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.