]>
Commit | Line | Data |
---|---|---|
1 | // Copyright John Maddock 2006. | |
2 | // Use, modification and distribution are subject to the | |
3 | // Boost Software License, Version 1.0. | |
4 | // (See accompanying file LICENSE_1_0.txt | |
5 | // or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | #include <boost/math/tools/test_data.hpp> | |
7 | #include <boost/test/included/prg_exec_monitor.hpp> | |
8 | #include <boost/math/special_functions/ellint_2.hpp> | |
9 | #include <boost/math/special_functions/ellint_3.hpp> | |
10 | #include <fstream> | |
11 | #include <boost/math/tools/test_data.hpp> | |
12 | #include "mp_t.hpp" | |
13 | ||
14 | using namespace boost::math::tools; | |
15 | using namespace boost::math; | |
16 | using namespace std; | |
17 | ||
18 | int cpp_main(int argc, char*argv []) | |
19 | { | |
20 | using namespace boost::math::tools; | |
21 | ||
22 | parameter_info<mp_t> arg1, arg2; | |
23 | test_data<mp_t> data; | |
24 | ||
25 | bool cont; | |
26 | std::string line; | |
27 | ||
28 | if(argc < 1) | |
29 | return 1; | |
30 | ||
31 | do{ | |
32 | if(0 == get_user_parameter_info(arg1, "n")) | |
33 | return 1; | |
34 | if(0 == get_user_parameter_info(arg2, "k")) | |
35 | return 1; | |
36 | ||
37 | mp_t (*fp)(mp_t, mp_t) = &ellint_3; | |
38 | data.insert(fp, arg2, arg1); | |
39 | ||
40 | std::cout << "Any more data [y/n]?"; | |
41 | std::getline(std::cin, line); | |
42 | boost::algorithm::trim(line); | |
43 | cont = (line == "y"); | |
44 | }while(cont); | |
45 | ||
46 | std::cout << "Enter name of test data file [default=ellint_pi2_data.ipp]"; | |
47 | std::getline(std::cin, line); | |
48 | boost::algorithm::trim(line); | |
49 | if(line == "") | |
50 | line = "ellint_pi2_data.ipp"; | |
51 | std::ofstream ofs(line.c_str()); | |
52 | line.erase(line.find('.')); | |
53 | ofs << std::scientific << std::setprecision(40); | |
54 | write_code(ofs, data, line.c_str()); | |
55 | ||
56 | return 0; | |
57 | } | |
58 | ||
59 |