Class DefaultRandomGenerator
Inheritance
System.Object
DefaultRandomGenerator
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.Collections.KNNGraph
Assembly: Mars.Common.dll
Syntax
public sealed class DefaultRandomGenerator : IProvideRandomValues
Properties
| Improve this Doc View SourceDisableThreading
This uses the same random number generator but forces the optimization process to run on a single thread (which may
be desirable if multiple requests may be processed concurrently
or if it is otherwise not desirable to let a single request access all of the CPUs)
Declaration
public static DefaultRandomGenerator DisableThreading { get; }
Property Value
Type | Description |
---|---|
DefaultRandomGenerator |
Instance
This is the default configuration (it supports the optimization process to be executed on multiple threads)
Declaration
public static DefaultRandomGenerator Instance { get; }
Property Value
Type | Description |
---|---|
DefaultRandomGenerator |
IsThreadSafe
Declaration
public bool IsThreadSafe { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceNext(Int32, Int32)
Declaration
public int Next(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minValue | |
System.Int32 | maxValue |
Returns
Type | Description |
---|---|
System.Int32 |
NextFloat()
Declaration
public float NextFloat()
Returns
Type | Description |
---|---|
System.Single |
NextFloats(Span<Single>)
Declaration
public void NextFloats(Span<float> buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Span<System.Single> | buffer |