class Random16 extends AnyRef
This class implements a 128-bit linear congruential generator. Specifically, if X0 is the most recently issued 128-bit random number (or a seed of 0 if no random number has already been generated, the next number to be generated, X1, is equal to: X1 = (a * X0 + c) mod 2**128 where a is 47026247687942121848144207491837523525 or 0x2360ed051fc65da44385df649fccf645 and c is 98910279301475397889117759788405497857 or 0x4a696d47726179524950202020202001 The coefficient "a" is suggested by: Pierre L'Ecuyer, "Tables of linear congruential generators of different sizes and good lattice structure", Mathematics of Computation, 68 pp. 249 - 260 (1999) http://www.ams.org/mcom/1999-68-225/S0025-5718-99-00996-5/S0025-5718-99-00996-5.pdf The constant "c" meets the simple suggestion by the same reference that it be odd.
There is also a facility for quickly advancing the state of the generator by a fixed number of steps - this facilitates parallel generation.
This is based on 1.0 of rand16.c from Chris Nyberg <chris.nyberg@ordinal.com>.
- Alphabetic
- By Inheritance
- Random16
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Random16()
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()