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 |
typedef rpa::BeginEnd< ContOut > ProbBase< ThrTree, Type, RangeT >::BeginEndType [private] |
typedef thread_traits_type::behaviour_type ProbBase< ThrTree, Type, RangeT >::behaviour_type [private] |
typedef rpa::Comparer< BeginEndType, behaviour_type, Range > ProbBase< ThrTree, Type, RangeT >::ComparerT [private] |
typedef BeginEndType::value_type ProbBase< ThrTree, Type, RangeT >::result_type [private] |
typedef rpa::ThreadTraits< ThrTree > ProbBase< ThrTree, Type, RangeT >::thread_traits_type [private] |
typedef Range::value_type ProbBase< ThrTree, Type, RangeT >::value_type [private] |
typedef RangeT::value_type ProbBase< ThrTree, Type, RangeT >::value_type |
ProbBase< ThrTree, Type, RangeT >::ProbBase | ( | ThrTree | aThrTree, | |
size_t | aDist, | |||
const Type & | aInit, | |||
RangeT | aRng | |||
) | [inline] |
ProbBase< ThrTree, Type, RangeT >::ProbBase | ( | ThrTree & | aThrTree, | |
size_t | aDist, | |||
Range & | aRng | |||
) | [inline] |
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.
size_t ProbBase< ThrTree, Type, RangeT >::nb_elems | ( | void | ) | const [inline] |
rpa::thr_nb_t ProbBase< ThrTree, Type, RangeT >::threadsNb | ( | void | ) | const [inline] |
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.
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.
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.
size_t ProbBase< ThrTree, Type, RangeT >::_pbSz [private] |
Number of elements in the input sequence.
Range& ProbBase< ThrTree, Type, RangeT >::_Rng [private] |
ThrTree& ProbBase< ThrTree, Type, RangeT >::_ThrTree [private] |
ThrTree ProbBase< ThrTree, Type, RangeT >::_ThrTree |