Class Mask

java.lang.Object
org.ejml.masks.Mask
Direct Known Subclasses:
DMaskPrimitive, DMaskSparse, DMaskSparseStructural, FMaskPrimitive, FMaskSparse, FMaskSparseStructural

public abstract class Mask
extends Object
Mask used for specifying which matrix entries should be computed
  • Field Summary

    Fields
    Modifier and Type Field Description
    boolean negated
    Whether the mask entries should be negated.
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected Mask​(boolean negated)  
  • Method Summary

    Modifier and Type Method Description
    void compatible​(Matrix matrix)
    Checks whether the dimensions of the mask and matrix match
    protected abstract int getNumCols()  
    protected abstract int getNumRows()  
    abstract boolean isSet​(int idx)  
    abstract boolean isSet​(int row, int col)  
    abstract int maxMaskedEntries()
    Pessimistic estimation of entries set in the mask
    void 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • negated

      public final boolean negated
      Whether 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

      public void compatible​(Matrix matrix)
      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