Class MatrixMask


  • public class MatrixMask
    extends Object
    A quasi-universal matrix mask.
    • Method Detail

      • maskElements

        public static MatrixMask maskElements​(int rows,
                                              int cols,
                                              boolean[][] mask)
        Mask individual elements of the given matrix.
      • maskElements

        public static MatrixMask maskElements​(int rows,
                                              int cols,
                                              int[] i,
                                              int[] j)
        Mask individual elements of the given matrix at the specified coordinates.

        This uses a sparse representation internally, which is more efficient for large matrices with few masked elements.

      • maskRows

        public static MatrixMask maskRows​(int rows,
                                          int cols,
                                          boolean[] rowMask)
        Mask whole rows of the given matrix.
      • maskColumns

        public static MatrixMask maskColumns​(int rows,
                                             int cols,
                                             boolean[] columnMask)
        Mask whole columns of the given matrix.
      • hasColumnMask

        public boolean hasColumnMask()
        Indicate if this mask has any column-wise masking.
      • hasRowMask

        public boolean hasRowMask()
        Indicate if this mask has any row-wise masking.
      • hasElementMask

        public boolean hasElementMask()
        Indicate if this mask has any element-wise masking.
      • isRowMasked

        public boolean isRowMasked​(int row)
      • isColumnMasked

        public boolean isColumnMasked​(int column)
      • isMasked

        public boolean isMasked​(int row,
                                int column)
      • inverted

        public MatrixMask inverted()
        Invert the mask of this matrix, allowing access to the previously masked elements.