1 // Copyright (C) Vladimir Prus 2003.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/graph/vector_property_map.html for
10 #ifndef BOOST_PROPERTY_MAP_PARALLEL_VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
11 #define BOOST_PROPERTY_MAP_PARALLEL_VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
13 #include <boost/property_map/property_map.hpp>
14 #include <boost/shared_ptr.hpp>
16 #include <boost/property_map/parallel/distributed_property_map.hpp>
17 #include <boost/property_map/parallel/local_property_map.hpp>
21 /** Distributed vector property map.
23 * This specialization of @ref vector_property_map builds a
24 * distributed vector property map given the local index maps
25 * generated by distributed graph types that automatically have index
28 * This specialization is useful when creating external distributed
29 * property maps via the same syntax used to create external
30 * sequential property maps.
32 template<typename T, typename ProcessGroup, typename GlobalMap,
34 class vector_property_map<T,
35 local_property_map<ProcessGroup, GlobalMap,
37 : public parallel::distributed_property_map<
38 ProcessGroup, GlobalMap, vector_property_map<T, StorageMap> >
40 typedef vector_property_map<T, StorageMap> local_iterator_map;
42 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
43 local_iterator_map> inherited;
45 typedef local_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type;
48 vector_property_map(const index_map_type& index = index_map_type())
49 : inherited(index.process_group(), index.global(),
50 local_iterator_map(index.base())) { }
52 vector_property_map(unsigned inital_size,
53 const index_map_type& index = index_map_type())
54 : inherited(index.process_group(), index.global(),
55 local_iterator_map(inital_size, index.base())) { }
58 /** Distributed vector property map.
60 * This specialization of @ref vector_property_map builds a
61 * distributed vector property map given the local index maps
62 * generated by distributed graph types that automatically have index
65 * This specialization is useful when creating external distributed
66 * property maps via the same syntax used to create external
67 * sequential property maps.
69 template<typename T, typename ProcessGroup, typename GlobalMap,
71 class vector_property_map<
73 parallel::distributed_property_map<
79 : public parallel::distributed_property_map<
80 ProcessGroup, GlobalMap, vector_property_map<T, StorageMap> >
82 typedef vector_property_map<T, StorageMap> local_iterator_map;
84 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
85 local_iterator_map> inherited;
87 typedef parallel::distributed_property_map<ProcessGroup, GlobalMap,
92 vector_property_map(const index_map_type& index = index_map_type())
93 : inherited(index.process_group(), index.global(),
94 local_iterator_map(index.base())) { }
96 vector_property_map(unsigned inital_size,
97 const index_map_type& index = index_map_type())
98 : inherited(index.process_group(), index.global(),
99 local_iterator_map(inital_size, index.base())) { }
104 #endif // BOOST_PROPERTY_MAP_PARALLEL_VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04