base.h (_PseudoSequenceIterator, [...]): Replace redundant _Self.
2009-09-16 Johannes Singler <singler@ira.uka.de> * include/parallel/base.h (_PseudoSequenceIterator, _PseudoSequence): Replace redundant _Self. * include/parallel/iterator.h (_IteratorPair, _IteratorTriple): Replace redundant _Self. * include/parallel/algo.h: Correct accidental _Self in comments. * include/parallel/losertree.h: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/random_shuffle.h: Likewise. From-SVN: r151743
This commit is contained in:
parent
9da4af8c07
commit
11b9c936bf
@ -1,3 +1,14 @@
|
|||||||
|
2009-09-16 Johannes Singler <singler@ira.uka.de>
|
||||||
|
|
||||||
|
* include/parallel/base.h (_PseudoSequenceIterator, _PseudoSequence):
|
||||||
|
Replace redundant _Self.
|
||||||
|
* include/parallel/iterator.h (_IteratorPair, _IteratorTriple):
|
||||||
|
Replace redundant _Self.
|
||||||
|
* include/parallel/algo.h: Correct accidental _Self in comments.
|
||||||
|
* include/parallel/losertree.h: Likewise.
|
||||||
|
* include/parallel/multiway_merge.h: Likewise.
|
||||||
|
* include/parallel/random_shuffle.h: Likewise.
|
||||||
|
|
||||||
2009-09-16 Johannes Singler <singler@ira.uka.de>
|
2009-09-16 Johannes Singler <singler@ira.uka.de>
|
||||||
|
|
||||||
* include/parallel/algobase.h: Uglify internal identifiers.
|
* include/parallel/algobase.h: Uglify internal identifiers.
|
||||||
|
@ -224,7 +224,7 @@ namespace __parallel
|
|||||||
_BinaryPredicate __comp, __gnu_parallel::sequential_tag)
|
_BinaryPredicate __comp, __gnu_parallel::sequential_tag)
|
||||||
{ return _GLIBCXX_STD_P::find_first_of(__begin1, __end1, __begin2, __end2, __comp); }
|
{ return _GLIBCXX_STD_P::find_first_of(__begin1, __end1, __begin2, __end2, __comp); }
|
||||||
|
|
||||||
// Sequential fallback for input iterator _Self
|
// Sequential fallback for input iterator type
|
||||||
template<typename _IIter, typename _ForwardIterator,
|
template<typename _IIter, typename _ForwardIterator,
|
||||||
typename _IteratorTag1, typename _IteratorTag2>
|
typename _IteratorTag1, typename _IteratorTag2>
|
||||||
inline _IIter
|
inline _IIter
|
||||||
@ -250,7 +250,7 @@ namespace __parallel
|
|||||||
<_ForwardIterator>(__begin2, __end2)).first;
|
<_ForwardIterator>(__begin2, __end2)).first;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sequential fallback for input iterator _Self
|
// Sequential fallback for input iterator type
|
||||||
template<typename _IIter, typename _ForwardIterator,
|
template<typename _IIter, typename _ForwardIterator,
|
||||||
typename _BinaryPredicate, typename _IteratorTag1,
|
typename _BinaryPredicate, typename _IteratorTag1,
|
||||||
typename _IteratorTag2>
|
typename _IteratorTag2>
|
||||||
|
@ -341,8 +341,6 @@ template<typename _Tp, typename _DifferenceTp>
|
|||||||
typedef _DifferenceTp _DifferenceType;
|
typedef _DifferenceTp _DifferenceType;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef _PseudoSequenceIterator<_Tp, _DifferenceTp> _Self;
|
|
||||||
|
|
||||||
const _Tp& _M_val;
|
const _Tp& _M_val;
|
||||||
_DifferenceType _M_pos;
|
_DifferenceType _M_pos;
|
||||||
|
|
||||||
@ -351,7 +349,7 @@ template<typename _Tp, typename _DifferenceTp>
|
|||||||
: _M_val(_M_val), _M_pos(_M_pos) { }
|
: _M_val(_M_val), _M_pos(_M_pos) { }
|
||||||
|
|
||||||
// Pre-increment operator.
|
// Pre-increment operator.
|
||||||
_Self&
|
_PseudoSequenceIterator&
|
||||||
operator++()
|
operator++()
|
||||||
{
|
{
|
||||||
++_M_pos;
|
++_M_pos;
|
||||||
@ -359,9 +357,9 @@ template<typename _Tp, typename _DifferenceTp>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post-increment operator.
|
// Post-increment operator.
|
||||||
const _Self
|
const _PseudoSequenceIterator
|
||||||
operator++(int)
|
operator++(int)
|
||||||
{ return _Self(_M_pos++); }
|
{ return _PseudoSequenceIterator(_M_pos++); }
|
||||||
|
|
||||||
const _Tp&
|
const _Tp&
|
||||||
operator*() const
|
operator*() const
|
||||||
@ -372,15 +370,15 @@ template<typename _Tp, typename _DifferenceTp>
|
|||||||
{ return _M_val; }
|
{ return _M_val; }
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator==(const _Self& __i2)
|
operator==(const _PseudoSequenceIterator& __i2)
|
||||||
{ return _M_pos == __i2._M_pos; }
|
{ return _M_pos == __i2._M_pos; }
|
||||||
|
|
||||||
_DifferenceType
|
_DifferenceType
|
||||||
operator!=(const _Self& __i2)
|
operator!=(const _PseudoSequenceIterator& __i2)
|
||||||
{ return _M_pos != __i2._M_pos; }
|
{ return _M_pos != __i2._M_pos; }
|
||||||
|
|
||||||
_DifferenceType
|
_DifferenceType
|
||||||
operator-(const _Self& __i2)
|
operator-(const _PseudoSequenceIterator& __i2)
|
||||||
{ return _M_pos - __i2._M_pos; }
|
{ return _M_pos - __i2._M_pos; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -393,8 +391,6 @@ template<typename _Tp, typename _DifferenceTp>
|
|||||||
template<typename _Tp, typename _DifferenceTp>
|
template<typename _Tp, typename _DifferenceTp>
|
||||||
class _PseudoSequence
|
class _PseudoSequence
|
||||||
{
|
{
|
||||||
typedef _PseudoSequence<_Tp, _DifferenceTp> _Self;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef _DifferenceTp _DifferenceType;
|
typedef _DifferenceTp _DifferenceType;
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ namespace __gnu_parallel
|
|||||||
class _IteratorPair : public std::pair<_Iterator1, _Iterator2>
|
class _IteratorPair : public std::pair<_Iterator1, _Iterator2>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef _IteratorPair<_Iterator1, _Iterator2, _IteratorCategory> _Self;
|
|
||||||
typedef std::pair<_Iterator1, _Iterator2> _Base;
|
typedef std::pair<_Iterator1, _Iterator2> _Base;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -53,8 +52,8 @@ namespace __gnu_parallel
|
|||||||
|
|
||||||
typedef std::iterator_traits<_Iterator1> _TraitsType;
|
typedef std::iterator_traits<_Iterator1> _TraitsType;
|
||||||
typedef typename _TraitsType::difference_type difference_type;
|
typedef typename _TraitsType::difference_type difference_type;
|
||||||
typedef _Self* pointer;
|
typedef _IteratorPair* pointer;
|
||||||
typedef _Self& reference;
|
typedef _IteratorPair& reference;
|
||||||
|
|
||||||
_IteratorPair() { }
|
_IteratorPair() { }
|
||||||
|
|
||||||
@ -62,7 +61,7 @@ namespace __gnu_parallel
|
|||||||
: _Base(__first, __second) { }
|
: _Base(__first, __second) { }
|
||||||
|
|
||||||
// Pre-increment operator.
|
// Pre-increment operator.
|
||||||
_Self&
|
_IteratorPair&
|
||||||
operator++()
|
operator++()
|
||||||
{
|
{
|
||||||
++_Base::first;
|
++_Base::first;
|
||||||
@ -71,12 +70,12 @@ namespace __gnu_parallel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post-increment operator.
|
// Post-increment operator.
|
||||||
const _Self
|
const _IteratorPair
|
||||||
operator++(int)
|
operator++(int)
|
||||||
{ return _Self(_Base::first++, _Base::second++); }
|
{ return _IteratorPair(_Base::first++, _Base::second++); }
|
||||||
|
|
||||||
// Pre-decrement operator.
|
// Pre-decrement operator.
|
||||||
_Self&
|
_IteratorPair&
|
||||||
operator--()
|
operator--()
|
||||||
{
|
{
|
||||||
--_Base::first;
|
--_Base::first;
|
||||||
@ -85,28 +84,28 @@ namespace __gnu_parallel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post-decrement operator.
|
// Post-decrement operator.
|
||||||
const _Self
|
const _IteratorPair
|
||||||
operator--(int)
|
operator--(int)
|
||||||
{ return _Self(_Base::first--, _Base::second--); }
|
{ return _IteratorPair(_Base::first--, _Base::second--); }
|
||||||
|
|
||||||
// Type conversion.
|
// Type conversion.
|
||||||
operator _Iterator2() const
|
operator _Iterator2() const
|
||||||
{ return _Base::second; }
|
{ return _Base::second; }
|
||||||
|
|
||||||
_Self&
|
_IteratorPair&
|
||||||
operator=(const _Self& __other)
|
operator=(const _IteratorPair& __other)
|
||||||
{
|
{
|
||||||
_Base::first = __other.first;
|
_Base::first = __other.first;
|
||||||
_Base::second = __other.second;
|
_Base::second = __other.second;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self
|
_IteratorPair
|
||||||
operator+(difference_type __delta) const
|
operator+(difference_type __delta) const
|
||||||
{ return _Self(_Base::first + __delta, _Base::second + __delta); }
|
{ return _IteratorPair(_Base::first + __delta, _Base::second + __delta); }
|
||||||
|
|
||||||
difference_type
|
difference_type
|
||||||
operator-(const _Self& __other) const
|
operator-(const _IteratorPair& __other) const
|
||||||
{ return _Base::first - __other.first; }
|
{ return _Base::first - __other.first; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -118,17 +117,13 @@ namespace __gnu_parallel
|
|||||||
typename _IteratorCategory>
|
typename _IteratorCategory>
|
||||||
class _IteratorTriple
|
class _IteratorTriple
|
||||||
{
|
{
|
||||||
private:
|
|
||||||
typedef _IteratorTriple<_Iterator1, _Iterator2, _Iterator3,
|
|
||||||
_IteratorCategory> _Self;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef _IteratorCategory iterator_category;
|
typedef _IteratorCategory iterator_category;
|
||||||
typedef void value_type;
|
typedef void value_type;
|
||||||
typedef typename std::iterator_traits<_Iterator1>::difference_type
|
typedef typename std::iterator_traits<_Iterator1>::difference_type
|
||||||
difference_type;
|
difference_type;
|
||||||
typedef _Self* pointer;
|
typedef _IteratorTriple* pointer;
|
||||||
typedef _Self& reference;
|
typedef _IteratorTriple& reference;
|
||||||
|
|
||||||
_Iterator1 __first;
|
_Iterator1 __first;
|
||||||
_Iterator2 __second;
|
_Iterator2 __second;
|
||||||
@ -145,7 +140,7 @@ namespace __gnu_parallel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pre-increment operator.
|
// Pre-increment operator.
|
||||||
_Self&
|
_IteratorTriple&
|
||||||
operator++()
|
operator++()
|
||||||
{
|
{
|
||||||
++__first;
|
++__first;
|
||||||
@ -155,12 +150,12 @@ namespace __gnu_parallel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post-increment operator.
|
// Post-increment operator.
|
||||||
const _Self
|
const _IteratorTriple
|
||||||
operator++(int)
|
operator++(int)
|
||||||
{ return _Self(__first++, __second++, __third++); }
|
{ return _IteratorTriple(__first++, __second++, __third++); }
|
||||||
|
|
||||||
// Pre-decrement operator.
|
// Pre-decrement operator.
|
||||||
_Self&
|
_IteratorTriple&
|
||||||
operator--()
|
operator--()
|
||||||
{
|
{
|
||||||
--__first;
|
--__first;
|
||||||
@ -170,16 +165,16 @@ namespace __gnu_parallel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Post-decrement operator.
|
// Post-decrement operator.
|
||||||
const _Self
|
const _IteratorTriple
|
||||||
operator--(int)
|
operator--(int)
|
||||||
{ return _Self(__first--, __second--, __third--); }
|
{ return _IteratorTriple(__first--, __second--, __third--); }
|
||||||
|
|
||||||
// Type conversion.
|
// Type conversion.
|
||||||
operator _Iterator3() const
|
operator _Iterator3() const
|
||||||
{ return __third; }
|
{ return __third; }
|
||||||
|
|
||||||
_Self&
|
_IteratorTriple&
|
||||||
operator=(const _Self& __other)
|
operator=(const _IteratorTriple& __other)
|
||||||
{
|
{
|
||||||
__first = __other.__first;
|
__first = __other.__first;
|
||||||
__second = __other.__second;
|
__second = __other.__second;
|
||||||
@ -187,12 +182,12 @@ namespace __gnu_parallel
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Self
|
_IteratorTriple
|
||||||
operator+(difference_type __delta) const
|
operator+(difference_type __delta) const
|
||||||
{ return _Self(__first + __delta, __second + __delta, __third + __delta); }
|
{ return _IteratorTriple(__first + __delta, __second + __delta, __third + __delta); }
|
||||||
|
|
||||||
difference_type
|
difference_type
|
||||||
operator-(const _Self& __other) const
|
operator-(const _IteratorTriple& __other) const
|
||||||
{ return __first - __other.__first; }
|
{ return __first - __other.__first; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ namespace __gnu_parallel
|
|||||||
* inf is not needed due to a better initialization routine. This
|
* inf is not needed due to a better initialization routine. This
|
||||||
* is a well-performing variant.
|
* is a well-performing variant.
|
||||||
*
|
*
|
||||||
* @param _Tp the element _Self
|
* @param _Tp the element type
|
||||||
* @param _Compare the comparator to use, defaults to std::less<_Tp>
|
* @param _Compare the comparator to use, defaults to std::less<_Tp>
|
||||||
*/
|
*/
|
||||||
template<typename _Tp, typename _Compare>
|
template<typename _Tp, typename _Compare>
|
||||||
|
@ -755,10 +755,10 @@ template<
|
|||||||
* The field "_M_use_pointer" is used to determine whether to use pointers in
|
* The field "_M_use_pointer" is used to determine whether to use pointers in
|
||||||
* the loser trees or whether to copy the values into the loser tree.
|
* the loser trees or whether to copy the values into the loser tree.
|
||||||
*
|
*
|
||||||
* The default behavior is to use pointers if the data _Self is 4 times as
|
* The default behavior is to use pointers if the data type is 4 times as
|
||||||
* big as the pointer to it.
|
* big as the pointer to it.
|
||||||
*
|
*
|
||||||
* Specialize for your data _Self to customize the behavior.
|
* Specialize for your data type to customize the behavior.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
*
|
*
|
||||||
@ -770,7 +770,7 @@ template<
|
|||||||
* struct _LoserTreeTraits<heavyweight_type>
|
* struct _LoserTreeTraits<heavyweight_type>
|
||||||
* { static const bool _M_use_pointer = true; };
|
* { static const bool _M_use_pointer = true; };
|
||||||
*
|
*
|
||||||
* @param _Tp _Self to give the loser tree traits for.
|
* @param _Tp type to give the loser tree traits for.
|
||||||
*/
|
*/
|
||||||
template <typename _Tp>
|
template <typename _Tp>
|
||||||
struct _LoserTreeTraits
|
struct _LoserTreeTraits
|
||||||
@ -778,7 +778,7 @@ struct _LoserTreeTraits
|
|||||||
/**
|
/**
|
||||||
* @brief True iff to use pointers instead of values in loser trees.
|
* @brief True iff to use pointers instead of values in loser trees.
|
||||||
*
|
*
|
||||||
* The default behavior is to use pointers if the data _Self is four
|
* The default behavior is to use pointers if the data type is four
|
||||||
* times as big as the pointer to it.
|
* times as big as the pointer to it.
|
||||||
*/
|
*/
|
||||||
static const bool _M_use_pointer = (sizeof(_Tp) > 4 * sizeof(_Tp*));
|
static const bool _M_use_pointer = (sizeof(_Tp) > 4 * sizeof(_Tp*));
|
||||||
@ -1442,7 +1442,7 @@ template<
|
|||||||
* @see stable_multiway_merge
|
* @see stable_multiway_merge
|
||||||
*
|
*
|
||||||
* @pre All input sequences must be sorted.
|
* @pre All input sequences must be sorted.
|
||||||
* @pre Target must provide enough space to merge out __length __elements or
|
* @pre Target must provide enough space to merge out length elements or
|
||||||
* the number of elements in all sequences, whichever is smaller.
|
* the number of elements in all sequences, whichever is smaller.
|
||||||
*
|
*
|
||||||
* @post [__target, return __value) contains merged __elements from the
|
* @post [__target, return __value) contains merged __elements from the
|
||||||
@ -1450,11 +1450,11 @@ template<
|
|||||||
* @post return __value - __target = min(__length, number of elements in all
|
* @post return __value - __target = min(__length, number of elements in all
|
||||||
* sequences).
|
* sequences).
|
||||||
*
|
*
|
||||||
* @param _RAIterPairIterator iterator over __sequence
|
* @param _RAIterPairIterator iterator over sequence
|
||||||
* of pairs of iterators
|
* of pairs of iterators
|
||||||
* @param _RAIterOut iterator over target sequence
|
* @param _RAIterOut iterator over target sequence
|
||||||
* @param _DifferenceTp difference _Self for the sequence
|
* @param _DifferenceTp difference type for the sequence
|
||||||
* @param _Compare strict weak ordering _Self to compare __elements
|
* @param _Compare strict weak ordering type to compare elements
|
||||||
* in sequences
|
* in sequences
|
||||||
*
|
*
|
||||||
* @param __seqs_begin __begin of sequence __sequence
|
* @param __seqs_begin __begin of sequence __sequence
|
||||||
@ -1809,7 +1809,7 @@ stable_multiway_merge(_RAIterPairIterator __seqs_begin
|
|||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @pre All input sequences must be sorted.
|
* @pre All input sequences must be sorted.
|
||||||
* @pre Target must provide enough space to merge out __length __elements or
|
* @pre Target must provide enough space to merge out length elements or
|
||||||
* the number of elements in all sequences, whichever is smaller.
|
* the number of elements in all sequences, whichever is smaller.
|
||||||
* @pre For each @__c __i, @__c __seqs_begin[__i].second must be the end
|
* @pre For each @__c __i, @__c __seqs_begin[__i].second must be the end
|
||||||
* marker of the sequence, but also reference the one more __sentinel
|
* marker of the sequence, but also reference the one more __sentinel
|
||||||
@ -1822,11 +1822,11 @@ stable_multiway_merge(_RAIterPairIterator __seqs_begin
|
|||||||
*
|
*
|
||||||
* @see stable_multiway_merge_sentinels
|
* @see stable_multiway_merge_sentinels
|
||||||
*
|
*
|
||||||
* @param _RAIterPairIterator iterator over __sequence
|
* @param _RAIterPairIterator iterator over sequence
|
||||||
* of pairs of iterators
|
* of pairs of iterators
|
||||||
* @param _RAIterOut iterator over target sequence
|
* @param _RAIterOut iterator over target sequence
|
||||||
* @param _DifferenceTp difference _Self for the sequence
|
* @param _DifferenceTp difference type for the sequence
|
||||||
* @param _Compare strict weak ordering _Self to compare __elements
|
* @param _Compare strict weak ordering type to compare elements
|
||||||
* in sequences
|
* in sequences
|
||||||
*
|
*
|
||||||
* @param __seqs_begin __begin of sequence __sequence
|
* @param __seqs_begin __begin of sequence __sequence
|
||||||
|
@ -41,7 +41,7 @@ namespace __gnu_parallel
|
|||||||
{
|
{
|
||||||
/** @brief Type to hold the index of a bin.
|
/** @brief Type to hold the index of a bin.
|
||||||
*
|
*
|
||||||
* Since many variables of this _Self are allocated, it should be
|
* Since many variables of this type are allocated, it should be
|
||||||
* chosen as small as possible.
|
* chosen as small as possible.
|
||||||
*/
|
*/
|
||||||
typedef unsigned short _BinIndex;
|
typedef unsigned short _BinIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user