2
0
mirror of https://github.com/boostorg/random.git synced 2026-01-19 04:22:17 +00:00

This commit was manufactured by cvs2svn to create tag

'merge_wg21_random_proposal'.

[SVN r18951]
This commit is contained in:
nobody
2003-07-06 21:53:43 +00:00
parent 5afe5eba35
commit 0eeafe7423
2 changed files with 0 additions and 146 deletions

View File

@@ -1,69 +0,0 @@
/* boost nondet_random.hpp header file
*
* Copyright Jens Maurer 2000
* Permission to use, copy, modify, sell, and distribute this software
* is hereby granted without fee provided that the above copyright notice
* appears in all copies and that both that copyright notice and this
* permission notice appear in supporting documentation,
*
* Jens Maurer makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* $Id$
*
* Revision history
* 2000-02-18 Portability fixes (thanks to Beman Dawes)
*/
// See http://www.boost.org/libs/random for documentation.
#ifndef BOOST_NONDET_RANDOM_HPP
#define BOOST_NONDET_RANDOM_HPP
#include <string> // std::abs
#include <algorithm> // std::min
#include <cmath>
#include <boost/config.hpp>
#include <boost/utility.hpp> // noncopyable
#include <boost/integer_traits.hpp> // compile-time integral limits
namespace boost {
// use some OS service to generate non-deterministic random numbers
class random_device : private noncopyable
{
public:
typedef unsigned int result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = true);
BOOST_STATIC_CONSTANT(result_type, min_value = integer_traits<result_type>::const_min);
BOOST_STATIC_CONSTANT(result_type, max_value = integer_traits<result_type>::const_max);
result_type min() const { return min_value; }
result_type max() const { return max_value; }
explicit random_device(const std::string& token = default_token);
~random_device();
double entropy() const;
unsigned int operator()();
private:
static const char * const default_token;
/*
* std:5.3.5/5 [expr.delete]: "If the object being deleted has incomplete
* class type at the point of deletion and the complete class has a
* non-trivial destructor [...], the behavior is undefined".
* This disallows the use of scoped_ptr<> with pimpl-like classes
* having a non-trivial destructor.
*/
class impl;
impl * pimpl;
};
// TODO: put Schneier's Yarrow-160 algorithm here.
} // namespace boost
#endif /* BOOST_NONDET_RANDOM_HPP */

View File

@@ -1,77 +0,0 @@
/* boost random.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Permission to use, copy, modify, sell, and distribute this software
* is hereby granted without fee provided that the above copyright notice
* appears in all copies and that both that copyright notice and this
* permission notice appear in supporting documentation,
*
* Jens Maurer makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* See http://www.boost.org/libs/random for documentation.
*
* $Id$
*
* Revision history
* 2000-02-18 portability fixes (thanks to Beman Dawes)
* 2000-02-21 shuffle_output, inversive_congruential_schrage,
* generator_iterator, uniform_smallint
* 2000-02-23 generic modulus arithmetic helper, removed *_schrage classes,
* implemented Streamable and EqualityComparable concepts for
* generators, added Bernoulli distribution and Box-Muller
* transform
* 2000-03-01 cauchy, lognormal, triangle distributions; fixed
* uniform_smallint; renamed gaussian to normal distribution
* 2000-03-05 implemented iterator syntax for distribution functions
* 2000-04-21 removed some optimizations for better BCC/MSVC compatibility
* 2000-05-10 adapted to BCC and MSVC
* 2000-06-13 incorporated review results
* 2000-07-06 moved basic templates from namespace detail to random
* 2000-09-23 warning removals and int64 fixes (Ed Brey)
* 2000-09-24 added lagged_fibonacci generator (Matthias Troyer)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_HPP
#define BOOST_RANDOM_HPP
// generators
#include <boost/random/linear_congruential.hpp>
#include <boost/random/additive_combine.hpp>
#include <boost/random/inversive_congruential.hpp>
#include <boost/random/shuffle_output.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/lagged_fibonacci.hpp>
#include <boost/random/ranlux.hpp>
#include <boost/random/linear_feedback_shift.hpp>
#include <boost/random/xor_combine.hpp>
namespace boost {
typedef random::xor_combine<random::xor_combine<random::linear_feedback_shift<uint32_t, 32, 31, 13, 12, 0>, 0,
random::linear_feedback_shift<uint32_t, 32, 29, 2, 4, 0>, 0, 0>, 0,
random::linear_feedback_shift<uint32_t, 32, 28, 3, 17, 0>, 0, 0> taus88;
} // namespace boost
// misc
#include <boost/random/random_number_generator.hpp>
// distributions
#include <boost/random/uniform_smallint.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/triangle_distribution.hpp>
#include <boost/random/bernoulli_distribution.hpp>
#include <boost/random/cauchy_distribution.hpp>
#include <boost/random/exponential_distribution.hpp>
#include <boost/random/geometric_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/lognormal_distribution.hpp>
#include <boost/random/poisson_distribution.hpp>
#include <boost/random/gamma_distribution.hpp>
#include <boost/random/binomial_distribution.hpp>
#include <boost/random/uniform_on_sphere.hpp>
#endif // BOOST_RANDOM_HPP