2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-27 19:12:08 +00:00
Files
math/test/test_rationals.cpp
John Maddock 4bdf0dd8f0 Added alternative polynomial and rational function evaluation methods.
Added new optimisation config options (still need documenting).
Tidied up use of instrumentation code so they all use BOOST_MATH_INSTRUMENT now.
Various tweaks to inverse incomplete beta and gamma to reduce number of iterations.
Changed incomplete gamma and beta to calculate derivative at the same time as the function (performance optimisation for inverses).
Fixed MinGW failures.
Refactored and extended rational / polynomial test cases.

[SVN r4172]
2007-05-22 08:52:48 +00:00

48 lines
1.5 KiB
C++

// (C) Copyright John Maddock 2006.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/math/concepts/real_concept.hpp>
#include <boost/test/included/test_exec_monitor.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/array.hpp>
#include <boost/math/tools/rational.hpp>
#include "test_rational.hpp"
template <class T>
void test_spots(T t, const char* n)
{
std::cout << "Testing basic sanity checks for type " << n << std::endl;
do_test_spots(t, int(0));
do_test_spots(t, unsigned(0));
#ifdef BOOST_HAS_LONG_LONG
do_test_spots(t, (unsigned long long)(0));
#endif
do_test_spots(t, float(0));
do_test_spots(t, T(0));
}
extern void test_spots(float t, const char* n);
extern void test_spots(double t, const char* n);
extern void test_spots(long double t, const char* n);
int test_main(int, char* [])
{
test_spots(0.0F, "float");
test_spots(0.0, "double");
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
test_spots(0.0L, "long double");
test_spots(boost::math::concepts::real_concept(0.1), "real_concept");
#else
std::cout << "<note>The long double tests have been disabled on this platform "
"either because the long double overloads of the usual math functions are "
"not available at all, or because they are too inaccurate for these tests "
"to pass.</note>" << std::cout;
#endif
return 0;
}