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