~ubuntu-branches/ubuntu/saucy/deal.ii/saucy

« back to all changes in this revision

Viewing changes to contrib/boost-1.46.1/include/boost/graph/parallel/algorithm.hpp

  • Committer: Package Import Robot
  • Author(s): "Adam C. Powell, IV", Adam C. Powell, IV, Christophe Trophime
  • Date: 2012-02-21 06:57:30 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120221065730-r2iz70lg557wcd2e
Tags: 7.1.0-1
[ Adam C. Powell, IV ]
* New upstream (closes: #652057).
* Updated to use PETSc and SLEPc 3.2, and forward-ported all patches.
* Removed NetCDF Build-Depends because it uses serial HDF5.
* Made Sacado cmath patch work with new configure.
* Moved -dev package symlink lines in rules to arch all section.

[ Christophe Trophime ]
* debian/rules:
   - add dh_strip --dbg-package to generate dbg package (closes: #652058)
   - add .install files to simplify rules
* Add support for mumps, arpack (closes: #637655)
* Add patch for slepc 3.2 (closes: #659245)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2004 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
#ifndef BOOST_PARALLEL_ALGORITHM_HPP
 
10
#define BOOST_PARALLEL_ALGORITHM_HPP
 
11
 
 
12
#ifndef BOOST_GRAPH_USE_MPI
 
13
#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
 
14
#endif
 
15
 
 
16
#include <boost/optional.hpp>
 
17
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT
 
18
#include <vector>
 
19
#include <functional>
 
20
 
 
21
namespace boost { namespace parallel {
 
22
  template<typename BinaryOp>
 
23
  struct is_commutative
 
24
  {
 
25
    BOOST_STATIC_CONSTANT(bool, value = false);
 
26
  };
 
27
 
 
28
  template<typename T>
 
29
  struct minimum : std::binary_function<T, T, T>
 
30
  {
 
31
    const T& operator()(const T& x, const T& y) const { return x < y? x : y; }
 
32
  };
 
33
 
 
34
  template<typename T>
 
35
  struct maximum : std::binary_function<T, T, T>
 
36
  {
 
37
    const T& operator()(const T& x, const T& y) const { return x < y? y : x; }
 
38
  };
 
39
 
 
40
  template<typename T>
 
41
  struct sum : std::binary_function<T, T, T>
 
42
  {
 
43
    const T operator()(const T& x, const T& y) const { return x + y; }
 
44
  };
 
45
 
 
46
  template<typename ProcessGroup, typename InputIterator,
 
47
           typename OutputIterator, typename BinaryOperation>
 
48
  OutputIterator
 
49
  reduce(ProcessGroup pg, typename ProcessGroup::process_id_type root,
 
50
         InputIterator first, InputIterator last, OutputIterator out,
 
51
         BinaryOperation bin_op);
 
52
 
 
53
  template<typename ProcessGroup, typename T, typename BinaryOperation>
 
54
  inline T
 
55
  all_reduce(ProcessGroup pg, const T& value, BinaryOperation bin_op)
 
56
  {
 
57
    T result;
 
58
    all_reduce(pg,
 
59
               const_cast<T*>(&value), const_cast<T*>(&value+1),
 
60
               &result, bin_op);
 
61
    return result;
 
62
  }
 
63
 
 
64
  template<typename ProcessGroup, typename T, typename BinaryOperation>
 
65
  inline T
 
66
  scan(ProcessGroup pg, const T& value, BinaryOperation bin_op)
 
67
  {
 
68
    T result;
 
69
    scan(pg,
 
70
         const_cast<T*>(&value), const_cast<T*>(&value+1),
 
71
         &result, bin_op);
 
72
    return result;
 
73
  }
 
74
 
 
75
 
 
76
  template<typename ProcessGroup, typename InputIterator, typename T>
 
77
  void
 
78
  all_gather(ProcessGroup pg, InputIterator first, InputIterator last,
 
79
             std::vector<T>& out);
 
80
} } // end namespace boost::parallel
 
81
 
 
82
#include <boost/graph/parallel/detail/inplace_all_to_all.hpp>
 
83
 
 
84
#endif // BOOST_PARALLEL_ALGORITHM_HPP