Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Controls the movement through a pseudo-random number stream

Link copied to clipboard
Link copied to clipboard

Represents a random number stream with stream control

Link copied to clipboard

The new instance has the same state as the underlying stream. This is a new stream but it has the same state (starting values, etc.)

Link copied to clipboard
class RNStreamProvider(defaultStreamNum: Int = 1) : RNStreamProviderIfc

A concrete implementation of RNStreamProviderIfc. If more than streamNumberWarningLimit streams are made a warning message is logged. Generally, unless you know what you are doing you should not need an immense number of streams. Instead, use a small number of streams many times. Conceptually this provider could have a possibly infinite number of streams, which would have bad memory implications. Thus, the reason for the warning. The default stream if not set is the first stream.

Link copied to clipboard

An interface to define the ability to provide random number streams (RNStreamIfc) Conceptualizes this process as making a sequence of streams, numbered 1, 2, 3, ... for use in generating pseudo-random numbers that can be controlled.

Link copied to clipboard
Link copied to clipboard
interface StreamOptionIfc

Functions

Link copied to clipboard

Computes (A times B) mod m and puts the result in C. Works even if A = C, B = C or A = B = C.

Exactly like matMatModM(double[][],double[][],double[][],double) using double, but with int instead of double.

Exactly like matMatModM(double[][],double[][],double[][],double) using double, but with long instead of double.

Link copied to clipboard

Computes (A raised to c) mod m and puts the result in B. Works even if A = B.

fun matPowModM(A: Array<IntArray>, B: Array<IntArray>, m: Int, c: Int)

Exactly like matPowModM(double[][],double[][],double,int) using double, but with int instead of double.

Exactly like matPowModM(double[][],double[][],double,int) using double, but with long instead of double.

Link copied to clipboard

Computes (A raised to (2 to e)) mod m and puts the result in B. B = A^{2^e} Works even if A = B.

Exactly like matTwoPowModM(double[][],double[][],double,int) using double, but with int instead of double.

Exactly like matTwoPowModM(double[][],double[][],double,int) using double, but with long instead of double.

Link copied to clipboard

Computes the result of (A times s) mod m and puts the result in v. Where s and v are both column vectors. This method works even if s = v.

Exactly like matVecModM(double[][],double[],double[],double) using double, but with int instead of double.

Exactly like matVecModM(double[][],double[],double[],double) using double, but with long instead of double.

Link copied to clipboard
fun multModM(a: Double, s: Double, c: Double, m: Double): Double

Computes (a x s + c) mod m. Where m must be smaller than 2 to the 35. Works also if s or c are negative. The result is always positive (and thus always between 0 and m - 1).

fun multModM(a: Int, s: Int, c: Int, m: Int): Int
fun multModM(a: Long, s: Long, c: Long, m: Long): Long

Computes (a times s + c) mod m. Works also if s or c are negative. The result is always positive (and thus always between 0 and m - 1).