Table of Contents

Struct RNG_MT19937

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Mersenne Twister random number generator

[SuppressMessage("Microsoft.Design", "CA1815: Override equals and operator equals on value types")]
public struct RNG_MT19937
Inherited Members

Remarks

operations.hpp

Constructors

RNG_MT19937(uint)

Constructor

public RNG_MT19937(uint s = 5489)

Parameters

s uint

Methods

Next()

updates the state and returns the next 32-bit unsigned integer random number

public uint Next()

Returns

uint

Run()

public uint Run()

Returns

uint

Run(uint)

returns a random integer sampled uniformly from [0, N).

public uint Run(uint b)

Parameters

b uint

Returns

uint

Seed(uint)

public void Seed(uint s)

Parameters

s uint

ToDouble()

public double ToDouble()

Returns

double

ToInt32()

public int ToInt32()

Returns

int

ToSingle()

public float ToSingle()

Returns

float

ToUInt32()

public uint ToUInt32()

Returns

uint

Uniform(double, double)

returns uniformly distributed double-precision floating-point random number from [a,b) range

public double Uniform(double a, double b)

Parameters

a double
b double

Returns

double

Uniform(int, int)

returns uniformly distributed integer random number from [a,b) range

public int Uniform(int a, int b)

Parameters

a int
b int

Returns

int

Uniform(float, float)

returns uniformly distributed floating-point random number from [a,b) range

public float Uniform(float a, float b)

Parameters

a float
b float

Returns

float

Operators

explicit operator double(RNG_MT19937)

public static explicit operator double(RNG_MT19937 self)

Parameters

self RNG_MT19937

Returns

double

explicit operator int(RNG_MT19937)

public static explicit operator int(RNG_MT19937 self)

Parameters

self RNG_MT19937

Returns

int

explicit operator float(RNG_MT19937)

public static explicit operator float(RNG_MT19937 self)

Parameters

self RNG_MT19937

Returns

float

explicit operator uint(RNG_MT19937)

public static explicit operator uint(RNG_MT19937 self)

Parameters

self RNG_MT19937

Returns

uint