• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright Nick Thompson, 2017
3  * Use, modification and distribution are subject to the
4  * Boost Software License, Version 1.0. (See accompanying file
5  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  */
7 
8 #ifdef _MSC_VER
9 #pragma warning(disable:4459)
10 #endif
11 
12 #if !defined(_MSC_VER) || (_MSC_VER >= 1900)
13 
14 #include <boost/math/quadrature/naive_monte_carlo.hpp>
15 #include "test_compile_result.hpp"
16 
17 using boost::math::quadrature::naive_monte_carlo;
compile_and_link_test()18 void compile_and_link_test()
19 {
20     auto g = [&](std::vector<double> const & x)
21     {
22         return 1.873;
23     };
24     std::vector<std::pair<double, double>> bounds{{0, 1}, {0, 1}, {0, 1}};
25     naive_monte_carlo<double, decltype(g)> mc(g, bounds, 1.0);
26 
27     auto task = mc.integrate();
28     check_result<double>(task.get());
29 }
30 
31 #else
compile_and_link_test()32 void compile_and_link_test()
33 {
34 }
35 #endif
36