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
FieldsModifier and TypeFieldDescriptionfinal booleanWhether the mask entries should be negated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompatible(Matrix matrix) Checks whether the dimensions of the mask and matrix matchprotected abstract intprotected abstract intabstract booleanisSet(int idx) abstract booleanisSet(int row, int col) abstract intPessimistic estimation of entries set in the maskvoidprint()Prints the mask to standard out.abstract voidsetIndexColumn(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
-