Search Results for

    Show / Hide Table of Contents

    Class RandomNumber

    Inheritance
    Object
    RandomNumber
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: TowseyLibrary
    Assembly: TowseyLibrary.dll
    Syntax
    public class RandomNumber

    Constructors

    | Improve this Doc View Source

    RandomNumber()

    Declaration
    public RandomNumber()
    | Improve this Doc View Source

    RandomNumber(Int32)

    Declaration
    public RandomNumber(int seed)
    Parameters
    Type Name Description
    Int32 seed

    Methods

    | Improve this Doc View Source

    GetDouble()

    returns a random number between 0.0 and 1.0.

    Declaration
    public double GetDouble()
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    GetDouble(Int32)

    Declaration
    public double GetDouble(int max)
    Parameters
    Type Name Description
    Int32 max
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    GetInt(Int32)

    generates numbers 0 to max-1.

    Declaration
    public int GetInt(int max)
    Parameters
    Type Name Description
    Int32 max
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    GetRandomDistancesInEuclidianSpace(Int32, Int32)

    generates numbers 1 - 100.

    Declaration
    public static void GetRandomDistancesInEuclidianSpace(int trialCount, int dimensions)
    Parameters
    Type Name Description
    Int32 trialCount
    Int32 dimensions
    | Improve this Doc View Source

    GetRandomPercent()

    generates numbers 1 - 100.

    Declaration
    public int GetRandomPercent()
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    GetRandomVector(Int32, RandomNumber)

    generates a vector of random numbers in [0, 1.0].

    Declaration
    public static double[] GetRandomVector(int vectorLength, RandomNumber rn)
    Parameters
    Type Name Description
    Int32 vectorLength
    RandomNumber rn
    Returns
    Type Description
    Double[]
    | Improve this Doc View Source

    GetVectorOfRandomIntegers(Int32[], RandomNumber)

    Declaration
    public static int[] GetVectorOfRandomIntegers(int[] maxValues, RandomNumber rn)
    Parameters
    Type Name Description
    Int32[] maxValues
    RandomNumber rn
    Returns
    Type Description
    Int32[]
    | Improve this Doc View Source

    RandomizeArray(Double[], Int32)

    returns the passed array but with the elements in a random order see method above which was originally written for FuzzyART in 1995.

    Declaration
    public static double[] RandomizeArray(double[] array, int seed)
    Parameters
    Type Name Description
    Double[] array
    Int32 seed
    Returns
    Type Description
    Double[]
    | Improve this Doc View Source

    RandomizeArray(Int32[], Int32)

    IMPORTANT - THIS METHOD NEEDS WORK!! returns the passed array but with the elements in a random order see method above which was originally written for FuzzyART in 1995.

    Declaration
    public static int[] RandomizeArray(int[] array, int seed)
    Parameters
    Type Name Description
    Int32[] array
    Int32 seed
    Returns
    Type Description
    Int32[]
    | Improve this Doc View Source

    RandomizeNumberOrder(Int32, Int32)

    Returns integers up to N in random order. Use of seed will always return the same order. Pass a negative seed value to ignore it and to have a different random order every time method called. Use this method if you want random numbers up to N without replacement.

    Declaration
    public static int[] RandomizeNumberOrder(int N, int seed)
    Parameters
    Type Name Description
    Int32 N
    Int32 seed
    Returns
    Type Description
    Int32[]
    | Improve this Doc View Source

    RandomNumbersWithoutReplacement(Int32, Int32)

    Returns N random integers between 0 - K-1 without replacement. If seed is negative, it will be ignored ie different random order every time method called.

    Declaration
    public static int[] RandomNumbersWithoutReplacement(int n, int seed)
    Parameters
    Type Name Description
    Int32 n
    Int32 seed
    Returns
    Type Description
    Int32[]

    Extension Methods

    ObjectExtensions.NotNull(Object)
    ObjectExtensions.AsArray<T>(T)
    ObjectExtensions.AsList<T>(T)
    ObjectExtensions.Wrap<T>(T)
    SystemExtensions.BinarySerialize(Object)
    ConfigFileExtensions.NotNull(Object, FileInfo, String, String)
    ConfigFileExtensions.ValidateNotNull(Object, String, String)
    ConfigFileExtensions.ValidateLessThan<T>(Object, Nullable<T>, String, Nullable<T>, String, String)
    ExtensionsXml.SerializeObject<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Generated by DocFX AP docs version: 21.7.0.4-master-e26127a50d7bd7472d47288f10e61014fb981f7f-DIRTY-CI:144 Back to top