-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_mandelbrot.cpp
78 lines (58 loc) · 2.38 KB
/
test_mandelbrot.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2015 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#if (defined(__GNUC__) && defined(__clang__))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#include <concurrency/stopwatch.h>
#include <mandelbrot/mandelbrot.h>
#include <iomanip>
#include <iostream>
#include <sstream>
// Provide instructions for simple build on WSL.
// cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/mandelbrot
// Compile with cpp_dec_float
// ./build_all.sh --boost=/mnt/c/boost/boost_1_88_0 --my_cc=g++ --stdcc=c++20
// Compile with gmp_float
// ./build_all_gmp.sh --boost=/mnt/c/boost/boost_1_88_0 --my_cc=g++ --stdcc=c++20
auto main() -> int // NOLINT(bugprone-exception-escape)
{
using namespace ::ckormanyos::mandelbrot; // NOLINT(google-build-using-namespace)
const config::mandelbrot_config_type
mandelbrot_config_object
(
config::center_x() - config::dx_half(),
config::center_x() + config::dx_half(),
config::center_y() - config::dy_half(),
config::center_y() + config::dy_half(),
config::max_iter()
);
using mandelbrot_generator_type =
config::my_mandelbrot_generator_type<config::coord_pnt_numeric_type, config::iteration_numeric_type>;
color::color_stretch_histogram_method local_color_stretches;
const color::color_functions_bw local_color_functions;
mandelbrot_generator_type mandelbrot_generator(mandelbrot_config_object);
using stopwatch_type = concurrency::stopwatch;
stopwatch_type my_stopwatch { };
mandelbrot_generator.generate_mandelbrot_image(config::filename(),
local_color_functions,
local_color_stretches);
const auto execution_time = stopwatch_type::elapsed_time<float>(my_stopwatch);
{
std::stringstream strm;
strm << "Time for calculation: "
<< std::fixed
<< std::setprecision(std::streamsize { INT8_C(1) })
<< "execution_time: "
<< execution_time
<< "s";
std::cout << strm.str() << std::endl;
}
}
#if (defined(__GNUC__) && defined(__clang__))
#pragma GCC diagnostic pop
#endif