Matrix<T>.NonzeroElements Property

Gets a collection of the nonzero elements of the matrix.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
public virtual IEnumerable<RowColumnValueTriplet<T>> NonzeroElements { get; }

Property Value

IEnumerable<RowColumnValueTriplet<T>>

Remarks

Use this property to enumerate over the nonzero elements of a sparse matrix. The object that is returned implements IEnumerable. Use this object's GetEnumerator() method to get access to the elements.

The elements of the enumeration are of type RowColumnValueTriplet<T>. These are triplets consisting of the row, the column and the value of the nonzero element.

Note to implementors: the order in which the elements are enumerated is not specified. However, you must ensure that, before a element is yielded, all elements with smaller row or column index have already been enumerated.

See Also