diff options
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | TODO.md | 6 | ||||
| -rw-r--r-- | src/fractals.c | 9 |
3 files changed, 12 insertions, 9 deletions
@@ -24,8 +24,10 @@ If you wish to compile with additional floating point precision, add `-DEXTENDED ### Running Any version of the program can be used to generate a visualizer compatible `.grid` file. -All versions of the program support the same command line arguments -The performance flag outputs information in the format of `<PROGRAM>,<FRACTAL>,<RUNTIME>`. +All versions of the program support the same command line arguments. + +The performance flag outputs information in the format of +`<PROGRAM>,<FRACTAL>,<HORIZONTAL_SAMPLES>,<VERTICAL_SAMPLES>,<LOWER_REAL>,<LOWER_IMAG>,<UPPER_REAL>,<UPPER_IMAG>,<RUNTIME>`. Note that the runtime is an average runtime from multiple runs. The number of runs can be adjusted directly in `src/fractals.c` in `NUM_RUNS` or passed set in `CPPFLAGS` by adding `-DNUM_RUNS=N` @@ -6,9 +6,9 @@ * [x] read/write grids to/from file * [ ] create image with libgd * [ ] create animation with libgd -* [ ] code refactor - * [ ] change functions so that complex_t is passed instead of complex from <complex.h> - * [ ] store the size of lower_left and upper_right before the values of lower_left and upper_right in the .grid format +* [x] code refactor + * [x] change functions so that complex_t is passed instead of complex from <complex.h> + * [x] store the size of lower_left and upper_right before the values of lower_left and upper_right in the .grid format * [x] write serial * [x] mandelbrot * [x] multibrot diff --git a/src/fractals.c b/src/fractals.c index 6b4c67a..7f1f605 100644 --- a/src/fractals.c +++ b/src/fractals.c @@ -67,7 +67,7 @@ int main(const int argc, char *argv[]) { bool verbose = false; bool performance = false; grid_gen_params* params; - char* fractal_name; + char* fractal_name = "mandelbrot"; fractal_generator generator = mandelbrot_grid; char* output_filename = "fractal.grid"; @@ -176,13 +176,14 @@ int main(const int argc, char *argv[]) { zoom_grid(grid, magnification); } - // TODO: make additional param to fractals that take these in - generator(grid, params); if(performance){ double time = time_fractal(generator, grid, params); - printf("%s,%f\n", fractal_name, time); + printf("%s,%s,%zu,%zu," + CFORMAT","CFORMAT","CFORMAT","CFORMAT",%f\n", + argv[0], fractal_name, x_res, y_res, + lower_left.re, lower_left.im, upper_right.re, upper_right.im, time); } if(verbose){ |
