IMP logo
IMP Reference Guide  2.14.0
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-2020 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 
17 IMPNPCTRANSPORT_BEGIN_NAMESPACE
18 
19 //! an interaction that involves particles of two types
20 typedef std::pair<IMP::core::ParticleType, IMP::core::ParticleType>
23 
24 //! convenience method for creating and interaction type in swig
25 inline 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
34 inline 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 
60 typedef boost::unordered_set<core::ParticleType> ParticleTypeSet;
61 
62 IMPNPCTRANSPORT_END_NAMESPACE
63 
64 #ifndef SWIG
65 inline std::ostream& operator<<
66 ( std::ostream& o, IMP::npctransport::InteractionType const& it );
67 
68 inline 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 */
std::pair< IMP::core::ParticleType, IMP::core::ParticleType > InteractionType
an interaction that involves particles of two types
Definition: typedefs.h:21
A more IMP-like version of the std::vector.
Definition: Vector.h:39
A particle with a user-defined type.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
ParticleIndexPair make_unordered_particle_index_pair(ParticleIndexPair pip)
Definition: typedefs.h:55
InteractionType make_unordered_interaction_type(IMP::core::ParticleType t0, IMP::core::ParticleType t1)
Definition: typedefs.h:35
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