12 #if !defined(RANDOMLIB_RANDOMSEED_HPP)
13 #define RANDOMLIB_RANDOMSEED_HPP 1
25 #pragma warning (push)
26 #pragma warning (disable: 4251)
86 template<typename IntType>
void Reseed(const std::vector<IntType>& v) {
87 Reseed(v.begin(), v.end());
98 template<
typename InputIterator>
99 void Reseed(InputIterator a, InputIterator b) {
101 std::vector<seed_type> t;
102 std::transform(a, b, back_inserter(t),
103 seed_t::cast<
typename std::iterator_traits<InputIterator>
117 _seed[0] = seed_t::cast(n);
132 std::vector<seed_type> t = StringToVector(s);
147 const std::vector<seed_type>&
Seed()
const throw() {
return _seed; }
153 std::string
SeedString()
const {
return VectorToString(_seed); }
165 virtual void Reset() throw() = 0;
181 static seed_type SeedWord();
195 static std::vector<seed_type> SeedVector();
204 template<typename IntType>
205 static std::
string VectorToString(const std::vector<IntType>& v) {
206 std::ostringstream os;
208 for (
typename std::vector<IntType>::const_iterator n = v.begin();
213 os << seed_t::cast(*n);
232 static std::vector<seed_type> StringToVector(
const std::string& s);
247 #if defined(_MSC_VER)
248 #pragma warning (pop)
251 #endif // RANDOMLIB_RANDOMSEED_HPP
Class to hold bit-width and unsigned type.
A base class for random generators.
std::vector< seed_type > _seed
void Reseed(InputIterator a, InputIterator b)
void Reseed(const std::string &s)
const std::vector< seed_type > & Seed() const
std::string SeedString() const
Class to hold bit-width and unsigned type.