Commit 31380bc4 by Paolo Carlini Committed by Paolo Carlini

base.h (decode2): Rename to __decode2.

2010-01-11  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/parallel/base.h (decode2): Rename to __decode2.
	(binder2nd): Likewise to __binder2nd.
	* include/parallel/quicksort.h: Adjust callers.
	* include/parallel/balanced_quicksort.h: Likewise.
	* include/parallel/partition.h: Likewise.
	* include/parallel/queue.h: Likewise.

	* include/parallel/algo.h: Qualify with std:: binder2nd use.

From-SVN: r155825
parent 3383f24d
2010-01-11 Paolo Carlini <paolo.carlini@oracle.com>
* include/parallel/base.h (decode2): Rename to __decode2.
(binder2nd): Likewise to __binder2nd.
* include/parallel/quicksort.h: Adjust callers.
* include/parallel/balanced_quicksort.h: Likewise.
* include/parallel/partition.h: Likewise.
* include/parallel/queue.h: Likewise.
* include/parallel/algo.h: Qualify with std:: binder2nd use.
2010-01-10 Paolo Carlini <paolo.carlini@oracle.com> 2010-01-10 Paolo Carlini <paolo.carlini@oracle.com>
* include/debug/string (basic_string<>::basic_string(basic_string&&), * include/debug/string (basic_string<>::basic_string(basic_string&&),
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms // software; you can redistribute it and/or modify it under the terms
...@@ -150,7 +150,7 @@ namespace __parallel ...@@ -150,7 +150,7 @@ namespace __parallel
if (_GLIBCXX_PARALLEL_CONDITION(true)) if (_GLIBCXX_PARALLEL_CONDITION(true))
{ {
binder2nd<__gnu_parallel::_EqualTo<_ValueType, const _Tp&> > std::binder2nd<__gnu_parallel::_EqualTo<_ValueType, const _Tp&> >
__comp(__gnu_parallel::_EqualTo<_ValueType, const _Tp&>(), __val); __comp(__gnu_parallel::_EqualTo<_ValueType, const _Tp&>(), __val);
return __gnu_parallel::__find_template( return __gnu_parallel::__find_template(
__begin, __end, __begin, __comp, __begin, __end, __begin, __comp,
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms // software; you can redistribute it and/or modify it under the terms
...@@ -135,7 +135,7 @@ namespace __gnu_parallel ...@@ -135,7 +135,7 @@ namespace __gnu_parallel
std::swap(*__pivot_pos, *(__end - 1)); std::swap(*__pivot_pos, *(__end - 1));
__pivot_pos = __end - 1; __pivot_pos = __end - 1;
__gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool> __gnu_parallel::__binder2nd<_Compare, _ValueType, _ValueType, bool>
__pred(__comp, *__pivot_pos); __pred(__comp, *__pivot_pos);
// Divide, returning __end - __begin - 1 in the worst case. // Divide, returning __end - __begin - 1 in the worst case.
...@@ -287,7 +287,7 @@ namespace __gnu_parallel ...@@ -287,7 +287,7 @@ namespace __gnu_parallel
std::swap(*__pivot_pos, *(__end - 1)); std::swap(*__pivot_pos, *(__end - 1));
__pivot_pos = __end - 1; __pivot_pos = __end - 1;
__gnu_parallel::binder2nd __gnu_parallel::__binder2nd
<_Compare, _ValueType, _ValueType, bool> <_Compare, _ValueType, _ValueType, bool>
__pred(__comp, *__pivot_pos); __pred(__comp, *__pivot_pos);
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms // software; you can redistribute it and/or modify it under the terms
...@@ -113,7 +113,7 @@ namespace __gnu_parallel ...@@ -113,7 +113,7 @@ namespace __gnu_parallel
* @param __b Second integer, to be encoded in the least-significant * @param __b Second integer, to be encoded in the least-significant
* @c _CASable_bits/2 bits. * @c _CASable_bits/2 bits.
* @return value encoding @c __a and @c __b. * @return value encoding @c __a and @c __b.
* @see decode2 * @see __decode2
*/ */
inline _CASable inline _CASable
__encode2(int __a, int __b) //must all be non-negative, actually __encode2(int __a, int __b) //must all be non-negative, actually
...@@ -130,7 +130,7 @@ namespace __gnu_parallel ...@@ -130,7 +130,7 @@ namespace __gnu_parallel
* @see __encode2 * @see __encode2
*/ */
inline void inline void
decode2(_CASable __x, int& __a, int& __b) __decode2(_CASable __x, int& __a, int& __b)
{ {
__a = (int)((__x >> (_CASable_bits / 2)) & _CASable_mask); __a = (int)((__x >> (_CASable_bits / 2)) & _CASable_mask);
__b = (int)((__x >> 0 ) & _CASable_mask); __b = (int)((__x >> 0 ) & _CASable_mask);
...@@ -217,7 +217,7 @@ namespace __gnu_parallel ...@@ -217,7 +217,7 @@ namespace __gnu_parallel
*/ */
template<typename _Operation, typename _FirstArgumentType, template<typename _Operation, typename _FirstArgumentType,
typename _SecondArgumentType, typename _ResultType> typename _SecondArgumentType, typename _ResultType>
class binder2nd class __binder2nd
: public std::unary_function<_FirstArgumentType, _ResultType> : public std::unary_function<_FirstArgumentType, _ResultType>
{ {
protected: protected:
...@@ -225,7 +225,7 @@ namespace __gnu_parallel ...@@ -225,7 +225,7 @@ namespace __gnu_parallel
_SecondArgumentType _M_value; _SecondArgumentType _M_value;
public: public:
binder2nd(const _Operation& __x, const _SecondArgumentType& __y) __binder2nd(const _Operation& __x, const _SecondArgumentType& __y)
: _M_op(__x), _M_value(__y) { } : _M_op(__x), _M_value(__y) { }
_ResultType _ResultType
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms // software; you can redistribute it and/or modify it under the terms
...@@ -367,7 +367,7 @@ namespace __gnu_parallel ...@@ -367,7 +367,7 @@ namespace __gnu_parallel
// __gnu_parallel::_Lexicographic<S, int, // __gnu_parallel::_Lexicographic<S, int,
// __gnu_parallel::_Less<S, S> > // __gnu_parallel::_Less<S, S> >
// __pivot_pos == std::pair<S, int>* // __pivot_pos == std::pair<S, int>*
__gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool> __gnu_parallel::__binder2nd<_Compare, _ValueType, _ValueType, bool>
__pred(__comp, *__pivot_pos); __pred(__comp, *__pivot_pos);
// Divide, leave pivot unchanged in last place. // Divide, leave pivot unchanged in last place.
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms // software; you can redistribute it and/or modify it under the terms
...@@ -84,7 +84,7 @@ namespace __gnu_parallel ...@@ -84,7 +84,7 @@ namespace __gnu_parallel
{ {
_CASable __former_borders = _M_borders; _CASable __former_borders = _M_borders;
int __former_front, __former_back; int __former_front, __former_back;
decode2(__former_borders, __former_front, __former_back); __decode2(__former_borders, __former_front, __former_back);
*(_M_base + __former_front % _M_max_size) = __t; *(_M_base + __former_front % _M_max_size) = __t;
#if _GLIBCXX_ASSERTIONS #if _GLIBCXX_ASSERTIONS
// Otherwise: front - back > _M_max_size eventually. // Otherwise: front - back > _M_max_size eventually.
...@@ -101,7 +101,7 @@ namespace __gnu_parallel ...@@ -101,7 +101,7 @@ namespace __gnu_parallel
{ {
int __former_front, __former_back; int __former_front, __former_back;
#pragma omp flush #pragma omp flush
decode2(_M_borders, __former_front, __former_back); __decode2(_M_borders, __former_front, __former_back);
while (__former_front > __former_back) while (__former_front > __former_back)
{ {
// Chance. // Chance.
...@@ -116,7 +116,7 @@ namespace __gnu_parallel ...@@ -116,7 +116,7 @@ namespace __gnu_parallel
return true; return true;
} }
#pragma omp flush #pragma omp flush
decode2(_M_borders, __former_front, __former_back); __decode2(_M_borders, __former_front, __former_back);
} }
return false; return false;
} }
...@@ -128,7 +128,7 @@ namespace __gnu_parallel ...@@ -128,7 +128,7 @@ namespace __gnu_parallel
{ {
int __former_front, __former_back; int __former_front, __former_back;
#pragma omp flush #pragma omp flush
decode2(_M_borders, __former_front, __former_back); __decode2(_M_borders, __former_front, __former_back);
while (__former_front > __former_back) while (__former_front > __former_back)
{ {
// Chance. // Chance.
...@@ -143,7 +143,7 @@ namespace __gnu_parallel ...@@ -143,7 +143,7 @@ namespace __gnu_parallel
return true; return true;
} }
#pragma omp flush #pragma omp flush
decode2(_M_borders, __former_front, __former_back); __decode2(_M_borders, __former_front, __former_back);
} }
return false; return false;
} }
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms // software; you can redistribute it and/or modify it under the terms
...@@ -77,7 +77,7 @@ namespace __gnu_parallel ...@@ -77,7 +77,7 @@ namespace __gnu_parallel
_ValueType& __pivot = __samples[__pivot_rank * __num_samples / __n]; _ValueType& __pivot = __samples[__pivot_rank * __num_samples / __n];
__gnu_parallel::binder2nd<_Compare, _ValueType, _ValueType, bool> __gnu_parallel::__binder2nd<_Compare, _ValueType, _ValueType, bool>
__pred(__comp, __pivot); __pred(__comp, __pivot);
_DifferenceType __split = __parallel_partition(__begin, __end, _DifferenceType __split = __parallel_partition(__begin, __end,
__pred, __num_threads); __pred, __num_threads);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment