shuffle_output.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* boost random/shuffle_output.hpp header file
  2. *
  3. * Copyright Jens Maurer 2000-2001
  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. * See http://www.boost.org for most recent version including documentation.
  9. *
  10. * $Id$
  11. *
  12. * Revision history
  13. * 2001-02-18 moved to individual header files
  14. */
  15. #ifndef BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
  16. #define BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
  17. #include <boost/random/shuffle_order.hpp>
  18. namespace boost {
  19. namespace random {
  20. /// \cond
  21. template<typename URNG, int k,
  22. typename URNG::result_type val = 0>
  23. class shuffle_output : public shuffle_order_engine<URNG, k>
  24. {
  25. typedef shuffle_order_engine<URNG, k> base_t;
  26. public:
  27. typedef typename base_t::result_type result_type;
  28. shuffle_output() {}
  29. template<class T>
  30. explicit shuffle_output(T& arg) : base_t(arg) {}
  31. template<class T>
  32. explicit shuffle_output(const T& arg) : base_t(arg) {}
  33. template<class It>
  34. shuffle_output(It& first, It last) : base_t(first, last) {}
  35. result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
  36. { return (this->base().min)(); }
  37. result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
  38. { return (this->base().max)(); }
  39. };
  40. /// \endcond
  41. }
  42. }
  43. #endif // BOOST_RANDOM_SHUFFLE_OUTPUT_HPP