class RandBasis extends Serializable
Provides standard combinators and such to use to compose new Rands.
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- RandBasis
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
- new RandBasis(generator: RandomGenerator)
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def choose[T](c: Seq[T]): Rand[T]
-
def
choose[T](c: Iterable[T]): Rand[T]
Chooses an element from a collection.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fromBody[T](f: ⇒ T): Rand[T]
Simply reevaluate the body every time get is called
-
def
gaussian(m: Double, s: Double): Rand[Double]
Samples a gaussian with m mean and s std
-
val
gaussian: Rand[Double]
Samples a gaussian with 0 mean and 1 std
- val generator: RandomGenerator
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
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() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
permutation(n: Int): Rand[IndexedSeq[Int]]
Implements the Knuth shuffle of numbers from 0 to n.
- def promote[T1, T2, T3, T4](t: (Rand[T1], Rand[T2], Rand[T3], Rand[T4])): Rand[(T1, T2, T3, T4)]
- def promote[T1, T2, T3](t: (Rand[T1], Rand[T2], Rand[T3])): Rand[(T1, T2, T3)]
- def promote[T1, T2](t: (Rand[T1], Rand[T2])): Rand[(T1, T2)]
-
def
promote[U](col: Seq[Rand[U]]): Rand[Seq[U]]
Convert an Seq of Rand[T] into a Rand[Seq[T]]
-
def
randInt(n: Int, m: Int): Rand[Int]
Uniformly samples an integer in [n,m)
-
def
randInt(n: Int): Rand[Int]
Uniformly samples an integer in [0,n)
-
val
randInt: Rand[Int]
Uniformly samples an integer in [0,MAX_INT]
-
def
randLong(n: Long, m: Long): Rand[Long]
Uniformly samples a long integer in [n,m)
-
def
randLong(n: Long): Rand[Long]
Uniformly samples a long integer in [0,n)
-
val
randLong: Rand[Long]
Uniformly samples a long integer in [0,MAX_LONG]
-
def
subsetsOfSize[T](set: IndexedSeq[T], n: Int): Rand[IndexedSeq[T]]
Knuth shuffle of a subset of size n from a set
-
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]
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )