ProbBase< ThrTree, Type, RangeT > Class Template Reference

List of all members.

Public Types

typedef RangeT::value_type value_type

Public Member Functions

void TstCoreFunction (RangeT aRng)
void TstCoreImplicit (RangeT aRng)
 Same tests, but without functor. That is, uses operator+().
 ProbBase (ThrTree aThrTree, size_t aDist, const Type &aInit, RangeT aRng)
size_t nb_elems (void) const
rpa::thr_nb_t threadsNb (void) const
template<class IterOutNew, class IterOutOrg>
IterOutNew TstCore (IterOutNew anIterNew, IterOutOrg anIterOrg, const ContOut &aOutR, const ContOut &aResu)
 ProbBase (ThrTree &aThrTree, size_t aDist, Range &aRng)

Public Attributes

ThrTree _ThrTree
size_t _Dist
Type _Init

Private Types

typedef Range::value_type value_type
typedef rpa::BeginEnd< ContOut > BeginEndType
typedef BeginEndType::value_type result_type
typedef rpa::ThreadTraits<
ThrTree > 
thread_traits_type
typedef thread_traits_type::behaviour_type behaviour_type
typedef rpa::Comparer< BeginEndType,
behaviour_type, Range > 
ComparerT

Private Member Functions

template<class IterCatOut>
void Compare (const Range &aRngInAfterExec, const ContOut &aOutR, const ContOut &aResu, const IterCatOut &aICO, const char *aNameIterNew)

Private Attributes

ThrTree & _ThrTree
size_t _pbSz
 Number of elements in the input sequence.
Range & _Rng

Detailed Description

template<class ThrTree, class Type, class RangeT>
class ProbBase< ThrTree, Type, RangeT >

ProbBase Receives as input :


Member Typedef Documentation

template<class ThrTree, class Type, class RangeT>
typedef rpa::BeginEnd< ContOut > ProbBase< ThrTree, Type, RangeT >::BeginEndType [private]

template<class ThrTree, class Type, class RangeT>
typedef thread_traits_type::behaviour_type ProbBase< ThrTree, Type, RangeT >::behaviour_type [private]

template<class ThrTree, class Type, class RangeT>
typedef rpa::Comparer< BeginEndType, behaviour_type, Range > ProbBase< ThrTree, Type, RangeT >::ComparerT [private]

template<class ThrTree, class Type, class RangeT>
typedef BeginEndType::value_type ProbBase< ThrTree, Type, RangeT >::result_type [private]

template<class ThrTree, class Type, class RangeT>
typedef rpa::ThreadTraits< ThrTree > ProbBase< ThrTree, Type, RangeT >::thread_traits_type [private]

template<class ThrTree, class Type, class RangeT>
typedef Range::value_type ProbBase< ThrTree, Type, RangeT >::value_type [private]

template<class ThrTree, class Type, class RangeT>
typedef RangeT::value_type ProbBase< ThrTree, Type, RangeT >::value_type


Constructor & Destructor Documentation

template<class ThrTree, class Type, class RangeT>
ProbBase< ThrTree, Type, RangeT >::ProbBase ( ThrTree  aThrTree,
size_t  aDist,
const Type &  aInit,
RangeT  aRng 
) [inline]

template<class ThrTree, class Type, class RangeT>
ProbBase< ThrTree, Type, RangeT >::ProbBase ( ThrTree &  aThrTree,
size_t  aDist,
Range &  aRng 
) [inline]


Member Function Documentation

template<class ThrTree, class Type, class RangeT>
template<class IterCatOut>
void ProbBase< ThrTree, Type, RangeT >::Compare ( const Range &  aRngInAfterExec,
const ContOut &  aOutR,
const ContOut &  aResu,
const IterCatOut &  aICO,
const char *  aNameIterNew 
) [inline, private]

We have to give as template parameter, the type of output iterator, because the comparison function takes it into account.

template<class ThrTree, class Type, class RangeT>
size_t ProbBase< ThrTree, Type, RangeT >::nb_elems ( void   )  const [inline]

template<class ThrTree, class Type, class RangeT>
rpa::thr_nb_t ProbBase< ThrTree, Type, RangeT >::threadsNb ( void   )  const [inline]

template<class ThrTree, class Type, class RangeT>
template<class IterOutNew, class IterOutOrg>
IterOutNew ProbBase< ThrTree, Type, RangeT >::TstCore ( IterOutNew  anIterNew,
IterOutOrg  anIterOrg,
const ContOut &  aOutR,
const ContOut &  aResu 
) [inline]

Computes the same result in sequential mode, then in parallel mode. Beware that the input sequence is modified ! ... and cannot be reused. It returns the output of the parallel algorithm.

Functors are encapsulated into a class which counts the number of calls, for runtime checking purpose.

Beware that the range is changed by the algorithm.

The output result is not used.

We compute again the result (Could maybe be optimized). The output result is not used either.

The order of the results depend also of the type of the output iterator, and of the type of the input range.

Checks that both operators were called the same number of times.

We should add the test of a function pointer (Not a functor). We do not use the adapter 'pointer_to_binary_function' for performance reasons. Beware the the output container has to be emptied before this test, because it still contains data. In fact, we should use the plain normal mechanism to have the output container automatically cleaned up.

template<class ThrTree, class Type, class RangeT>
void ProbBase< ThrTree, Type, RangeT >::TstCoreFunction ( RangeT  aRng  )  [inline]

Computes the same result in parallel and sequentially. Then finally compares results. NOTE: The sequence will be modified. Remember that these algorithms modify the input and output ranges. This is why these ranges must be copied, not passed as references. In other words, they can be used only once.

The functors are wrapped in a class which counts the number of times these fucntors are called.

The 'good' result is calculated again with the plain algorithm, for comparison. Performance do not matter.

Checks that both operators have been called the same number of times.

This is a function pointer which wraps a static functor.

template<class ThrTree, class Type, class RangeT>
void ProbBase< ThrTree, Type, RangeT >::TstCoreImplicit ( RangeT  aRng  )  [inline]

Same tests, but without functor. That is, uses operator+().

The result is calculated again. Performances are not important.


Member Data Documentation

template<class ThrTree, class Type, class RangeT>
size_t ProbBase< ThrTree, Type, RangeT >::_Dist

template<class ThrTree, class Type, class RangeT>
Type ProbBase< ThrTree, Type, RangeT >::_Init

template<class ThrTree, class Type, class RangeT>
size_t ProbBase< ThrTree, Type, RangeT >::_pbSz [private]

Number of elements in the input sequence.

template<class ThrTree, class Type, class RangeT>
Range& ProbBase< ThrTree, Type, RangeT >::_Rng [private]

template<class ThrTree, class Type, class RangeT>
ThrTree& ProbBase< ThrTree, Type, RangeT >::_ThrTree [private]

template<class ThrTree, class Type, class RangeT>
ThrTree ProbBase< ThrTree, Type, RangeT >::_ThrTree


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 10:20:31 2007 for rpa by  doxygen 1.4.7