Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 877 Bytes

SparseMatrix.md

File metadata and controls

29 lines (15 loc) · 877 Bytes

SparseMatrix

Implements: IEnumerable<T>

Provides a memory efficient implementation of a matrix in which most of the elements have the default value.


Constructors

SparseMatrix() Initializes a new instance of SparseMatrix.

SparseMatrix(T defaultValue) Initializes a new instance of SparseMatrix with the specified default element value.


Properties

int Count Gets the number of elements with value other than the default one.

int MinX Gets the minimum X-index of the SparseMatrix.

int MinY Gets the minimum Y-index of the SparseMatrix.

int MaxX Gets the maximum X-index of the SparseMatrix.

int MaxY Gets the maximum Y-index of the SparseMatrix.

T this[int index0, int index1] Gets or sets the value of the element at the specified coordinate of the SparseMatrix. Complexity: O(1)