Search Results for

    Show / Hide Table of Contents

    Class ArrayExtensions

    Inheritance
    Object
    ArrayExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: System
    Assembly: Acoustics.Shared.dll
    Syntax
    public static class ArrayExtensions

    Methods

    | Improve this Doc View Source

    Compare<T>(T[], T[])

    Compares two arrays, matching each element in order using the default Equals method for the array type T.

    Declaration
    public static bool Compare<T>(this T[] arr1, T[] arr2)
    Parameters
    Type Name Description
    T[] arr1

    The first array to compare.

    T[] arr2

    The second array to compare.

    Returns
    Type Description
    Boolean

    True: If each element matches; otherwise: False.

    Type Parameters
    Name Description
    T

    The common type of each array.

    | Improve this Doc View Source

    FastFill<T>(T[], T[])

    A helper method designed to fill an array with the specified values. Modifies the array in place, return value is only for fluent method calling. Fast is a bit of a misnomer - this operation is only faster after about a million elements!.

    Declaration
    public static T[] FastFill<T>(this T[] destinationArray, params T[] value)
    Parameters
    Type Name Description
    T[] destinationArray

    The array being filled.

    T[] value

    The value[s] to insert into the array.

    Returns
    Type Description
    T[]
    Type Parameters
    Name Description
    T

    They type of the array.

    Remarks

    https://github.com/mykohsu/Extensions/blob/master/ArrayExtensions.cs Inspired from several Stack Overflow discussions and an implementation by David Walker at http://coding.grax.com/2011/11/initialize-array-to-value-in-c-very.html.

    | Improve this Doc View Source

    Fill<T>(T[], T)

    A helper method designed to fill an array with the specified values. Modifies the array in place, return value is only for fluent method calling.

    Declaration
    public static T[] Fill<T>(this T[] destinationArray, T value)
    Parameters
    Type Name Description
    T[] destinationArray

    The array being filled.

    T value

    The value[s] to insert into the array.

    Returns
    Type Description
    T[]
    Type Parameters
    Name Description
    T

    They type of the array.

    Remarks

    https://github.com/mykohsu/Extensions/blob/master/ArrayExtensions.cs Inspired from several Stack Overflow discussions and an implementation by David Walker at http://coding.grax.com/2011/11/initialize-array-to-value-in-c-very.html.

    | Improve this Doc View Source

    GetMaxValue(Double[])

    retrieving the max value of a vector.

    Declaration
    public static double GetMaxValue(this double[] data)
    Parameters
    Type Name Description
    Double[] data
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    GetMinValue(Double[])

    retrieving the min value of a vector.

    Declaration
    public static double GetMinValue(this double[] data)
    Parameters
    Type Name Description
    Double[] data
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    Print<T>(T[])

    Debug function used to print an array to console (Debug.WriteLine()).

    Declaration
    public static T[] Print<T>(this T[] array)
    Parameters
    Type Name Description
    T[] array

    The array to print.

    Returns
    Type Description
    T[]

    The same array that was input.

    Type Parameters
    Name Description
    T

    The type of the input array.

    | Improve this Doc View Source

    PrintAsLiteral<T>(Array)

    Prints a multi-dimensional matrix as a C# literal.

    Declaration
    public static string PrintAsLiteral<T>(this Array array)
    Parameters
    Type Name Description
    Array array

    The source array to print.

    Returns
    Type Description
    String
    Type Parameters
    Name Description
    T

    Cast element items to T before toString is called.

    Remarks

    Assumes all ranks have a lower bound of zero.

    • 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