Fun Sparse Matrix
SparseMatrix where values are determined by a function, not storage.
Parameters
object that provides access to the actual data.
Constructors
Constructor where validity and value are determined by validator and valueFun separately. This is somewhat more efficient in the case that valueFun is expensive as validator is called separately.
Constructor where validity and value are determined by the same underlying function. Note that valueFun is always called, results are not cached.
Functions
Get all elements in the matrix as sequence.
Determine whether the content of this matrix is the same as the other by checking equality on the cell values. Sparse matrices with different dimensions, but the same valid indices can be equal.
Creates a copy of the matrix of an appropriate type with the same content.
Perform the action for each index in the (sparse) matrix. This skips sparse indices.
This function can be used to determine whether the given coordinates are valid. Returns true if valid. This function works on any value for the coordinates and should return false
for all values out of range (x<0 || x>=[maxWidth]
), (y<0 || y>=[maxHeight]
).
A map implementation that creates a boolean sparse matrix based upon the receiver and the transformation function.
Create a new SparseIntMatrix with the dimensions of the original where the value of each cell is the result of applying the transform to the value of the cell in the original.