2 * Copyright Evan Miller, 2020
3 * Use, modification and distribution are subject to the
4 * Boost Software License, Version 1.0. (See accompanying file
5 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/math/tools/test_data.hpp>
10 #include <boost/test/included/prg_exec_monitor.hpp>
11 #include <boost/math/special_functions/jacobi_theta.hpp>
13 #include <boost/math/tools/test_data.hpp>
15 using namespace boost::math::tools
;
16 using namespace boost::math
;
19 struct jacobi_theta_data_generator
21 boost::math::tuple
<mp_t
, mp_t
, mp_t
, mp_t
> operator()(mp_t z
, mp_t tau
)
23 return boost::math::make_tuple(
24 jacobi_theta1tau(z
, tau
),
25 jacobi_theta2tau(z
, tau
),
26 jacobi_theta3tau(z
, tau
),
27 jacobi_theta4tau(z
, tau
));
31 int cpp_main(int argc
, char*argv
[])
33 parameter_info
<mp_t
> arg1
, arg2
;
42 std::cout
<< "Welcome.\n"
43 "This program will generate spot tests for the Jacobi Theta functions.\n"
47 if(0 == get_user_parameter_info(arg1
, "z"))
49 if(0 == get_user_parameter_info(arg2
, "tau"))
52 data
.insert(jacobi_theta_data_generator(), arg1
, arg2
);
54 std::cout
<< "Any more data [y/n]?";
55 std::getline(std::cin
, line
);
56 boost::algorithm::trim(line
);
60 std::cout
<< "Generating " << data
.size() << " test points.";
62 std::cout
<< "Enter name of test data file [default=jacobi_theta.ipp]";
63 std::getline(std::cin
, line
);
64 boost::algorithm::trim(line
);
66 line
= "jacobi_theta.ipp";
67 std::ofstream
ofs(line
.c_str());
68 ofs
<< std::scientific
<< std::setprecision(40);
69 write_code(ofs
, data
, "jacobi_theta_data");