GEOMETRIC RANDOM TESTS OK - RAND() % 160 - REALLOC FOR EACH VERTEX & LINE

This commit is contained in:
Jean Sirmai 2023-10-18 09:21:55 +02:00
parent fee555c006
commit 52c3fee834
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 7 additions and 8 deletions

View File

@ -667,24 +667,23 @@ static inline int set_arrow (struct arrow_t *arrows, int arrows_nb, int requeste
*/ */
void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void)
{ {
// assert : space dimensions (x,y,z) > 0 TODO NOT checked before init // assert : space dimensions (x,y,z) > 0
// assert : arrows localization within space and sites TODO NOT checked when invoking set_arrow() // assert : arrows localization within space and sites
// assert : no more than one arrow per address TODO NOT checked before init // assert : no more than one arrow per address
// notify : weights are replaced, NOT added (could be !) TODO // notify : weights are replaced, NOT added (could be !)
// Initialisation du générateur pseudo-aléatoire srand(time(NULL)); // Initialisation du générateur pseudo-aléatoire
srand(time(NULL));
int rand(void); int rand(void);
void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min); void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min);
int arbitrary = 10; int arbitrary = 160;
int space_X = 1 + rand() % arbitrary, int space_X = 1 + rand() % arbitrary,
space_Y = 1 + rand() % arbitrary, space_Y = 1 + rand() % arbitrary,
space_Z = 1 + rand() % arbitrary; space_Z = 1 + rand() % arbitrary;
int density_max = space_X * space_Y * space_Z; int density_max = space_X * space_Y * space_Z;
int max = fmax(space_X, space_Y); max = fmax(max, space_Z); int max = fmax(space_X, space_Y); max = fmax(max, space_Z);
int show_space_design = 1, print_arrows_data = 1; int show_space_design = 1, print_arrows_data = 0;
int load = 0, site = 0, x = 0, y = 0, z = 0; int load = 0, site = 0, x = 0, y = 0, z = 0;
int specif_arrows_nb = rand() % density_max / 3; int specif_arrows_nb = rand() % density_max / 3;