]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/tools/ellint_d2_data.cpp
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_1.hpp>
9 #include <boost/math/special_functions/ellint_2.hpp>
11 #include <boost/math/tools/test_data.hpp>
14 using namespace boost::math::tools
;
15 using namespace boost::math
;
18 mp_t
ellint_d(mp_t phi
, mp_t k
)
20 return (boost::math::ellint_1(k
, phi
) - boost::math::ellint_2(k
, phi
)) / (k
* k
);
23 int cpp_main(int argc
, char*argv
[])
25 using namespace boost::math::tools
;
27 parameter_info
<mp_t
> arg1
, arg2
;
37 if(0 == get_user_parameter_info(arg1
, "phi"))
39 if(0 == get_user_parameter_info(arg2
, "k"))
42 mp_t(*fp
)(mp_t
, mp_t
) = &ellint_d
;
43 data
.insert(fp
, arg1
, arg2
);
45 std::cout
<< "Any more data [y/n]?";
46 std::getline(std::cin
, line
);
47 boost::algorithm::trim(line
);
51 std::cout
<< "Enter name of test data file [default=ellint_d2_data.ipp]";
52 std::getline(std::cin
, line
);
53 boost::algorithm::trim(line
);
55 line
= "ellint_d2_data.ipp";
56 std::ofstream
ofs(line
.c_str());
57 line
.erase(line
.find('.'));
58 ofs
<< std::scientific
<< std::setprecision(40);
59 write_code(ofs
, data
, line
.c_str());