Search Results for

    Show / Hide Table of Contents

    Class ArrayHelper

    Helpful methods used by generated code.

    Inheritance
    Object
    ArrayHelper
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Collections
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    [Quality(QualityBand.Stable)]
    public class ArrayHelper

    Methods

    CopyStorage<T>(T)

    Copies the storage of the passed in argument, without caring about its value.

    Declaration
    public static T CopyStorage<T>(T result)
        where T : ICloneable
    Parameters
    Type Name Description
    T result
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Fill<T>(T[], T)

    Fill an array with copies of an object.

    Declaration
    public static T[] Fill<T>(T[] array, T margprot)
        where T : ICloneable
    Parameters
    Type Name Description
    T[] array

    The array to modify.

    T margprot

    The object to copy into each element

    Returns
    Type Description
    T[]

    The modified array

    Type Parameters
    Name Description
    T

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

    Fill a 2D array with copies of an object.

    Declaration
    public static T[, ] Fill2D<T>(T[, ] array, T margprot)
        where T : ICloneable
    Parameters
    Type Name Description
    T[,] array

    The array to modify

    T margprot

    The object to copy into each element

    Returns
    Type Description
    T[,]

    The modified array

    Type Parameters
    Name Description
    T

    MakeCopy<T>(T)

    Make a deep copy of an object.

    Declaration
    public static T MakeCopy<T>(T obj)
        where T : ICloneable
    Parameters
    Type Name Description
    T obj
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    MakeUniform<T>(T)

    Create a clone of obj with uniform value.

    Declaration
    public static T MakeUniform<T>(T obj)
        where T : ICloneable, SettableToUniform
    Parameters
    Type Name Description
    T obj
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    SetAllElementsTo<T>(T[], T)

    Set all elements of an array to the same value.

    Declaration
    public static T[] SetAllElementsTo<T>(T[] result, T item)
    Parameters
    Type Name Description
    T[] result

    The array to modify

    T item

    The desired value

    Returns
    Type Description
    T[]

    The modified array

    Type Parameters
    Name Description
    T

    SetAllElementsTo<T, T2>(T, T2)

    Set all elements of an array to the same value.

    Declaration
    public static T SetAllElementsTo<T, T2>(T result, T2 item)
        where T : CanSetAllElementsTo<T2>
    Parameters
    Type Name Description
    T result

    The array to modify

    T2 item

    The desired value

    Returns
    Type Description
    T

    The modified array

    Type Parameters
    Name Description
    T
    T2

    SetTo<T>(T, T)

    Call result.SetTo(value) and return result.

    Declaration
    public static T SetTo<T>(T result, T value)
        where T : SettableTo<T>
    Parameters
    Type Name Description
    T result

    The object to modify

    T value

    The desired value

    Returns
    Type Description
    T

    The modified object

    Type Parameters
    Name Description
    T

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

    Call result.SetTo(value) and return result.

    Declaration
    public static T[] SetTo<T>(T[] result, T[] values)
        where T : SettableTo<T>
    Parameters
    Type Name Description
    T[] result

    The array to modify

    T[] values

    The desired values

    Returns
    Type Description
    T[]

    The modified array

    Type Parameters
    Name Description
    T

    SetToProductWith<T>(T, T)

    Declaration
    public static T SetToProductWith<T>(T result, T value)
        where T : SettableToProduct<T>
    Parameters
    Type Name Description
    T result
    T value
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    SetToUniform<T>(T)

    Call obj.SetToUniform() and return the object.

    Declaration
    public static T SetToUniform<T>(T obj)
        where T : SettableToUniform
    Parameters
    Type Name Description
    T obj
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.