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
suint
Methods
Next()
updates the state and returns the next 32-bit unsigned integer random number
public uint Next()
Returns
Run()
public uint Run()
Returns
Run(uint)
returns a random integer sampled uniformly from [0, N).
public uint Run(uint b)
Parameters
buint
Returns
Seed(uint)
public void Seed(uint s)
Parameters
suint
ToDouble()
public double ToDouble()
Returns
ToInt32()
public int ToInt32()
Returns
ToSingle()
public float ToSingle()
Returns
ToUInt32()
public uint ToUInt32()
Returns
Uniform(double, double)
returns uniformly distributed double-precision floating-point random number from [a,b) range
public double Uniform(double a, double b)
Parameters
Returns
Uniform(int, int)
returns uniformly distributed integer random number from [a,b) range
public int Uniform(int a, int b)
Parameters
Returns
Uniform(float, float)
returns uniformly distributed floating-point random number from [a,b) range
public float Uniform(float a, float b)
Parameters
Returns
Operators
explicit operator double(RNG_MT19937)
public static explicit operator double(RNG_MT19937 self)
Parameters
selfRNG_MT19937
Returns
explicit operator int(RNG_MT19937)
public static explicit operator int(RNG_MT19937 self)
Parameters
selfRNG_MT19937
Returns
explicit operator float(RNG_MT19937)
public static explicit operator float(RNG_MT19937 self)
Parameters
selfRNG_MT19937
Returns
explicit operator uint(RNG_MT19937)
public static explicit operator uint(RNG_MT19937 self)
Parameters
selfRNG_MT19937