Table of Contents

Struct RNG

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Random Number Generator. The class implements RNG using Multiply-with-Carry algorithm.

public struct RNG : IEquatable<RNG>
Implements
Inherited Members

Remarks

operations.hpp

Constructors

RNG(ulong)

Constructor

Properties

State

Methods

Equals(RNG)

Indicates whether the current object is equal to another object of the same type.

Equals(object?)

Indicates whether this instance and a specified object are equal.

Fill(InputOutputArray, DistributionType, InputArray, InputArray, bool)

Fills arrays with random numbers.

Gaussian(double)

Returns the next random number sampled from the Gaussian distribution.

The method transforms the state using the MWC algorithm and returns the next random number from the Gaussian distribution N(0,sigma) . That is, the mean value of the returned random numbers is zero and the standard deviation is the specified sigma.

GetHashCode()

Returns the hash code for this instance.

Next()

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

Run()
Run(uint)

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

ToByte()

(byte)RNG.next()

ToDouble()

returns a next random value as double (System.Double)

ToInt16()

(short)RNG.next()

ToInt32()

(int)RNG.next()

ToSByte()

(sbyte)RNG.next()

ToSingle()

returns a next random value as float (System.Single)

ToUInt16()

(ushort)RNG.next()

ToUInt32()

(uint)RNG.next()

Uniform(double, double)

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

Uniform(int, int)

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

Uniform(float, float)

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

Operators

operator ==(RNG, RNG)
explicit operator byte(RNG)

(byte)RNG.next()

explicit operator double(RNG)

returns a next random value as double (System.Double)

explicit operator short(RNG)

(short)RNG.next()

explicit operator int(RNG)

(int)RNG.next()

explicit operator sbyte(RNG)

(sbyte)RNG.next()

explicit operator float(RNG)

returns a next random value as float (System.Single)

explicit operator ushort(RNG)

(ushort)RNG.next()

explicit operator uint(RNG)

(uint)RNG.next()

operator !=(RNG, RNG)