2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Cleanup examples

This commit is contained in:
Matt Borland
2021-03-21 09:14:15 +03:00
parent 4b6ad919b3
commit 8c4bac90e9
5 changed files with 10 additions and 15 deletions

View File

@@ -30,7 +30,6 @@ Dover, New York, 4th ed., (1945), pages 180-188.
#include <cmath> // for pow function.
#include <boost/math/special_functions.hpp> // For gamma function.
//] [/cstdfloat_example_1]
#include <boost/type_traits/is_same.hpp>
#include <iostream>

View File

@@ -10,10 +10,10 @@
# include <iostream>
# include <iomanip>
# include <limits>
# include <type_traits>
# include <cmath>
#include <boost/math/tools/assert.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/math/special_functions/next.hpp> // for float_distance
//[numeric_derivative_example

View File

@@ -16,8 +16,6 @@
#include <boost/cstdlib.hpp>
#include <boost/config.hpp>
#include <boost/array.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/math/tools/roots.hpp>
#include <boost/math/special_functions/ellint_1.hpp>
#include <boost/math/special_functions/ellint_2.hpp>
@@ -49,6 +47,7 @@ using boost::multiprecision::cpp_bin_float_50;
#include <fstream> // std::ofstream
#include <cmath>
#include <typeinfo> // for type name using typid(thingy).name();
#include <type_traits>
#ifdef __FILE__
std::string sourcefilename = __FILE__;
@@ -477,7 +476,7 @@ int test_root(cpp_bin_float_100 big_radius, cpp_bin_float_100 big_arc, cpp_bin_f
using boost::timer::cpu_times;
using boost::timer::cpu_timer;
long eval_count = boost::is_floating_point<T>::value ? 1000000 : 10000; // To give a sufficiently stable timing for the fast built-in types,
long eval_count = std::is_floating_point<T>::value ? 1000000 : 10000; // To give a sufficiently stable timing for the fast built-in types,
// This takes an inconveniently long time for multiprecision cpp_bin_float_50 etc types.
cpu_times now; // Holds wall, user and system times.

View File

@@ -15,9 +15,6 @@
#include <boost/cstdlib.hpp>
#include <boost/config.hpp>
#include <boost/array.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include "table_type.hpp"
// Copy of i:\modular-boost\libs\math\test\table_type.hpp
// #include "handle_test_result.hpp"
@@ -55,6 +52,7 @@ using boost::multiprecision::cpp_bin_float_50;
#include <fstream> // std::ofstream
#include <cmath>
#include <typeinfo> // for type name using typid(thingy).name();
#include <type_traits>
#ifndef BOOST_ROOT
# define BOOST_ROOT i:/modular-boost/
@@ -203,7 +201,7 @@ T cbrt_noderiv(T x)
// Maybe guess should be double, or use enable_if to avoid warning about conversion double to float here?
T guess;
if (boost::is_fundamental<T>::value)
if (std::is_fundamental<T>::value)
{
int exponent;
frexp(x, &exponent); // Get exponent of z (ignore mantissa).
@@ -257,7 +255,7 @@ T cbrt_deriv(T x)
using namespace boost::math::tools;
int exponent;
T guess;
if(boost::is_fundamental<T>::value)
if(std::is_fundamental<T>::value)
{
frexp(x, &exponent); // Get exponent of z (ignore mantissa).
guess = ldexp(static_cast<T>(1), exponent / 3); // Rough guess is to divide the exponent by three.
@@ -301,7 +299,7 @@ T cbrt_2deriv(T x)
using namespace boost::math::tools;
int exponent;
T guess;
if(boost::is_fundamental<T>::value)
if(std::is_fundamental<T>::value)
{
frexp(x, &exponent); // Get exponent of z (ignore mantissa).
guess = ldexp(static_cast<T>(1), exponent / 3); // Rough guess is to divide the exponent by three.
@@ -328,7 +326,7 @@ T cbrt_2deriv_s(T x)
using namespace boost::math::tools;
int exponent;
T guess;
if(boost::is_fundamental<T>::value)
if(std::is_fundamental<T>::value)
{
frexp(x, &exponent); // Get exponent of z (ignore mantissa).
guess = ldexp(static_cast<T>(1), exponent / 3); // Rough guess is to divide the exponent by three.

View File

@@ -16,8 +16,6 @@
#include <boost/cstdlib.hpp>
#include <boost/config.hpp>
#include <boost/array.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/math/concepts/real_concept.hpp>
#include <boost/math/tools/roots.hpp>
@@ -50,6 +48,7 @@ using boost::multiprecision::cpp_bin_float_50;
#include <fstream> // std::ofstream
#include <cmath>
#include <typeinfo> // for type name using typid(thingy).name();
#include <type_traits>
#ifdef __FILE__
std::string sourcefilename = __FILE__;
@@ -464,7 +463,7 @@ int test_root(cpp_bin_float_100 big_value, cpp_bin_float_100 answer, const char*
using boost::timer::cpu_times;
using boost::timer::cpu_timer;
int eval_count = boost::is_floating_point<T>::value ? 10000000 : 100000; // To give a sufficiently stable timing for the fast built-in types,
int eval_count = std::is_floating_point<T>::value ? 10000000 : 100000; // To give a sufficiently stable timing for the fast built-in types,
//int eval_count = 1000000; // To give a sufficiently stable timing for the fast built-in types,
// This takes an inconveniently long time for multiprecision cpp_bin_float_50 etc types.