test_geometric.cpp 911 B

1234567891011121314151617181920212223242526
  1. /* test_geometric.cpp
  2. *
  3. * Copyright Steven Watanabe 2011
  4. * Distributed under the Boost Software License, Version 1.0. (See
  5. * accompanying file LICENSE_1_0.txt or copy at
  6. * http://www.boost.org/LICENSE_1_0.txt)
  7. *
  8. * $Id$
  9. *
  10. */
  11. #include <boost/random/geometric_distribution.hpp>
  12. #include <boost/random/uniform_real.hpp>
  13. #include <boost/math/distributions/geometric.hpp>
  14. #include <boost/numeric/conversion/cast.hpp>
  15. #define BOOST_RANDOM_DISTRIBUTION boost::random::geometric_distribution<>
  16. #define BOOST_RANDOM_DISTRIBUTION_NAME geometric
  17. #define BOOST_MATH_DISTRIBUTION boost::math::geometric
  18. #define BOOST_RANDOM_ARG1_TYPE double
  19. #define BOOST_RANDOM_ARG1_NAME p
  20. #define BOOST_RANDOM_ARG1_DEFAULT 0.5
  21. #define BOOST_RANDOM_ARG1_DISTRIBUTION(n) boost::uniform_real<>(0.0001, 0.9999)
  22. #define BOOST_RANDOM_DISTRIBUTION_MAX boost::numeric_cast<int>(-5 / std::log(1-p))
  23. #include "test_real_distribution.ipp"