June 2017
Intermediate to advanced
532 pages
12h 59m
English
It is crucial to understand the whole program first because then it is clear that all the CPU-intense work happens in one line of code in the main function:
transform(begin(v), end(v), begin(r), to_iteration_count);
The vector v contains all the indices that are mapped to complex coordinates, which are then in turn iterated over with the Mandelbrot algorithm. The result of each iteration is saved in vector r.
In the original program, this is the single line which consumes all the processing time for calculating the fractal image. All code that precedes it is just set up work and all code that follows it is just for printing. This means that parallelizing this line is key to more performance.
One possible approach to parallelizing ...
Read now
Unlock full access