Boost logo

Boost :

From: Mario Ruetti (mruetti_at_[hidden])
Date: 2004-05-24 04:08:31


Hi

I sent this message already some month before.
I made some corrections to the boost random library because some generators
don't
fulfil the wg-21 specifications about the seed() method. I add the missing
seed()
methods to the following generators

* linear_congruential
* linear_feedback_shift
* additive_combine
* inversive_congruential
* discard_block
* shuffle_output

Greetings Mario

Index: linear_congruential.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/linear_congruential.hpp,v
retrieving revision 1.15
diff -r1.15 linear_congruential.hpp
219c219
< void seed(int32_t x0) { lcf.seed(cnv(x0)); }

---
>   void seed(int32_t x0=1) { lcf.seed(cnv(x0)); }
Index: linear_feedback_shift.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/linear_feedback_shift.hpp,v
retrieving revision 1.7
diff -r1.7 linear_feedback_shift.hpp
83c83
<   void seed(UIntType s0) { assert(s0 >= (1 << (w-k))); value = s0; }
---
>   void seed(UIntType s0 = 341) { assert(s0 >= (1 << (w-k))); value = s0; }
Index: additive_combine.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/additive_combine.hpp,v
retrieving revision 1.5
diff -r1.5 additive_combine.hpp
62a63,68
>   void seed()
>   {
>     _mlcg1.seed();
>     _mlcg2.seed();
>   }
>
Index: inversive_congruential.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/inversive_congruential.hpp,v
retrieving revision 1.6
diff -r1.6 inversive_congruential.hpp
63c63
<   void seed(IntType y0) { value = y0; if(b == 0) assert(y0 > 0); }
---
>   void seed(IntType y0 = 1) { value = y0; if(b == 0) assert(y0 > 0); }
Index: discard_block.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/discard_block.hpp,v
retrieving revision 1.7
diff -r1.7 discard_block.hpp
52a53
>   void seed() { _rng.seed(); _n = 0; }
Index: shuffle_output.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/shuffle_output.hpp,v
retrieving revision 1.6
diff -r1.6 shuffle_output.hpp
65a66
>   void seed() { _rng.seed(); init(); }
-- 
"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk