#include <vector>
#include <list>
#include <deque>
#include <set>
#include <rpa/platforms.h>
#include <rpa/functional.h>
#include <rpa/fulltests/sampling.h>
#include <rpa/algorithms/accumulate.h>
Classes | |
struct | oper_dbg< _Tp > |
General case. Should never be called. More... | |
struct | oper_dbg< char > |
We use only lower-case letters, because it is easier to detect an error. More... | |
struct | oper_dbg< FLT_TYPE > |
class | ProbBase< ThrTree, Type, RangeT > |
class | LoopIn< ThrTree, Type > |
class | LoopIn< ThrTree, Type >::LoopRng< ContIn > |
struct | EnumMyTypes |
Defines | |
#define | FLT_TYPE long double |
#define | MAX_STATIC_SZ ( 1000000 * TST_RATIO ) |
#define | NB_FLOA MAX_STATIC_SZ |
#define | TEST_CHARS |
#define | TEST_FLOATS |
Functions | |
static void | check (char myA, char myB) |
static void | check (FLT_TYPE myA, FLT_TYPE myB) |
FLT_TYPE | NB_FLOA_FLT (NB_FLOA) |
template<class ThrTree> | |
void | TstCharsAux (ThrTree aThrTree, char aInit, const char *aStr) |
template<class ThrTree> | |
void | TstChars (ThrTree aThrTree) |
Various sizes because the algorithm dynamic sizing adapts to the data size. | |
template<class ThrTree> | |
void | TstFloats (ThrTree aThrTree) |
int | main (int aArgC, const char **aArgV) |
Variables | |
rpa::mutex_count< rpa::sample_mutex_type > | aLock |
These containers are used ase inputs. | |
FLT_TYPE | SUM_FLOA = (( NB_FLOA_FLT * ( NB_FLOA_FLT - (FLT_TYPE)1))/ (FLT_TYPE)2.0) |
static FLT_TYPE | myF [NB_FLOA] |
Global variable because if is put on the stack, it may crash everything. |
#define FLT_TYPE long double |
We need big precision because 10.000 additions. With 'float', we get this error : Erreur 4.99944e+07 != 4.99929e+07 With 'double', it is OK on Linux. But fails on Cygwin. Differents libraries ?
#define MAX_STATIC_SZ ( 1000000 * TST_RATIO ) |
In debug mode, it would be fine to have a counter on each thread, just to check that the CPU load is well balanced. Even with 'long double', precision problems over 200000 The constant TST_RATIO adjusts the tests duration.
#define NB_FLOA MAX_STATIC_SZ |
#define TEST_CHARS |
#define TEST_FLOATS |
static void check | ( | FLT_TYPE | myA, | |
FLT_TYPE | myB | |||
) | [static] |
static void check | ( | char | myA, | |
char | myB | |||
) | [static] |
int main | ( | int | aArgC, | |
const char ** | aArgV | |||
) |
FLT_TYPE NB_FLOA_FLT | ( | NB_FLOA | ) |
void TstChars | ( | ThrTree | aThrTree | ) |
Various sizes because the algorithm dynamic sizing adapts to the data size.
void TstCharsAux | ( | ThrTree | aThrTree, | |
char | aInit, | |||
const char * | aStr | |||
) |
Only lowercase letters : All the other ones are checked, and means there was an error somewhere. The comparison tests work only if all letters are different.
void TstFloats | ( | ThrTree | aThrTree | ) |
These containers are used ase inputs.
This mutex is used for 'range_step'. It is encapsulated in a counter of locks/unlocks, to check how many times it is used.
FLT_TYPE myF[NB_FLOA] [static] |
Global variable because if is put on the stack, it may crash everything.
FLT_TYPE SUM_FLOA = (( NB_FLOA_FLT * ( NB_FLOA_FLT - (FLT_TYPE)1))/ (FLT_TYPE)2.0) |