1 // <numeric> parallel extensions -*- C++ -*-
3 // Copyright (C) 2007, 2008 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the terms
7 // of the GNU General Public License as published by the Free Software
8 // Foundation; either version 2, or (at your option) any later
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this library; see the file COPYING. If not, write to
18 // the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19 // MA 02111-1307, USA.
21 // As a special exception, you may use this file as part of a free
22 // software library without restriction. Specifically, if other files
23 // instantiate templates or use macros or inline functions from this
24 // file, or you compile this file and link it with other files to
25 // produce an executable, this file does not by itself cause the
26 // resulting executable to be covered by the GNU General Public
27 // License. This exception does not however invalidate any other
28 // reasons why the executable file might be covered by the GNU General
31 /** @file parallel/numericfwd.h
32 * This file is a GNU parallel extension to the Standard C++ Library.
35 #ifndef _GLIBCXX_PARALLEL_NUMERICFWD_H
36 #define _GLIBCXX_PARALLEL_NUMERICFWD_H 1
38 #pragma GCC system_header
40 #include <parallel/tags.h>
41 #include <parallel/settings.h>
47 template<typename _IIter, typename _Tp>
49 accumulate(_IIter, _IIter, _Tp);
51 template<typename _IIter, typename _Tp>
53 accumulate(_IIter, _IIter, _Tp, __gnu_parallel::sequential_tag);
55 template<typename _IIter, typename _Tp>
57 accumulate(_IIter, _IIter, _Tp, __gnu_parallel::_Parallelism);
59 template<typename _IIter, typename _Tp, typename _Tag>
61 accumulate_switch(_IIter, _IIter, _Tp, _Tag);
63 template<typename _IIter, typename _Tp, typename _BinaryOper>
65 accumulate(_IIter, _IIter, _Tp, _BinaryOper);
67 template<typename _IIter, typename _Tp, typename _BinaryOper>
69 accumulate(_IIter, _IIter, _Tp, _BinaryOper,
70 __gnu_parallel::sequential_tag);
72 template<typename _IIter, typename _Tp, typename _BinaryOper>
74 accumulate(_IIter, _IIter, _Tp, _BinaryOper,
75 __gnu_parallel::_Parallelism);
77 template<typename _IIter, typename _Tp, typename _BinaryOper,
80 accumulate_switch(_IIter, _IIter, _Tp, _BinaryOper, _Tag);
82 template<typename _RAIter, typename _Tp, typename _BinaryOper>
84 accumulate_switch(_RAIter, _RAIter, _Tp, _BinaryOper,
85 random_access_iterator_tag,
86 __gnu_parallel::_Parallelism);
88 template<typename _IIter, typename _OIter>
90 adjacent_difference(_IIter, _IIter, _OIter);
92 template<typename _IIter, typename _OIter, typename _BinaryOper>
94 adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper);
96 template<typename _IIter, typename _OIter>
98 adjacent_difference(_IIter, _IIter, _OIter,
99 __gnu_parallel::sequential_tag);
101 template<typename _IIter, typename _OIter, typename _BinaryOper>
103 adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper,
104 __gnu_parallel::sequential_tag);
106 template<typename _IIter, typename _OIter>
108 adjacent_difference(_IIter, _IIter, _OIter,
109 __gnu_parallel::_Parallelism);
111 template<typename _IIter, typename _OIter, typename _BinaryOper>
113 adjacent_difference(_IIter, _IIter, _OIter, _BinaryOper,
114 __gnu_parallel::_Parallelism);
116 template<typename _IIter, typename _OIter, typename _BinaryOper,
117 typename _Tag1, typename _Tag2>
119 adjacent_difference_switch(_IIter, _IIter, _OIter, _BinaryOper,
122 template<typename _IIter, typename _OIter, typename _BinaryOper>
124 adjacent_difference_switch(_IIter, _IIter, _OIter, _BinaryOper,
125 random_access_iterator_tag,
126 random_access_iterator_tag,
127 __gnu_parallel::_Parallelism);
129 template<typename _IIter1, typename _IIter2, typename _Tp>
131 inner_product(_IIter1, _IIter1, _IIter2, _Tp);
133 template<typename _IIter1, typename _IIter2, typename _Tp>
135 inner_product(_IIter1, _IIter1, _IIter2, _Tp,
136 __gnu_parallel::sequential_tag);
138 template<typename _IIter1, typename _IIter2, typename _Tp>
140 inner_product(_IIter1, _IIter1, _IIter2, _Tp,
141 __gnu_parallel::_Parallelism);
143 template<typename _IIter1, typename _IIter2, typename _Tp,
144 typename _BinaryFunction1, typename _BinaryFunction2>
146 inner_product(_IIter1, _IIter1, _IIter2, _Tp,
147 _BinaryFunction1, _BinaryFunction2);
149 template<typename _IIter1, typename _IIter2, typename _Tp,
150 typename _BinaryFunction1, typename _BinaryFunction2>
152 inner_product(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1,
153 _BinaryFunction2, __gnu_parallel::sequential_tag);
155 template<typename _IIter1, typename _IIter2, typename _Tp,
156 typename BinaryFunction1, typename BinaryFunction2>
158 inner_product(_IIter1, _IIter1, _IIter2, _Tp, BinaryFunction1,
159 BinaryFunction2, __gnu_parallel::_Parallelism);
161 template<typename _RAIter1, typename _RAIter2, typename _Tp,
162 typename BinaryFunction1, typename BinaryFunction2>
164 inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, BinaryFunction1,
165 BinaryFunction2, random_access_iterator_tag,
166 random_access_iterator_tag,
167 __gnu_parallel::_Parallelism);
169 template<typename _IIter1, typename _IIter2, typename _Tp,
170 typename _BinaryFunction1, typename _BinaryFunction2,
171 typename _Tag1, typename _Tag2>
173 inner_product_switch(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1,
174 _BinaryFunction2, _Tag1, _Tag2);
177 template<typename _IIter, typename _OIter>
179 partial_sum(_IIter, _IIter, _OIter, __gnu_parallel::sequential_tag);
181 template<typename _IIter, typename _OIter, typename _BinaryOper>
183 partial_sum(_IIter, _IIter, _OIter, _BinaryOper,
184 __gnu_parallel::sequential_tag);
186 template<typename _IIter, typename _OIter>
188 partial_sum(_IIter, _IIter, _OIter result);
190 template<typename _IIter, typename _OIter, typename _BinaryOper>
192 partial_sum(_IIter, _IIter, _OIter, _BinaryOper);
194 template<typename _IIter, typename _OIter, typename _BinaryOper,
195 typename _Tag1, typename _Tag2>
197 partial_sum_switch(_IIter, _IIter, _OIter, _BinaryOper, _Tag1, _Tag2);
199 template<typename _IIter, typename _OIter, typename _BinaryOper>
201 partial_sum_switch(_IIter, _IIter, _OIter, _BinaryOper,
202 random_access_iterator_tag, random_access_iterator_tag);