From 52c3fee8341aa5a720277228fb1424a50737c0fb Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 18 Oct 2023 09:21:55 +0200 Subject: [PATCH] GEOMETRIC RANDOM TESTS OK - RAND() % 160 - REALLOC FOR EACH VERTEX & LINE --- src/graphics/graphics.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 393b3b4..28249c6 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -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) { -// assert : space dimensions (x,y,z) > 0 TODO NOT checked before init -// assert : arrows localization within space and sites TODO NOT checked when invoking set_arrow() -// assert : no more than one arrow per address TODO NOT checked before init -// notify : weights are replaced, NOT added (could be !) TODO +// assert : space dimensions (x,y,z) > 0 +// assert : arrows localization within space and sites +// assert : no more than one arrow per address +// notify : weights are replaced, NOT added (could be !) - // Initialisation du générateur pseudo-aléatoire - srand(time(NULL)); + srand(time(NULL)); // Initialisation du générateur pseudo-aléatoire int rand(void); 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, space_Y = 1 + rand() % arbitrary, space_Z = 1 + rand() % arbitrary; int density_max = space_X * space_Y * 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 specif_arrows_nb = rand() % density_max / 3;