object Rand extends RandBasis
Provides a number of random generators, with random seed set to some function of system time and identity hashcode of some object
- Alphabetic
- By Inheritance
- Rand
- RandBasis
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def always[T](t: T): Rand[T]
The trivial random generator: always returns the argument
The trivial random generator: always returns the argument
- Definition Classes
- RandBasis
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def choose[T](c: Seq[T]): Rand[T]
- Definition Classes
- RandBasis
- def choose[T](c: Iterable[T]): Rand[T]
Chooses an element from a collection.
Chooses an element from a collection.
- Definition Classes
- RandBasis
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromBody[T](f: => T): Rand[T]
Simply reevaluate the body every time get is called
Simply reevaluate the body every time get is called
- Definition Classes
- RandBasis
- def gaussian(m: Double, s: Double): Rand[Double]
Samples a gaussian with m mean and s std
Samples a gaussian with m mean and s std
- Definition Classes
- RandBasis
- val gaussian: Rand[Double]
Samples a gaussian with 0 mean and 1 std
Samples a gaussian with 0 mean and 1 std
- Definition Classes
- RandBasis
- val generator: RandomGenerator
- Definition Classes
- RandBasis
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def permutation(n: Int): Rand[IndexedSeq[Int]]
Implements the Knuth shuffle of numbers from 0 to n.
Implements the Knuth shuffle of numbers from 0 to n.
- Definition Classes
- RandBasis
- def promote[T1, T2, T3, T4](t: (Rand[T1], Rand[T2], Rand[T3], Rand[T4])): Rand[(T1, T2, T3, T4)]
- Definition Classes
- RandBasis
- def promote[T1, T2, T3](t: (Rand[T1], Rand[T2], Rand[T3])): Rand[(T1, T2, T3)]
- Definition Classes
- RandBasis
- def promote[T1, T2](t: (Rand[T1], Rand[T2])): Rand[(T1, T2)]
- Definition Classes
- RandBasis
- def promote[U](col: Seq[Rand[U]]): Rand[Seq[U]]
Convert an Seq of Rand[T] into a Rand[Seq[T]]
Convert an Seq of Rand[T] into a Rand[Seq[T]]
- Definition Classes
- RandBasis
- def randInt(n: Int, m: Int): Rand[Int]
Uniformly samples an integer in [n,m)
Uniformly samples an integer in [n,m)
- Definition Classes
- RandBasis
- def randInt(n: Int): Rand[Int]
Uniformly samples an integer in [0,n)
Uniformly samples an integer in [0,n)
- Definition Classes
- RandBasis
- val randInt: Rand[Int]
Uniformly samples an integer in [0,MAX_INT]
Uniformly samples an integer in [0,MAX_INT]
- Definition Classes
- RandBasis
- def randLong(n: Long, m: Long): Rand[Long]
Uniformly samples a long integer in [n,m)
Uniformly samples a long integer in [n,m)
- Definition Classes
- RandBasis
- def randLong(n: Long): Rand[Long]
Uniformly samples a long integer in [0,n)
Uniformly samples a long integer in [0,n)
- Definition Classes
- RandBasis
- val randLong: Rand[Long]
Uniformly samples a long integer in [0,MAX_LONG]
Uniformly samples a long integer in [0,MAX_LONG]
- Definition Classes
- RandBasis
- def subsetsOfSize[T](set: IndexedSeq[T], n: Int): Rand[IndexedSeq[T]]
Knuth shuffle of a subset of size n from a set
Knuth shuffle of a subset of size n from a set
- Definition Classes
- RandBasis
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- val uniform: Rand[Double]
Uniformly samples in [0,1)
Uniformly samples in [0,1)
- Definition Classes
- RandBasis
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- object FixedSeed
Import the contents of this to use a generator seeded with a consistent seed.
- object VariableSeed
Import the contents of this to make Rands/Distributions that use the "default" generator