2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00
Files
math/test/compile_test/quad_naive_monte_carlo_incl_test.cpp
2021-07-04 17:26:02 +03:00

36 lines
840 B
C++

/*
* Copyright Nick Thompson, 2017
* 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)
*/
#ifdef _MSC_VER
#pragma warning(disable:4459)
#endif
#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
#include <boost/math/quadrature/naive_monte_carlo.hpp>
#include "test_compile_result.hpp"
using boost::math::quadrature::naive_monte_carlo;
void compile_and_link_test()
{
auto g = [&](std::vector<double> const &)
{
return 1.873;
};
std::vector<std::pair<double, double>> bounds{{0, 1}, {0, 1}, {0, 1}};
naive_monte_carlo<double, decltype(g)> mc(g, bounds, 1.0);
auto task = mc.integrate();
check_result<double>(task.get());
}
#else
void compile_and_link_test()
{
}
#endif