Search Results for

    Show / Hide Table of Contents

    Class ApproximateSparseList<T>

    Approximate Sparse List.

    Inheritance
    Object
    SparseList<T>
    ApproximateSparseList<T>
    SparseDistributionList<TDist, TDomain, TThis>
    Implements
    ISparseList<T>
    ISparseEnumerable<T>
    IList<T>
    ICollection<T>
    IEnumerable<T>
    IList
    ICollection
    IEnumerable
    ICloneable
    Inherited Members
    SparseList<T>.Sparsity
    SparseList<T>.SparseValues
    SparseList<T>.CommonValue
    SparseList<T>.Count
    SparseList<T>.SparseCount
    SparseList<T>.FromSize(Int32)
    SparseList<T>.Constant(Int32, T)
    SparseList<T>.Copy(IList<T>)
    SparseList<T>.FromSparseValues(Int32, T, List<ValueAtIndex<T>>)
    SparseList<T>.GetSparseIndex(Int32)
    SparseList<T>.HasCommonElements
    SparseList<T>.GetFirstCommonIndex()
    SparseList<T>.GetEnumerator()
    SparseList<T>.IEnumerable.GetEnumerator()
    SparseList<T>.SetAllElementsTo(T)
    SparseList<T>.SetTo(IList<T>)
    SparseList<T>.CheckCompatible<T2>(IList<T2>, String)
    SparseList<T>.SetTo(SparseList<T>)
    SparseList<T>.SetTo(IEnumerable<T>)
    SparseList<T>.ICloneable.Clone()
    SparseList<T>.EqualsAll(T)
    SparseList<T>.All(Converter<T, Boolean>)
    SparseList<T>.Any(Converter<T, Boolean>)
    SparseList<T>.IndexOfAll(Converter<T, Boolean>)
    SparseList<T>.Reduce<TRes>(TRes, Func<TRes, T, TRes>)
    SparseList<T>.Reduce<TRes>(TRes, Func<TRes, T, TRes>, Func<TRes, T, Int32, TRes>)
    SparseList<T>.Reduce<TRes, T1>(TRes, ISparseEnumerable<T1>, Func<TRes, T, T1, TRes>, Func<TRes, T, T1, Int32, TRes>)
    SparseList<T>.Reduce<TRes, T1, T2>(TRes, ISparseEnumerable<T1>, ISparseEnumerable<T2>, Func<TRes, T, T1, T2, TRes>, Func<TRes, T, T1, T2, Int32, TRes>)
    SparseList<T>.Reduce<TRes, T2>(TRes, IEnumerable<T2>, Func<TRes, T, T2, TRes>)
    SparseList<T>.Reduce<TRes, T1, T2>(TRes, IList<T1>, IList<T2>, Func<TRes, T, T1, T2, TRes>)
    SparseList<T>.Contains(T)
    SparseList<T>.IndexOf(T)
    SparseList<T>.IsReadOnly
    SparseList<T>.CopyTo(T[], Int32)
    SparseList<T>.Insert(Int32, T)
    SparseList<T>.RemoveAt(Int32)
    SparseList<T>.Add(T)
    SparseList<T>.Clear()
    SparseList<T>.Remove(T)
    SparseList<T>.IList.Add(Object)
    SparseList<T>.IList.Contains(Object)
    SparseList<T>.IList.IndexOf(Object)
    SparseList<T>.IList.Insert(Int32, Object)
    SparseList<T>.IList.IsFixedSize
    SparseList<T>.IList.Remove(Object)
    SparseList<T>.IList.Item[Int32]
    SparseList<T>.ICollection.CopyTo(Array, Int32)
    SparseList<T>.ICollection.IsSynchronized
    SparseList<T>.ICollection.SyncRoot
    SparseList<T>.ToArray<T2>(IList<T2>)
    SparseList<T>.ToString()
    SparseList<T>.ToString(String)
    SparseList<T>.ToArray()
    SparseList<T>.ToList()
    SparseList<T>.GetSparseEnumerator()
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Namespace: Microsoft.ML.Probabilistic.Collections
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    [Serializable]
    [DataContract]
    public class ApproximateSparseList<T> : SparseList<T>, ISparseList<T>, ISparseEnumerable<T>, IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable, ICloneable where T : Diffable
    Type Parameters
    Name Description
    T

    List element type. Must implement Diffable.

    Constructors

    ApproximateSparseList()

    Null constructor.

    Declaration
    protected ApproximateSparseList()

    ApproximateSparseList(ISparseList<T>)

    Copy constructor.

    Declaration
    protected ApproximateSparseList(ISparseList<T> that)
    Parameters
    Type Name Description
    ISparseList<T> that

    the sparse list to copy into this new sparse list

    ApproximateSparseList(ISparseList<T>, Double)

    Copy constructor.

    Declaration
    protected ApproximateSparseList(ISparseList<T> that, double tolerance)
    Parameters
    Type Name Description
    ISparseList<T> that

    the sparse list to copy into this new sparse list

    Double tolerance

    The tolerance for the approximation

    ApproximateSparseList(Double)

    Constructs an approximate sparse list with the given tolerance

    Declaration
    protected ApproximateSparseList(double tolerance)
    Parameters
    Type Name Description
    Double tolerance

    The tolerance for the approximation

    ApproximateSparseList(Int32)

    Constructs an approximate sparse list with the given number of elements and with default tolerance.

    Declaration
    protected ApproximateSparseList(int count)
    Parameters
    Type Name Description
    Int32 count

    Number of elements to allocate (>= 0).

    ApproximateSparseList(Int32, T)

    Constructs a sparse list of a given length and assigns all elements the given value. The tolerance is set to the default value.

    Declaration
    protected ApproximateSparseList(int count, T commonValue)
    Parameters
    Type Name Description
    Int32 count

    Number of elements to allocate (>= 0).

    T commonValue

    The value to assign to all elements.

    ApproximateSparseList(Int32, T, List<ValueAtIndex<T>>)

    Constructs a sparse list of a given length and assigns all elements the given value, except for the specified list of sparse values. This list is stored internally as is so MUST be sorted by index and must not be modified externally after being passed in. The tolerance is set to the default value.

    Declaration
    protected ApproximateSparseList(int count, T commonValue, List<ValueAtIndex<T>> sortedSparseValues)
    Parameters
    Type Name Description
    Int32 count

    Number of elements to allocate (>= 0).

    T commonValue

    The value to assign to all elements.

    List<ValueAtIndex<T>> sortedSparseValues

    The list of sparse values, which must be sorted by index.

    ApproximateSparseList(Int32, T, List<ValueAtIndex<T>>, Double)

    Constructs a sparse list of a given length and assigns all elements the given value, except for the specified list of sparse values. This list is stored internally as is so MUST be sorted by index and must not be modified externally after being passed in.

    Declaration
    protected ApproximateSparseList(int count, T commonValue, List<ValueAtIndex<T>> sortedSparseValues, double tolerance)
    Parameters
    Type Name Description
    Int32 count

    Number of elements to allocate (>= 0).

    T commonValue

    The value to assign to all elements.

    List<ValueAtIndex<T>> sortedSparseValues

    The list of sparse values, which must be sorted by index.

    Double tolerance

    The tolerance for the approximation

    ApproximateSparseList(Int32, T, Double)

    Constructs a sparse list of a given length and assigns all elements the given value.

    Declaration
    protected ApproximateSparseList(int count, T commonValue, double tolerance)
    Parameters
    Type Name Description
    Int32 count

    Number of elements to allocate (>= 0).

    T commonValue

    The value to assign to all elements.

    Double tolerance

    The tolerance for the approximation

    ApproximateSparseList(Int32, Double)

    Constructs an approximate sparse list with the given number of elements and with the given tolerance.

    Declaration
    protected ApproximateSparseList(int count, double tolerance)
    Parameters
    Type Name Description
    Int32 count

    Number of elements to allocate (>= 0).

    Double tolerance

    The tolerance for the approximation

    Fields

    DefaultTolerance

    The default tolerance for the approximate sparse list

    Declaration
    public static double DefaultTolerance
    Field Value
    Type Description
    Double

    Properties

    Item[Int32]

    Gets or sets an element.

    Declaration
    public override T this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index
    Property Value
    Type Description
    T
    Overrides
    Microsoft.ML.Probabilistic.Collections.SparseList<T>.Item[System.Int32]

    Tolerance

    The tolerance for the approximation

    Declaration
    public double Tolerance { get; protected set; }
    Property Value
    Type Description
    Double

    Methods

    Clone()

    Clones this list - return as a sparse list.

    Declaration
    public ApproximateSparseList<T> Clone()
    Returns
    Type Description
    ApproximateSparseList<T>

    Constant(Int32, T, Double)

    Create a sparse list of given length with elements all equal to a specified value

    Declaration
    public static ApproximateSparseList<T> Constant(int count, T value, double tolerance)
    Parameters
    Type Name Description
    Int32 count

    Number of elements in the list

    T value

    Value for each element

    Double tolerance

    The tolerance for the approximation

    Returns
    Type Description
    ApproximateSparseList<T>

    Equals(Object)

    Determines object equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    Another object.

    Returns
    Type Description
    Boolean

    True if equal.

    Overrides
    Microsoft.ML.Probabilistic.Collections.SparseList<T>.Equals(System.Object)

    FromSize(Int32, Double)

    Create a sparse list of given length with elements all equal to the default value for the element type

    Declaration
    public static ApproximateSparseList<T> FromSize(int count, double tolerance)
    Parameters
    Type Name Description
    Int32 count

    Number of elements in the list

    Double tolerance

    The tolerance for the approximation

    Returns
    Type Description
    ApproximateSparseList<T>

    FromSparseValues(Int32, T, List<ValueAtIndex<T>>, Double)

    Constructs a sparse list from a sorted list of sparse elements.

    Declaration
    [Construction(new string[]{"Count", "CommonValue", "SparseValues", "Tolerance"})]
    public static SparseList<T> FromSparseValues(int count, T commonValue, List<ValueAtIndex<T>> sortedSparseValues, double tolerance)
    Parameters
    Type Name Description
    Int32 count

    Count for result

    T commonValue

    Common value

    List<ValueAtIndex<T>> sortedSparseValues

    Sorted list of sparse elements

    Double tolerance

    The tolerance for the approximation

    Returns
    Type Description
    SparseList<T>

    GetHashCode()

    Gets a hash code for the instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    The code.

    Overrides
    Microsoft.ML.Probabilistic.Collections.SparseList<T>.GetHashCode()

    SetTo(ApproximateSparseList<T>)

    Copies values from a sparse list to this sparse list.

    Declaration
    public void SetTo(ApproximateSparseList<T> that)
    Parameters
    Type Name Description
    ApproximateSparseList<T> that

    SetTo(IList<T>, T)

    Copies values from a list which must have the same size as this list, using the specified common value.

    Declaration
    public override void SetTo(IList<T> dlist, T commonValue)
    Parameters
    Type Name Description
    IList<T> dlist

    The list to copy from

    T commonValue

    Common value

    Overrides
    Microsoft.ML.Probabilistic.Collections.SparseList<T>.SetTo(System.Collections.Generic.IList<T>, T)

    SetToFunction<T2>(ISparseEnumerable<T2>, Func<T2, T>)

    Sets the elements of this sparse list to a function of the elements of a sparse collection

    Declaration
    public ApproximateSparseList<T> SetToFunction<T2>(ISparseEnumerable<T2> that, Func<T2, T> fun)
    Parameters
    Type Name Description
    ISparseEnumerable<T2> that

    The other list

    Func<T2, T> fun

    The function which maps from type T2 to type T

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T2
    Remarks

    Assumes the lists are the same length

    SetToFunction<T2>(SparseList<T2>, Func<T2, T>)

    Sets the elements of this sparse list to a function of the elements of another sparse list

    Declaration
    public ApproximateSparseList<T> SetToFunction<T2>(SparseList<T2> that, Func<T2, T> fun)
    Parameters
    Type Name Description
    SparseList<T2> that

    The other list

    Func<T2, T> fun

    The function which maps from type T2 to type T

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T2
    Remarks

    Assumes the lists are the same length

    SetToFunction<T2>(IEnumerable<T2>, Func<T2, T>)

    Sets the elements of this sparse list to a function of the elements of a collection

    Declaration
    public ApproximateSparseList<T> SetToFunction<T2>(IEnumerable<T2> that, Func<T2, T> fun)
    Parameters
    Type Name Description
    IEnumerable<T2> that

    The other list

    Func<T2, T> fun

    The function which maps from type T2 to type T

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T2
    Remarks

    Assumes the lists are the same length

    SetToFunction<T1, T2>(ISparseEnumerable<T1>, ISparseEnumerable<T2>, Func<T1, T2, T>)

    Sets the elements of this sparse list to a function of the elements of two other sparse lists

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2>(ISparseEnumerable<T1> a, ISparseEnumerable<T2> b, Func<T1, T2, T> fun)
    Parameters
    Type Name Description
    ISparseEnumerable<T1> a

    The first list

    ISparseEnumerable<T2> b

    The second list

    Func<T1, T2, T> fun

    The function which maps two elements to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2

    SetToFunction<T1, T2>(SparseList<T1>, SparseList<T2>, Func<T1, T2, T>)

    Sets the elements of this approximate sparse list to a function of the elements of two other sparse lists

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2>(SparseList<T1> a, SparseList<T2> b, Func<T1, T2, T> fun)
    Parameters
    Type Name Description
    SparseList<T1> a

    The first list

    SparseList<T2> b

    The second list

    Func<T1, T2, T> fun

    The function which maps two elements to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2
    Remarks

    Assumes the lists are all the same length

    SetToFunction<T1, T2>(IEnumerable<T1>, IEnumerable<T2>, Func<T1, T2, T>)

    Sets the elements of this list to a function of the elements of two collections

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2>(IEnumerable<T1> a, IEnumerable<T2> b, Func<T1, T2, T> fun)
    Parameters
    Type Name Description
    IEnumerable<T1> a

    The first list

    IEnumerable<T2> b

    The second list

    Func<T1, T2, T> fun

    The function which maps the two elements of the other lists to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2
    Remarks

    Assumes the lists are the same length

    SetToFunction<T1, T2, T3>(ISparseEnumerable<T1>, ISparseEnumerable<T2>, ISparseEnumerable<T3>, Func<T1, T2, T3, T>)

    Sets the elements of this sparse list to a function of the elements of three sparse collections

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2, T3>(ISparseEnumerable<T1> a, ISparseEnumerable<T2> b, ISparseEnumerable<T3> c, Func<T1, T2, T3, T> fun)
    Parameters
    Type Name Description
    ISparseEnumerable<T1> a

    The first collection

    ISparseEnumerable<T2> b

    The second collection

    ISparseEnumerable<T3> c

    The third collection

    Func<T1, T2, T3, T> fun

    The function which maps three elements to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2
    T3

    SetToFunction<T1, T2, T3>(IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>, Func<T1, T2, T3, T>)

    Sets the elements of this sparse list to a function of the elements of three sparse collections

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2, T3>(IEnumerable<T1> a, IEnumerable<T2> b, IEnumerable<T3> c, Func<T1, T2, T3, T> fun)
    Parameters
    Type Name Description
    IEnumerable<T1> a

    The first collection

    IEnumerable<T2> b

    The second collection

    IEnumerable<T3> c

    The third collection

    Func<T1, T2, T3, T> fun

    The function which maps three elements to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2
    T3

    SetToFunction<T1, T2, T3, T4>(ISparseList<T1>, ISparseList<T2>, ISparseList<T3>, ISparseList<T4>, Func<T1, T2, T3, T4, T>)

    Sets the elements of this sparse list to a function of the elements of three other collections

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2, T3, T4>(ISparseList<T1> a, ISparseList<T2> b, ISparseList<T3> c, ISparseList<T4> d, Func<T1, T2, T3, T4, T> fun)
    Parameters
    Type Name Description
    ISparseList<T1> a

    The first collection

    ISparseList<T2> b

    The second collection

    ISparseList<T3> c

    The third collection

    ISparseList<T4> d

    The fourth collection

    Func<T1, T2, T3, T4, T> fun

    The function which maps four elements to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2
    T3
    T4

    SetToFunction<T1, T2, T3, T4>(IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>, IEnumerable<T4>, Func<T1, T2, T3, T4, T>)

    Sets the elements of this sparse list to a function of the elements of four sparse collections

    Declaration
    public ApproximateSparseList<T> SetToFunction<T1, T2, T3, T4>(IEnumerable<T1> a, IEnumerable<T2> b, IEnumerable<T3> c, IEnumerable<T4> d, Func<T1, T2, T3, T4, T> fun)
    Parameters
    Type Name Description
    IEnumerable<T1> a

    The first collection

    IEnumerable<T2> b

    The second collection

    IEnumerable<T3> c

    The third collection

    IEnumerable<T4> d

    The fourth collection

    Func<T1, T2, T3, T4, T> fun

    The function which maps four elements to an element of this list

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    T2
    T3
    T4

    SetToFunctionInPlace<T1>(SparseList<T1>, Func<T, T1, T>)

    Sets the elements of this approximate sparse list to a function of the elements of this sparse list and another sparse list x = fun(x,b)

    Declaration
    public ApproximateSparseList<T> SetToFunctionInPlace<T1>(SparseList<T1> b, Func<T, T1, T> fun)
    Parameters
    Type Name Description
    SparseList<T1> b

    The other sparse list

    Func<T, T1, T> fun

    The function which maps (T,T1) to T

    Returns
    Type Description
    ApproximateSparseList<T>
    Type Parameters
    Name Description
    T1
    Remarks

    Assumes the lists are the same length

    Implements

    ISparseList<T>
    ISparseEnumerable<T>
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    System.ICloneable

    Extension Methods

    CollectionExtensions.AddRange<T>(ICollection<T>, IEnumerable<T>)
    CollectionExtensions.ContainsAll<T>(ICollection<T>, IEnumerable<T>)
    CollectionExtensions.ContainsAny<T>(ICollection<T>, IEnumerable<T>)
    EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    EnumerableExtensions.ForEach<T>(IEnumerable, Action<T>)
    EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<Int32, T>)
    EnumerableExtensions.ForEach<T>(IEnumerable, Action<Int32, T>)
    EnumerableExtensions.Sum<TSource>(IEnumerable<TSource>, Func<TSource, UInt32>)
    EnumerableExtensions.Sum<TSource>(IEnumerable<TSource>, Func<TSource, UInt64>)
    EnumerableExtensions.ValueEquals<T>(IEnumerable<T>, IEnumerable<T>)
    EnumerableExtensions.IndexOf<T>(IEnumerable<T>, T)
    EnumerableExtensions.IndexOf<T>(IEnumerable, T)
    EnumerableExtensions.FindIndex<T>(IEnumerable<T>, Predicate<T>)
    EnumerableExtensions.FindIndex<T>(IEnumerable, Predicate<T>)
    EnumerableExtensions.FindAllIndex<T>(IEnumerable<T>, Predicate<T>)
    EnumerableExtensions.IndexOfAll<T>(IEnumerable<T>, T)
    EnumerableExtensions.Skip<T>(IEnumerable<T>, Int32, out List<T>)
    EnumerableExtensions.CopyTo<T>(IEnumerable<T>, T[], Int32)
    EnumerableExtensions.ToReadOnlyList<T>(IEnumerable<T>)
    IEnumerableExensions.EnumerableReduce<T, TRes>(IEnumerable<T>, TRes, Func<TRes, T, TRes>, Func<TRes, T, Int32, TRes>)
    IEnumerableExensions.EnumerableSum<T>(IEnumerable<T>, Func<T, Double>)
    IEnumerableExensions.ListZip<TFirst, TSecond, TResult>(IList<TFirst>, IEnumerable<TSecond>, Func<TFirst, TSecond, TResult>)
    IEnumerableExensions.ListZip<TFirst, TSecond, TThird, TResult>(IList<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, Func<TFirst, TSecond, TThird, TResult>)
    IEnumerableExensions.ListZip<TFirst, TSecond, TThird, TFourth, TResult>(IList<TFirst>, IList<TSecond>, IList<TThird>, IList<TFourth>, Func<TFirst, TSecond, TThird, TFourth, TResult>)
    IListExtensions.IsSparse<T>(IList<T>)
    IListExtensions.ListSelect<T, T2>(IList<T>, Func<T, T2>)
    IListExtensions.ListReduce<T, TRes>(IList<T>, TRes, Func<TRes, T, TRes>)
    IListExtensions.ListReduce<T, T2, TRes>(IList<T>, IEnumerable<T2>, TRes, Func<TRes, T, T2, TRes>)
    IListExtensions.SetTo<T>(IList<T>, IEnumerable<T>)
    IListExtensions.AsReadOnly<T>(IList<T>)
    ReadOnlyArray.ToReadOnlyArray<T>(IEnumerable<T>)
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.