File indexing completed on 2025-01-18 09:50:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP
0012 #define BOOST_PROPERTY_MAP_PARALLEL_PROPERTY_MAPS_HPP
0013
0014
0015
0016
0017
0018 #include <boost/assert.hpp>
0019 #include <boost/config.hpp>
0020 #include <boost/static_assert.hpp>
0021 #include <cstddef>
0022 #include <boost/concept_archetype.hpp>
0023 #include <boost/mpl/assert.hpp>
0024 #include <boost/mpl/or.hpp>
0025 #include <boost/mpl/and.hpp>
0026 #include <boost/mpl/has_xxx.hpp>
0027 #include <boost/type_traits/is_same.hpp>
0028 #include <boost/property_map/property_map.hpp>
0029
0030 #include <boost/property_map/parallel/distributed_property_map.hpp>
0031 #include <boost/property_map/parallel/local_property_map.hpp>
0032
0033 namespace boost {
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045 template<typename RandomAccessIterator, typename ProcessGroup,
0046 typename GlobalMap, typename StorageMap,
0047 typename ValueType, typename Reference>
0048 class iterator_property_map
0049 <RandomAccessIterator,
0050 local_property_map<ProcessGroup, GlobalMap, StorageMap>,
0051 ValueType, Reference>
0052 : public parallel::distributed_property_map
0053 <ProcessGroup,
0054 GlobalMap,
0055 iterator_property_map<RandomAccessIterator, StorageMap,
0056 ValueType, Reference> >
0057 {
0058 typedef iterator_property_map<RandomAccessIterator, StorageMap,
0059 ValueType, Reference> local_iterator_map;
0060
0061 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
0062 local_iterator_map> inherited;
0063
0064 typedef local_property_map<ProcessGroup, GlobalMap, StorageMap>
0065 index_map_type;
0066 typedef iterator_property_map self_type;
0067
0068 public:
0069 iterator_property_map() { }
0070
0071 iterator_property_map(RandomAccessIterator cc, const index_map_type& id)
0072 : inherited(id.process_group(), id.global(),
0073 local_iterator_map(cc, id.base())) { }
0074 };
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 template<typename RandomAccessIterator, typename ProcessGroup,
0088 typename GlobalMap, typename StorageMap,
0089 typename ValueType, typename Reference>
0090 class iterator_property_map<
0091 RandomAccessIterator,
0092 parallel::distributed_property_map<ProcessGroup,GlobalMap,StorageMap>,
0093 ValueType, Reference
0094 >
0095 : public parallel::distributed_property_map
0096 <ProcessGroup,
0097 GlobalMap,
0098 iterator_property_map<RandomAccessIterator, StorageMap,
0099 ValueType, Reference> >
0100 {
0101 typedef iterator_property_map<RandomAccessIterator, StorageMap,
0102 ValueType, Reference> local_iterator_map;
0103
0104 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
0105 local_iterator_map> inherited;
0106
0107 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
0108 StorageMap>
0109 index_map_type;
0110
0111 public:
0112 iterator_property_map() { }
0113
0114 iterator_property_map(RandomAccessIterator cc, const index_map_type& id)
0115 : inherited(id.process_group(), id.global(),
0116 local_iterator_map(cc, id.base())) { }
0117 };
0118
0119 namespace parallel {
0120
0121
0122 template<typename RandomAccessIterator, typename ProcessGroup,
0123 typename GlobalMap, typename StorageMap>
0124 distributed_property_map<ProcessGroup,
0125 GlobalMap,
0126 iterator_property_map<RandomAccessIterator,
0127 StorageMap> >
0128 make_iterator_property_map(RandomAccessIterator cc,
0129 local_property_map<ProcessGroup, GlobalMap,
0130 StorageMap> index_map)
0131 {
0132 typedef distributed_property_map<
0133 ProcessGroup, GlobalMap,
0134 iterator_property_map<RandomAccessIterator, StorageMap> >
0135 result_type;
0136 return result_type(index_map.process_group(), index_map.global(),
0137 make_iterator_property_map(cc, index_map.base()));
0138 }
0139
0140 }
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153 template<typename RandomAccessIterator, typename ProcessGroup,
0154 typename GlobalMap, typename StorageMap, typename ValueType,
0155 typename Reference>
0156 class safe_iterator_property_map
0157 <RandomAccessIterator,
0158 local_property_map<ProcessGroup, GlobalMap, StorageMap>,
0159 ValueType, Reference>
0160 : public parallel::distributed_property_map
0161 <ProcessGroup,
0162 GlobalMap,
0163 safe_iterator_property_map<RandomAccessIterator, StorageMap,
0164 ValueType, Reference> >
0165 {
0166 typedef safe_iterator_property_map<RandomAccessIterator, StorageMap,
0167 ValueType, Reference> local_iterator_map;
0168
0169 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
0170 local_iterator_map> inherited;
0171
0172 typedef local_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type;
0173
0174 public:
0175 safe_iterator_property_map() { }
0176
0177 safe_iterator_property_map(RandomAccessIterator cc, std::size_t n,
0178 const index_map_type& id)
0179 : inherited(id.process_group(), id.global(),
0180 local_iterator_map(cc, n, id.base())) { }
0181 };
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194 template<typename RandomAccessIterator, typename ProcessGroup,
0195 typename GlobalMap, typename StorageMap,
0196 typename ValueType, typename Reference>
0197 class safe_iterator_property_map<
0198 RandomAccessIterator,
0199 parallel::distributed_property_map<ProcessGroup,GlobalMap,StorageMap>,
0200 ValueType, Reference>
0201 : public parallel::distributed_property_map
0202 <ProcessGroup,
0203 GlobalMap,
0204 safe_iterator_property_map<RandomAccessIterator, StorageMap,
0205 ValueType, Reference> >
0206 {
0207 typedef safe_iterator_property_map<RandomAccessIterator, StorageMap,
0208 ValueType, Reference> local_iterator_map;
0209
0210 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
0211 local_iterator_map> inherited;
0212
0213 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
0214 StorageMap>
0215 index_map_type;
0216
0217 public:
0218 safe_iterator_property_map() { }
0219
0220 safe_iterator_property_map(RandomAccessIterator cc, std::size_t n,
0221 const index_map_type& id)
0222 : inherited(id.process_group(), id.global(),
0223 local_iterator_map(cc, n, id.base())) { }
0224 };
0225
0226 }
0227
0228 #include <boost/property_map/vector_property_map.hpp>
0229 #include <boost/property_map/parallel/vector_property_map.hpp>
0230
0231 #endif