summaryrefslogtreecommitdiff
path: root/boost/libs/math/test/test_minima.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-05-11 22:18:20 +0200
committerChristoph Berg <myon@debian.org>2020-05-11 22:18:20 +0200
commita8edac06b534058e52126c4d55e23b217df2df91 (patch)
treef2c3567fae58aad676d544ee8f07ac78dd2eb1ec /boost/libs/math/test/test_minima.cpp
parent4f6c0156a70e8f2ff70fe5a1a39f5e9b22ffd026 (diff)
parent32a41b1abe1a4aab0892c9c2051be6ba5b379f1e (diff)
Update upstream source from tag 'upstream/2.2.0_rc1+repack'
Update to upstream version '2.2.0~rc1+repack' with Debian dir fe177bc6cd2d4c1256a3775504f6010be54e7463
Diffstat (limited to 'boost/libs/math/test/test_minima.cpp')
-rw-r--r--boost/libs/math/test/test_minima.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/boost/libs/math/test/test_minima.cpp b/boost/libs/math/test/test_minima.cpp
deleted file mode 100644
index e2f8560b..00000000
--- a/boost/libs/math/test/test_minima.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright John Maddock 2006.
-// Copyright Paul A. Bristow 2007.
-
-// 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 <pch.hpp>
-
-#include <boost/math/tools/minima.hpp>
-#define BOOST_TEST_MAIN
-#include <boost/test/unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
-#include <boost/math/special_functions/gamma.hpp>
-#include <iostream>
-#include <iomanip>
-
-template <class T>
-struct poly_test
-{
- // minima is at (3,4):
- T operator()(const T& v)
- {
- T a = v - 3;
- return 3 * a * a + 4;
- }
-};
-
-template <class T>
-void test_minima(T, const char* /* name */)
-{
- std::pair<T, T> m = boost::math::tools::brent_find_minima(poly_test<T>(), T(-10), T(10), 50);
- BOOST_CHECK_CLOSE(m.first, T(3), T(0.001));
- BOOST_CHECK_CLOSE(m.second, T(4), T(0.001));
-
- T (*fp)(T);
-#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
- fp = boost::math::lgamma<T>;
-#else
- fp = boost::math::lgamma;
-#endif
-
- m = boost::math::tools::brent_find_minima(fp, T(0.5), T(10), 50);
- BOOST_CHECK_CLOSE(m.first, T(1.461632), T(0.1));
-#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
- fp = boost::math::tgamma<T>;
-#else
- fp = boost::math::tgamma;
-#endif
- m = boost::math::tools::brent_find_minima(fp, T(0.5), T(10), 50);
- BOOST_CHECK_CLOSE(m.first, T(1.461632), T(0.1));
-}
-
-BOOST_AUTO_TEST_CASE( test_main )
-{
- test_minima(0.1f, "float");
- test_minima(0.1, "double");
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_minima(0.1L, "long double");
-#endif
-
-}
-
-