Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright 2005 The Trustees of Indiana University.
0002 
0003 // Use, modification and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  Authors: Douglas Gregor
0008 //           Andrew Lumsdaine
0009 
0010 #ifndef BOOST_PARALLEL_BASIC_REDUCE_HPP
0011 #define BOOST_PARALLEL_BASIC_REDUCE_HPP
0012 
0013 namespace boost { namespace parallel {
0014 
0015 /** Reduction operation used to reconcile differences between local
0016  * and remote values for a particular key in a property map.  The
0017  * type @c T is typically the @c value_type of the property
0018  * map. This basic reduction returns a default-constructed @c T as
0019  * the default value and always resolves to the remote value.
0020  */
0021 template<typename T>
0022 struct basic_reduce
0023 {
0024   BOOST_STATIC_CONSTANT(bool, non_default_resolver = false);
0025 
0026   /// Returns a default-constructed T object
0027   template<typename Key>
0028   T operator()(const Key&) const { return T(); }
0029   
0030   /// Returns the remote value
0031   template<typename Key>
0032   const T& operator()(const Key&, const T&, const T& remote) const 
0033   { return remote; }
0034 };
0035 
0036 } } // end namespace boost::parallel
0037 
0038 #endif // BOOST_PARALLEL_BASIC_REDUCE_HPP