Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:16

0001 // Copyright (C) Vladimir Prus 2003.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 //
0006 // See http://www.boost.org/libs/graph/vector_property_map.html for
0007 // documentation.
0008 //
0009 
0010 #ifndef BOOST_PROPERTY_MAP_PARALLEL_VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
0011 #define BOOST_PROPERTY_MAP_PARALLEL_VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04
0012 
0013 #include <boost/property_map/property_map.hpp>
0014 #include <boost/shared_ptr.hpp>
0015 #include <vector>
0016 #include <boost/property_map/parallel/distributed_property_map.hpp>
0017 #include <boost/property_map/parallel/local_property_map.hpp>
0018 
0019 namespace boost {
0020 
0021 /** Distributed vector property map.
0022  *
0023  * This specialization of @ref vector_property_map builds a
0024  * distributed vector property map given the local index maps
0025  * generated by distributed graph types that automatically have index
0026  * properties. 
0027  *
0028  * This specialization is useful when creating external distributed
0029  * property maps via the same syntax used to create external
0030  * sequential property maps.
0031  */
0032 template<typename T, typename ProcessGroup, typename GlobalMap, 
0033          typename StorageMap>
0034 class vector_property_map<T, 
0035                           local_property_map<ProcessGroup, GlobalMap,
0036                                              StorageMap> >
0037   : public parallel::distributed_property_map<
0038              ProcessGroup, GlobalMap, vector_property_map<T, StorageMap> >
0039 {
0040   typedef vector_property_map<T, StorageMap> local_iterator_map;
0041 
0042   typedef parallel::distributed_property_map<ProcessGroup, GlobalMap, 
0043                                              local_iterator_map> inherited;
0044 
0045   typedef local_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type;
0046 
0047 public:
0048   vector_property_map(const index_map_type& index = index_map_type())
0049     : inherited(index.process_group(), index.global(),
0050                 local_iterator_map(index.base())) { }
0051 
0052   vector_property_map(unsigned inital_size, 
0053                       const index_map_type& index = index_map_type())
0054     : inherited(index.process_group(),  index.global(),
0055                 local_iterator_map(inital_size, index.base())) { }
0056 };
0057 
0058 /** Distributed vector property map.
0059  *
0060  * This specialization of @ref vector_property_map builds a
0061  * distributed vector property map given the local index maps
0062  * generated by distributed graph types that automatically have index
0063  * properties. 
0064  *
0065  * This specialization is useful when creating external distributed
0066  * property maps via the same syntax used to create external
0067  * sequential property maps.
0068  */
0069 template<typename T, typename ProcessGroup, typename GlobalMap, 
0070          typename StorageMap>
0071 class vector_property_map<
0072         T, 
0073         parallel::distributed_property_map<
0074           ProcessGroup,
0075           GlobalMap,
0076           StorageMap
0077         >
0078       > 
0079   : public parallel::distributed_property_map<
0080              ProcessGroup, GlobalMap, vector_property_map<T, StorageMap> >
0081 {
0082   typedef vector_property_map<T, StorageMap> local_iterator_map;
0083 
0084   typedef parallel::distributed_property_map<ProcessGroup, GlobalMap, 
0085                                              local_iterator_map> inherited;
0086 
0087   typedef parallel::distributed_property_map<ProcessGroup, GlobalMap, 
0088                                              StorageMap>
0089     index_map_type;
0090 
0091 public:
0092   vector_property_map(const index_map_type& index = index_map_type())
0093     : inherited(index.process_group(), index.global(),
0094                 local_iterator_map(index.base())) { }
0095 
0096   vector_property_map(unsigned inital_size, 
0097                       const index_map_type& index = index_map_type())
0098     : inherited(index.process_group(), index.global(),
0099                 local_iterator_map(inital_size, index.base())) { }
0100 };
0101 
0102 }
0103 
0104 #endif // BOOST_PROPERTY_MAP_PARALLEL_VECTOR_PROPERTY_MAP_HPP_VP_2003_03_04