From 1833051ff16879833b26442b0bb7231a18e8fc1f Mon Sep 17 00:00:00 2001 From: Nikola Date: Wed, 15 Jul 2026 16:21:25 +0200 Subject: [PATCH] Add: Testing amount constant = 100 Remove: Old commented tests --- Implementierung/main.c | 55 +++++++++++------------------------- Implementierung/tricorn_V1.c | 2 +- 2 files changed, 18 insertions(+), 39 deletions(-) diff --git a/Implementierung/main.c b/Implementierung/main.c index 320ae24..ef883dd 100644 --- a/Implementierung/main.c +++ b/Implementierung/main.c @@ -16,6 +16,8 @@ #include "tricorn_V3.h" +const uint16_t TESTING_AMOUNT = 100; + void save_bmp(const char *filename, unsigned char *img, size_t width, ssize_t height,_Bool color); @@ -80,68 +82,45 @@ unsigned tests(void) { return EXIT_FAILURE; } - // printf("\nTest 1: Default image, not coloured\n"); - // printf("\n\n"); - // benchmarking(10,0,-2.0f - 0.5f*I, width, height, 0.001f, 200, false, tempArrNotColored); - // printf("\n\n"); - // benchmarking(10,1,-2.0f - 0.5f*I, width, height, 0.001f, 200, false, tempArrNotColored); - // printf("\n\n"); - // benchmarking(10,2,-2.0f - 0.5f*I, width, height, 0.001f, 200, false, tempArrNotColored); - // printf("\n\n"); - // benchmarking(10,3,-2.0f - 0.5f*I, width, height, 0.001f, 200, false, tempArrNotColored); - printf("\n\n\nTest 1: Default image, coloured\n"); printf("\n\n"); - benchmarking(10,0,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); + benchmarking(TESTING_AMOUNT,0,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); printf("\n\n"); - benchmarking(10,1,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); + benchmarking(TESTING_AMOUNT,1,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); printf("\n\n"); - benchmarking(10,2,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); + benchmarking(TESTING_AMOUNT,2,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); printf("\n\n"); benchmarking(10,3,-2.0f - 0.5f*I, width, height, 0.001f, 200, true, tempArrColored); printf("\n\n\nTest 2: Ultra high resolution low iterations\n"); printf("\n\n"); - benchmarking(10,0,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); + benchmarking(TESTING_AMOUNT,0,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); printf("\n\n"); - benchmarking(10,1,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); + benchmarking(TESTING_AMOUNT,1,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); printf("\n\n"); - benchmarking(10,2,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); + benchmarking(TESTING_AMOUNT,2,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); printf("\n\n"); - benchmarking(10,3,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); - - - // printf("\n\n\nTest 4: High iteration count\n"); - // printf("\n\n"); - // benchmarking(10,0,-2.0f - 0.5f*I, width, height, 0.001f, 5000, false, tempArrNotColored); - // printf("\n\n"); - // benchmarking(10,1,-2.0f - 0.5f*I, width, height, 0.001f, 5000, false, tempArrNotColored); - // printf("\n\n"); - // benchmarking(10,2,-2.0f - 0.5f*I, width, height, 0.001f, 5000, false, tempArrNotColored); - // printf("\n\n"); - // benchmarking(10,3,-2.0f - 0.5f*I, width, height, 0.001f, 5000, false, tempArrNotColored); - - + benchmarking(TESTING_AMOUNT,3,-2.0f - 0.5f*I, ultra_width, ultra_height, 0.001f, 5, true, tempArrUltraColored); printf("\n\n\nTest 3: Zoomed on fractal edge\n"); printf("\n\n"); - benchmarking(10,0,-1.431f - 0.250f*I, 1024, 1024, 0.0005f, 3000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,0,-1.431f - 0.250f*I, 1024, 1024, 0.0005f, 3000, false, tempArrNotColored); printf("\n\n"); - benchmarking(10,1,-1.1f - 0.0f*I, 1024, 1024, 0.0005f, 3000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,1,-1.1f - 0.0f*I, 1024, 1024, 0.0005f, 3000, false, tempArrNotColored); printf("\n\n"); - benchmarking(10,2,-1.1f - 0.0f*I, 1024, 512, 0.0005f, 3000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,2,-1.1f - 0.0f*I, 1024, 512, 0.0005f, 3000, false, tempArrNotColored); printf("\n\n"); - benchmarking(10,3,-1.1f - 0.0f*I, 1024, 512, 0.0005f, 3000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,3,-1.1f - 0.0f*I, 1024, 512, 0.0005f, 3000, false, tempArrNotColored); printf("\nTest 4: Pure Black\n"); printf("\n\n"); - benchmarking(10,0,0, width, height, 0.00001f, 1000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,0,0, width, height, 0.00001f, 1000, false, tempArrNotColored); printf("\n\n"); - benchmarking(10,1,0, width, height, 0.00001f, 1000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,1,0, width, height, 0.00001f, 1000, false, tempArrNotColored); printf("\n\n"); - benchmarking(10,2,0, width, height, 0.00001f, 1000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,2,0, width, height, 0.00001f, 1000, false, tempArrNotColored); printf("\n\n"); - benchmarking(10,3,0, width, height, 0.00001f, 1000, false, tempArrNotColored); + benchmarking(TESTING_AMOUNT,3,0, width, height, 0.00001f, 1000, false, tempArrNotColored); diff --git a/Implementierung/tricorn_V1.c b/Implementierung/tricorn_V1.c index 0075309..d0f6ca3 100644 --- a/Implementierung/tricorn_V1.c +++ b/Implementierung/tricorn_V1.c @@ -33,7 +33,7 @@ void tricorn_V1(float complex start, size_t width, ssize_t height, float res, un // As we iterate from the top always, if it is negative we would have to start at the end of the imaginary part and go in the oposite direction when generating ssize_t imag_direction = height < 0 ? -1 : 1; float c_start_real = creal(start); - float c_start_imag = height > 0 ? cimag(start) : cimag(start) + ((actual_height-1) * res);; + float c_start_imag = height > 0 ? cimag(start) : cimag(start) + ((actual_height-1) * res); float vertical_step = imag_direction * res;