![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/include/boost/graph/distributed/ |
Upload File : |
// Copyright (C) 2006 The Trustees of Indiana University. // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Authors: Douglas Gregor // Jeremiah Willcock // Andrew Lumsdaine // Distributed version of the two-bit color map #ifndef BOOST_DISTRIBUTED_TWO_BIT_COLOR_MAP_HPP #define BOOST_DISTRIBUTED_TWO_BIT_COLOR_MAP_HPP #ifndef BOOST_GRAPH_USE_MPI #error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included" #endif #include <boost/graph/two_bit_color_map.hpp> #include <boost/property_map/parallel/distributed_property_map.hpp> #include <boost/property_map/parallel/local_property_map.hpp> namespace boost { template<typename ProcessGroup, typename GlobalMap, typename StorageMap> class two_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> > : public parallel::distributed_property_map<ProcessGroup, GlobalMap, two_bit_color_map<StorageMap> > { typedef two_bit_color_map<StorageMap> local_map; typedef parallel::distributed_property_map<ProcessGroup, GlobalMap, local_map > inherited; typedef local_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type; public: two_bit_color_map(std::size_t inital_size, const index_map_type& index = index_map_type()) : inherited(index.process_group(), index.global(), local_map(inital_size, index.base())) { } inherited& base() { return *this; } const inherited& base() const { return *this; } }; template<typename ProcessGroup, typename GlobalMap, typename StorageMap> inline two_bit_color_type get(two_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> > const& pm, typename property_traits<GlobalMap>::key_type key) { return get(pm.base(), key); } template<typename ProcessGroup, typename GlobalMap, typename StorageMap> inline void put(two_bit_color_map<local_property_map<ProcessGroup,GlobalMap,StorageMap> > const& pm, typename property_traits<GlobalMap>::key_type key, two_bit_color_type value) { put(pm.base(), key, value); } template<typename ProcessGroup, typename GlobalMap, typename StorageMap> class two_bit_color_map<parallel::distributed_property_map< ProcessGroup, GlobalMap, StorageMap> > : public parallel::distributed_property_map< ProcessGroup, GlobalMap, two_bit_color_map<StorageMap> > { typedef two_bit_color_map<StorageMap> local_map; typedef parallel::distributed_property_map<ProcessGroup,GlobalMap,local_map> inherited; typedef parallel::distributed_property_map<ProcessGroup, GlobalMap, StorageMap> index_map_type; public: two_bit_color_map(std::size_t inital_size, const index_map_type& index = index_map_type()) : inherited(index.process_group(), index.global(), local_map(inital_size, index.base())) { } inherited& base() { return *this; } const inherited& base() const { return *this; } }; template<typename ProcessGroup, typename GlobalMap, typename StorageMap> inline two_bit_color_type get(two_bit_color_map< parallel::distributed_property_map< ProcessGroup, GlobalMap, two_bit_color_map<StorageMap> > > const& pm, typename property_traits<GlobalMap>::key_type key) { return get(pm.base(), key); } template<typename ProcessGroup, typename GlobalMap, typename StorageMap> inline void put(two_bit_color_map< parallel::distributed_property_map< ProcessGroup, GlobalMap, two_bit_color_map<StorageMap> > > const& pm, typename property_traits<GlobalMap>::key_type key, two_bit_color_type value) { put(pm.base(), key, value); } } // end namespace boost #endif // BOOST_DISTRIBUTED_TWO_BIT_COLOR_MAP_HPP