From c176f9491411f53000b0350cafc1d17db0ef09ec Mon Sep 17 00:00:00 2001 From: JP Appel Date: Fri, 26 Apr 2024 17:24:33 -0400 Subject: add degree, constant, radius to performance output --- README.md | 4 ++-- src/fractals.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1f30b0e..17c312e 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ All versions of the program support the same command line arguments. The performance flag outputs information in the format of: ``` -,,,,,,,,, +,,,,,,,,,,,,, ``` Note that the runtime is an average runtime from multiple runs. @@ -45,7 +45,7 @@ Options: -l, --lower-left Set the lower left corner of the fractal area (default: -2-2i) -u, --upper-right Set the upper right corner of the fractal area (default: 2+2i) -z, --magnification Set the magnification factor (default: 1) - -d, --degree Set the degree for fractals that use it (default: 1) + -d, --degree Set the degree for fractals that use it (default: 2) -c, --constant Set the constant for fractals that use it (default: 0+0i) -r, --radius Set the radius for fractals that use it (default: 2) -o, --output the output filename (default: fractal.grid) diff --git a/src/fractals.c b/src/fractals.c index 80fcc18..898f30d 100644 --- a/src/fractals.c +++ b/src/fractals.c @@ -28,7 +28,7 @@ void print_help(){ " -l, --lower-left Set the lower left corner of the fractal area (default: -2.0+-2.0i)\n" " -u, --upper-right Set the upper right corner of the fractal area (default: 2.0+2.0i)\n" " -z, --magnification Set the magnification factor (default: 1)\n" - " -d, --degree Set the degree for fractals that use it (default: 1)\n" + " -d, --degree Set the degree for fractals that use it (default: 2)\n" " -c, --constant Set the constant for fractals that use it (default: 0+0i)\n" " -r, --radius Set the radius for fractals that use it (default: 2)\n" " -o, --output the output filename (default: fractal.grid)\n" @@ -84,7 +84,7 @@ int main(const int argc, char *argv[]) { //degree is mutually exclusive with constant and radius bool param_is_degree = false; bool param_is_cr = false; - CBASE degree = 1; + CBASE degree = 2; complex_t constant = { .re = 0, .im = 0}; double radius = 2; @@ -264,9 +264,9 @@ int main(const int argc, char *argv[]) { if(performance){ double time = time_fractal(generator, grid, params); - printf("%s,%s,%hhu,%zu,%zu," - CFORMAT","CFORMAT","CFORMAT","CFORMAT",%f\n", - argv[0], fractal_name, iterations, x_res, y_res, + printf("%s,%s,%lf,"CFORMAT","CFORMAT",%lf,%hhu,%zu,%zu,", + argv[0], fractal_name, degree, constant.re, constant.im, radius, iterations, x_res, y_res); + printf(CFORMAT","CFORMAT","CFORMAT","CFORMAT",%f\n", lower_left.re, lower_left.im, upper_right.re, upper_right.im, time); } -- cgit v1.2.3