Opened 11 years ago

Closed 11 years ago

#674 closed defect (fixed)

deprecate seed functions in random base classes (Discrete Continuous)?

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.8
Component: random Version: 0.7.2
Keywords: Cc:


random::RNG has two seed functions seed and seed_from_devurandom. For some reason these functions also exists in the interface of base classes Discrete and Continuous. IMHO, it is sufficient to have these functions in RNG so we should deprecate them in other classes.

Setting the seed through RNG is preferable because it makes it clearer that it is a global change. Setting it through an individual instance of, for example, class Gaussian might be misleading as it it looks as it only affects the instance.

Any objections?

Change History (4)

comment:1 Changed 11 years ago by Jari Häkkinen

The removal depends on whether we retain singleton implementation of RNG. With the current implementation they could be removed. If we decide to allow several RNGs for thread safety and efficiency then they should be kept.

Doing sequence analyses with yat might require thread safe random number generation since multi-thread programming is needed.

It is easy to add them later if needed ... remove them.

comment:2 Changed 11 years ago by Peter

Owner: changed from Jari Häkkinen to Peter
Status: newassigned

comment:3 Changed 11 years ago by Peter

I noticed that both in RNG as well as the two other classes the seed function is const while seed_from_devurandom is not const.

comment:4 Changed 11 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [2578]) deprecate seed functions. closes #674

Note: See TracTickets for help on using tickets.