Quick Question - How to fix the seed in randomDouble

128 views
Skip to first unread message

Manoj Kumar

unread,
Mar 11, 2015, 6:07:36 PM3/11/15
to scala-...@googlegroups.com
Hi,

I would like to reproduce certain results, for which I need to fix the random seed in randomDouble. Sorry if it is obvious, but I'm unable to understand how to do it. Any help would be appreciated.

David Hall

unread,
Mar 11, 2015, 6:11:42 PM3/11/15
to scala-...@googlegroups.com
sorry for the long delay.

What method are you calling? In general, most methods that use random numbers in breeze take an implicit RandBasis (defaulting to the global object Rand), which allows you to control the seed. (Let me know if you encounter any methods that don't.) 

If you need fixed seeds, you can make an (implicit) instance of RandBasis.mt0, which fixes the seed at 0. Or you can make a RandBasis instance directly from an apache commons RandomGenerator


On Sun, Mar 1, 2015 at 9:52 PM, Manoj Kumar <manojkumar...@gmail.com> wrote:
Hi,

I would like to reproduce certain results, for which I need to fix the random seed in randomDouble. Sorry if it is obvious, but I'm unable to understand how to do it. Any help would be appreciated.

--
You received this message because you are subscribed to the Google Groups "Scala Breeze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-breeze...@googlegroups.com.
To post to this group, send email to scala-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-breeze/02dcd350-bc45-4382-bb5f-d55dfd1c7a25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages