naive_monte_carlo_concept_test.cpp 861 B

123456789101112131415161718192021222324252627282930313233
  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. #if !defined(_MSC_VER) || (_MSC_VER >= 1900)
  8. #include <boost/math/concepts/std_real_concept.hpp>
  9. #include <boost/math/quadrature/naive_monte_carlo.hpp>
  10. using boost::math::concepts::std_real_concept;
  11. using boost::math::quadrature::naive_monte_carlo;
  12. void compile_and_link_test()
  13. {
  14. auto g = [&](std::vector<std_real_concept> const & x)
  15. {
  16. return 1.873;
  17. };
  18. std::vector<std::pair<std_real_concept, std_real_concept>> bounds{{0, 1}, {0, 1}, {0, 1}};
  19. naive_monte_carlo<std_real_concept, decltype(g)> mc(g, bounds, 1.0);
  20. auto task = mc.integrate();
  21. task.get();
  22. }
  23. #else
  24. void compile_and_link_test()
  25. {
  26. }
  27. #endif