]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/tools/hermite_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)
6 #include <boost/math/tools/test_data.hpp>
7 #include <boost/math/special_functions/hermite.hpp>
11 using namespace boost::math::tools
;
12 using namespace boost::math
;
17 boost::math::tuple
<T
, T
, T
> hermite_data(T n
, T x
)
20 T r1
= hermite(boost::math::tools::real_cast
<unsigned>(n
), x
);
21 return boost::math::make_tuple(n
, x
, r1
);
24 int main(int argc
, char*argv
[])
26 using namespace boost::math::tools
;
28 parameter_info
<mp_t
> arg1
, arg2
, arg3
;
31 std::cout
<< boost::math::hermite(10, static_cast<mp_t
>(1e300
)) << std::endl
;
40 if(0 == get_user_parameter_info(arg1
, "n"))
42 if(0 == get_user_parameter_info(arg2
, "x"))
44 arg1
.type
|= dummy_param
;
45 arg2
.type
|= dummy_param
;
47 data
.insert(&hermite_data
<mp_t
>, arg1
, arg2
);
49 std::cout
<< "Any more data [y/n]?";
50 std::getline(std::cin
, line
);
51 boost::algorithm::trim(line
);
55 std::cout
<< "Enter name of test data file [default=hermite.ipp]";
56 std::getline(std::cin
, line
);
57 boost::algorithm::trim(line
);
60 std::ofstream
ofs(line
.c_str());
61 line
.erase(line
.find('.'));
62 ofs
<< std::scientific
<< std::setprecision(40);
63 write_code(ofs
, data
, line
.c_str());