PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/graph/parallel/basic_reduce.hpp

http://hadesmem.googlecode.com/
C++ Header | 42 lines | 18 code | 10 blank | 14 comment | 0 complexity | f84e07437a7a2d6bff1771379a5d3368 MD5 | raw file
 1// Copyright 2005 The Trustees of Indiana University.
 2
 3// Use, modification and distribution is subject to the Boost Software
 4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 5// http://www.boost.org/LICENSE_1_0.txt)
 6
 7//  Authors: Douglas Gregor
 8//           Andrew Lumsdaine
 9
10#ifndef BOOST_PARALLEL_BASIC_REDUCE_HPP
11#define BOOST_PARALLEL_BASIC_REDUCE_HPP
12
13#ifndef BOOST_GRAPH_USE_MPI
14#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
15#endif
16
17namespace boost { namespace parallel {
18
19/** Reduction operation used to reconcile differences between local
20 * and remote values for a particular key in a property map.  The
21 * type @c T is typically the @c value_type of the property
22 * map. This basic reduction returns a default-constructed @c T as
23 * the default value and always resolves to the remote value.
24 */
25template<typename T>
26struct basic_reduce
27{
28  BOOST_STATIC_CONSTANT(bool, non_default_resolver = false);
29
30  /// Returns a default-constructed T object
31  template<typename Key>
32  T operator()(const Key&) const { return T(); }
33  
34  /// Returns the remote value
35  template<typename Key>
36  const T& operator()(const Key&, const T&, const T& remote) const 
37  { return remote; }
38};
39
40} } // end namespace boost::parallel
41
42#endif // BOOST_PARALLEL_BASIC_REDUCE_HPP