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/special_functions/expint.hpp> 7 #include <boost/math/constants/constants.hpp> 8 #include <fstream> 9 #include <boost/math/tools/test_data.hpp> 10 #include "mp_t.hpp" 11 12 using namespace boost::math::tools; 13 14 main()15int main() 16 { 17 parameter_info<mp_t> arg1; 18 test_data<mp_t> data; 19 20 mp_t (*f)(mp_t) = boost::math::expint; 21 22 std::cout << "Welcome.\n" 23 "This program will generate spot tests for the expint Ei function:\n" 24 " expint(a)\n\n"; 25 26 bool cont; 27 std::string line; 28 29 do{ 30 get_user_parameter_info(arg1, "a"); 31 data.insert(f, arg1); 32 33 std::cout << "Any more data [y/n]?"; 34 std::getline(std::cin, line); 35 boost::algorithm::trim(line); 36 cont = (line == "y"); 37 }while(cont); 38 39 std::cout << "Enter name of test data file [default=expinti_data.ipp]"; 40 std::getline(std::cin, line); 41 boost::algorithm::trim(line); 42 if(line == "") 43 line = "expinti_data.ipp"; 44 std::ofstream ofs(line.c_str()); 45 ofs << std::scientific << std::setprecision(40); 46 write_code(ofs, data, "expinti_data"); 47 48 return 0; 49 } 50 51