+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>
* include/parallel/algobase.h: Uglify internal identifiers.
_BinaryPredicate __comp, __gnu_parallel::sequential_tag)
{ 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,
typename _IteratorTag1, typename _IteratorTag2>
inline _IIter
<_ForwardIterator>(__begin2, __end2)).first;
}
- // Sequential fallback for input iterator _Self
+ // Sequential fallback for input iterator type
template<typename _IIter, typename _ForwardIterator,
typename _BinaryPredicate, typename _IteratorTag1,
typename _IteratorTag2>
typedef _DifferenceTp _DifferenceType;
private:
- typedef _PseudoSequenceIterator<_Tp, _DifferenceTp> _Self;
-
const _Tp& _M_val;
_DifferenceType _M_pos;
: _M_val(_M_val), _M_pos(_M_pos) { }
// Pre-increment operator.
- _Self&
+ _PseudoSequenceIterator&
operator++()
{
++_M_pos;
}
// Post-increment operator.
- const _Self
+ const _PseudoSequenceIterator
operator++(int)
- { return _Self(_M_pos++); }
+ { return _PseudoSequenceIterator(_M_pos++); }
const _Tp&
operator*() const
{ return _M_val; }
bool
- operator==(const _Self& __i2)
+ operator==(const _PseudoSequenceIterator& __i2)
{ return _M_pos == __i2._M_pos; }
_DifferenceType
- operator!=(const _Self& __i2)
+ operator!=(const _PseudoSequenceIterator& __i2)
{ return _M_pos != __i2._M_pos; }
_DifferenceType
- operator-(const _Self& __i2)
+ operator-(const _PseudoSequenceIterator& __i2)
{ return _M_pos - __i2._M_pos; }
};
template<typename _Tp, typename _DifferenceTp>
class _PseudoSequence
{
- typedef _PseudoSequence<_Tp, _DifferenceTp> _Self;
-
public:
typedef _DifferenceTp _DifferenceType;
class _IteratorPair : public std::pair<_Iterator1, _Iterator2>
{
private:
- typedef _IteratorPair<_Iterator1, _Iterator2, _IteratorCategory> _Self;
typedef std::pair<_Iterator1, _Iterator2> _Base;
public:
typedef std::iterator_traits<_Iterator1> _TraitsType;
typedef typename _TraitsType::difference_type difference_type;
- typedef _Self* pointer;
- typedef _Self& reference;
+ typedef _IteratorPair* pointer;
+ typedef _IteratorPair& reference;
_IteratorPair() { }
: _Base(__first, __second) { }
// Pre-increment operator.
- _Self&
+ _IteratorPair&
operator++()
{
++_Base::first;
}
// Post-increment operator.
- const _Self
+ const _IteratorPair
operator++(int)
- { return _Self(_Base::first++, _Base::second++); }
+ { return _IteratorPair(_Base::first++, _Base::second++); }
// Pre-decrement operator.
- _Self&
+ _IteratorPair&
operator--()
{
--_Base::first;
}
// Post-decrement operator.
- const _Self
+ const _IteratorPair
operator--(int)
- { return _Self(_Base::first--, _Base::second--); }
+ { return _IteratorPair(_Base::first--, _Base::second--); }
// Type conversion.
operator _Iterator2() const
{ return _Base::second; }
- _Self&
- operator=(const _Self& __other)
+ _IteratorPair&
+ operator=(const _IteratorPair& __other)
{
_Base::first = __other.first;
_Base::second = __other.second;
return *this;
}
- _Self
+ _IteratorPair
operator+(difference_type __delta) const
- { return _Self(_Base::first + __delta, _Base::second + __delta); }
+ { return _IteratorPair(_Base::first + __delta, _Base::second + __delta); }
difference_type
- operator-(const _Self& __other) const
+ operator-(const _IteratorPair& __other) const
{ return _Base::first - __other.first; }
};
typename _IteratorCategory>
class _IteratorTriple
{
- private:
- typedef _IteratorTriple<_Iterator1, _Iterator2, _Iterator3,
- _IteratorCategory> _Self;
-
public:
typedef _IteratorCategory iterator_category;
typedef void value_type;
typedef typename std::iterator_traits<_Iterator1>::difference_type
difference_type;
- typedef _Self* pointer;
- typedef _Self& reference;
+ typedef _IteratorTriple* pointer;
+ typedef _IteratorTriple& reference;
_Iterator1 __first;
_Iterator2 __second;
}
// Pre-increment operator.
- _Self&
+ _IteratorTriple&
operator++()
{
++__first;
}
// Post-increment operator.
- const _Self
+ const _IteratorTriple
operator++(int)
- { return _Self(__first++, __second++, __third++); }
+ { return _IteratorTriple(__first++, __second++, __third++); }
// Pre-decrement operator.
- _Self&
+ _IteratorTriple&
operator--()
{
--__first;
}
// Post-decrement operator.
- const _Self
+ const _IteratorTriple
operator--(int)
- { return _Self(__first--, __second--, __third--); }
+ { return _IteratorTriple(__first--, __second--, __third--); }
// Type conversion.
operator _Iterator3() const
{ return __third; }
- _Self&
- operator=(const _Self& __other)
+ _IteratorTriple&
+ operator=(const _IteratorTriple& __other)
{
__first = __other.__first;
__second = __other.__second;
return *this;
}
- _Self
+ _IteratorTriple
operator+(difference_type __delta) const
- { return _Self(__first + __delta, __second + __delta, __third + __delta); }
+ { return _IteratorTriple(__first + __delta, __second + __delta, __third + __delta); }
difference_type
- operator-(const _Self& __other) const
+ operator-(const _IteratorTriple& __other) const
{ return __first - __other.__first; }
};
}
* inf is not needed due to a better initialization routine. This
* 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>
*/
template<typename _Tp, typename _Compare>
* 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 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.
*
- * Specialize for your data _Self to customize the behavior.
+ * Specialize for your data type to customize the behavior.
*
* Example:
*
* struct _LoserTreeTraits<heavyweight_type>
* { 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>
struct _LoserTreeTraits
/**
* @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.
*/
static const bool _M_use_pointer = (sizeof(_Tp) > 4 * sizeof(_Tp*));
* @see stable_multiway_merge
*
* @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.
*
* @post [__target, return __value) contains merged __elements from the
* @post return __value - __target = min(__length, number of elements in all
* sequences).
*
- * @param _RAIterPairIterator iterator over __sequence
+ * @param _RAIterPairIterator iterator over sequence
* of pairs of iterators
* @param _RAIterOut iterator over target sequence
- * @param _DifferenceTp difference _Self for the sequence
- * @param _Compare strict weak ordering _Self to compare __elements
+ * @param _DifferenceTp difference type for the sequence
+ * @param _Compare strict weak ordering type to compare elements
* in sequences
*
* @param __seqs_begin __begin of sequence __sequence
* </pre>
*
* @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.
* @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
*
* @see stable_multiway_merge_sentinels
*
- * @param _RAIterPairIterator iterator over __sequence
+ * @param _RAIterPairIterator iterator over sequence
* of pairs of iterators
* @param _RAIterOut iterator over target sequence
- * @param _DifferenceTp difference _Self for the sequence
- * @param _Compare strict weak ordering _Self to compare __elements
+ * @param _DifferenceTp difference type for the sequence
+ * @param _Compare strict weak ordering type to compare elements
* in sequences
*
* @param __seqs_begin __begin of sequence __sequence
{
/** @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.
*/
typedef unsigned short _BinIndex;