Package org.ejml.masks
Class Mask
java.lang.Object
org.ejml.masks.Mask
- Direct Known Subclasses:
DMaskPrimitive
,DMaskSparse
,DMaskSparseStructural
,FMaskPrimitive
,FMaskSparse
,FMaskSparseStructural
Mask used for specifying which matrix entries should be computed
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
Whether the mask entries should be negated. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
compatible
(Matrix matrix) Checks whether the dimensions of the mask and matrix matchprotected abstract int
protected abstract int
abstract boolean
isSet
(int idx) abstract boolean
isSet
(int row, int col) abstract int
Pessimistic estimation of entries set in the maskvoid
print()
Prints the mask to standard out.abstract void
setIndexColumn
(int column) For faster access on a specific column (on at a time) ! Only useful for sparse masks
-
Field Details
-
negated
public final boolean negatedWhether the mask entries should be negated. This avoids materializing the actual negated matrix.
-
-
Constructor Details
-
Mask
protected Mask(boolean negated)
-
-
Method Details
-
isSet
public abstract boolean isSet(int row, int col) - Returns:
- Whether the matrix entry is set in the mask
-
isSet
public abstract boolean isSet(int idx) - Returns:
- Whether the vector entry is set in the mask
-
getNumCols
protected abstract int getNumCols()- Returns:
- The number of columns of the wrapped matrix
-
getNumRows
protected abstract int getNumRows()- Returns:
- The number of rows of the wrapped matrix
-
print
public void print()Prints the mask to standard out. -
setIndexColumn
public abstract void setIndexColumn(int column) For faster access on a specific column (on at a time) ! Only useful for sparse masks- Parameters:
column
- column to index
-
compatible
Checks whether the dimensions of the mask and matrix match- Parameters:
matrix
- the mask is applied to
-
maxMaskedEntries
public abstract int maxMaskedEntries()Pessimistic estimation of entries set in the mask- Returns:
- Maximum number of set entries in mask
-