#include <rpa/fulltests/sampling.h>
#include <rpa/functional.h>
#include <rpa/algorithms/transform.h>
#include <rpa/fulltests/comparer.h>
Classes | |
struct | oper_dbg< char > |
We use only lower-case letters, because it is easier to detect an error. More... | |
struct | oper_dbg< float > |
class | ProbBase< ThrTree, Type, RangeT > |
class | proxy_guard< Container, Mutex > |
struct | ProbFull< ContOut, ThrTree, Range > |
General template. More... | |
struct | ProbFull< Type[Nb], ThrTree, Range > |
When the output container is a fixed-size array. More... | |
struct | ProbFull< std::vector< Type >, ThrTree, Range > |
struct | ProbFull< std::list< Type >, ThrTree, Range > |
class | LoopIn< ThrTree, Type > |
struct | LoopIn< ThrTree, Type >::LoopOut< ContIn > |
class | LoopIn< ThrTree, Type >::LoopOut< ContIn >::LoopRng< ContOut > |
struct | EnumMyTypes |
Defines | |
#define | MAX_STATIC_SZ 65536 |
The size for data sets with C-like static arrays. | |
#define | NB_FLOA ( 10000 * TST_RATIO ) |
#define | TEST_FLOATS |
Typedefs | |
typedef rpa::mutex_count< rpa::sample_mutex_type > | transformTstMutex |
Functions | |
template<class ContOut, class ThrTree, class Range> | |
void | ProbFull_plain_ptr (ProbBase< ContOut, ThrTree, Range > &aPB) |
Applies only when the output container is a C-language static array. | |
template<class ContOut, class ThrTree, class Range> | |
void | ProbFull_plain (ProbBase< ContOut, ThrTree, Range > &aPB) |
template<class ContOut, class ThrTree, class Range> | |
void | ProbFull_back_insert (ProbBase< ContOut, ThrTree, Range > &aPB) |
template<class ContOut, class ThrTree, class Range, class Buffer> | |
void | ProbFull_obuf_back_ins_buf_unbounded (ProbBase< ContOut, ThrTree, Range > &aPB) |
template<class ContOut, class ThrTree, class Range, class Buffer> | |
void | ProbFull_obuf_back_ins_buf_bounded (ProbBase< ContOut, ThrTree, Range > &aPB) |
template<class ContOut, class ThrTree, class Range, class Buffer> | |
void | ProbFull_obib (ProbBase< ContOut, ThrTree, Range > &aPB, rpa::true_t hasLimit) |
All tests, if the buffer has an unlimited size. | |
template<class ContOut, class ThrTree, class Range, class Buffer> | |
void | ProbFull_obib (ProbBase< ContOut, ThrTree, Range > &aPB, rpa::false_t hasLimit) |
template<class ContOut, class ThrTree, class Range, class Buffer> | |
void | ProbFull_obuf_back_ins_buf (ProbBase< ContOut, ThrTree, Range > &aPB) |
template<class ContOut, class ThrTree, class Range> | |
void | ProbFull_obuf_back_insert (ProbBase< ContOut, ThrTree, Range > &aPB) |
template<class ThrTree> | |
void | TstCharsAux (ThrTree &aThrTree, const char *aStr) |
template<class ThrTree> | |
void | TstChars (ThrTree &aThrTree) |
template<class ThrTree> | |
void | TstFloats (ThrTree aThrTree) |
int | main (int aArgC, const char **aArgV) |
Variables | |
transformTstMutex | aLock |
static float | myF [NB_FLOA] |
Static buffer, so no need to put it on the stack. |
#define MAX_STATIC_SZ 65536 |
The size for data sets with C-like static arrays.
Idea: In debug mode, it would be fine to have a counter per thread, to be sure that the CPU load is well distributed over sub-threads.
#define NB_FLOA ( 10000 * TST_RATIO ) |
Test with doubles. They all must be in a given interval. So, runtime bug checking is very easy. The value TST_RATIO can adjust the duration of tests.
#define TEST_FLOATS |
This mutex is used for 'range_step'. It is encapsulated in a counter of locks/unlocks, to check how many times it is used.
int main | ( | int | aArgC, | |
const char ** | aArgV | |||
) |
void ProbFull_back_insert | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
void ProbFull_obib | ( | ProbBase< ContOut, ThrTree, Range > & | aPB, | |
rpa::false_t | hasLimit | |||
) |
If the buffer has a limited size, we can do only some tests. These tests will need a mutex to flush the buffer into the otuput sequence, each time it is full.
void ProbFull_obib | ( | ProbBase< ContOut, ThrTree, Range > & | aPB, | |
rpa::true_t | hasLimit | |||
) |
All tests, if the buffer has an unlimited size.
void ProbFull_obuf_back_ins_buf | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
void ProbFull_obuf_back_ins_buf_bounded | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
Same as ProbFull_obuf_back_insert, but for a given buffer type. We impose the buffer type, instead of taking the default one. ONLY FOR LIMITED-SIZED BUFFERS !
Buffer and buffer size limit. Buffer type is a list, without allocator.
Buffer and buffer size limit. We provide an allocator for the per-thread buffers.
void ProbFull_obuf_back_ins_buf_unbounded | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
Same as ProbFull_obuf_back_insert, but for a given buffer type. We impose the buffer type, instead of taking the default one. ONLY FOR BUFFERS WiThOuT SIZE LIMIT !
No mutex nor buffer size limit. Buffer type is a list, without allocator.
No mutex nor buffer size limit. We provide an allocator for the per-thread buffers.
void ProbFull_obuf_back_insert | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
void ProbFull_plain | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
For containers which are already 'resized' to the right output size. We just need to have the algorithm overwrite the content of the output container.
void ProbFull_plain_ptr | ( | ProbBase< ContOut, ThrTree, Range > & | aPB | ) |
Applies only when the output container is a C-language static array.
void TstChars | ( | ThrTree & | aThrTree | ) |
Some carefully chosen number of elements to test various configurations, compared to the number of threads, the minimal number of elemnts to process, etc...
It is a minimal number of elements.
We test with three threads.
Must work with empty strings,
void TstCharsAux | ( | ThrTree & | aThrTree, | |
const char * | aStr | |||
) |
Must use only lowercase letters. Any other values is detected and makes the program crash. All letters must be different.
void TstFloats | ( | ThrTree | aThrTree | ) |
All the values out of the interval [0,NB_FLOA] are considered as invalid. All numbers must be different (This is checked for detecting duplication}.
float myF[NB_FLOA] [static] |
Static buffer, so no need to put it on the stack.