Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2006-04-04 19:31:43


Bugs item #1464566, was opened at 2006-04-04 19:31
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1464566&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: random
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Hubert Chan (uhoreg)
Assigned to: Jens Maurer (jmaurer)
Summary: uniform_01 copies engine instead of using a reference

Initial Comment:
In the uniform_01 class, the constructor takes a
base_type (i.e. the random number generator) as its
argument, and the _rng member is just a base_type.
This results in uniform_01 copying the random number
generator, along with its state. Thus if one creates
several uniform_01 objects (e.g. one at the beginning
of each of several functions), they will all return the
same random numbers.

The constructor should take a reference (i.e.
base_type&) as its argument, and the _rng member should
be a base_type&. (Indeed, the documentation at
http://www.boost.org/libs/random/random-distributions.html#uniform_01
says that the constructor takes a base_type&.)

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1464566&group_id=7586

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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