ellint_pi2_data.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. using namespace boost::math::tools;
  14. using namespace boost::math;
  15. using namespace std;
  16. int cpp_main(int argc, char*argv [])
  17. {
  18. using namespace boost::math::tools;
  19. parameter_info<mp_t> arg1, arg2;
  20. test_data<mp_t> data;
  21. bool cont;
  22. std::string line;
  23. if(argc < 1)
  24. return 1;
  25. do{
  26. if(0 == get_user_parameter_info(arg1, "n"))
  27. return 1;
  28. if(0 == get_user_parameter_info(arg2, "k"))
  29. return 1;
  30. mp_t (*fp)(mp_t, mp_t) = &ellint_3;
  31. data.insert(fp, arg2, arg1);
  32. std::cout << "Any more data [y/n]?";
  33. std::getline(std::cin, line);
  34. boost::algorithm::trim(line);
  35. cont = (line == "y");
  36. }while(cont);
  37. std::cout << "Enter name of test data file [default=ellint_pi2_data.ipp]";
  38. std::getline(std::cin, line);
  39. boost::algorithm::trim(line);
  40. if(line == "")
  41. line = "ellint_pi2_data.ipp";
  42. std::ofstream ofs(line.c_str());
  43. line.erase(line.find('.'));
  44. ofs << std::scientific << std::setprecision(40);
  45. write_code(ofs, data, line.c_str());
  46. return 0;
  47. }