Package ubic.gemma.core.datastructure
Class MatrixMask
- java.lang.Object
-
- ubic.gemma.core.datastructure.MatrixMask
-
public class MatrixMask extends Object
A quasi-universal matrix mask.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasColumnMask()
Indicate if this mask has any column-wise masking.boolean
hasElementMask()
Indicate if this mask has any element-wise masking.boolean
hasRowMask()
Indicate if this mask has any row-wise masking.MatrixMask
inverted()
Invert the mask of this matrix, allowing access to the previously masked elements.boolean
isColumnMasked(int column)
boolean
isMasked(int row, int column)
boolean
isRowMasked(int row)
static MatrixMask
maskColumns(int rows, int cols, boolean[] columnMask)
Mask whole columns of the given matrix.static MatrixMask
maskElements(int rows, int cols, boolean[][] mask)
Mask individual elements of the given matrix.static MatrixMask
maskElements(int rows, int cols, int[] i, int[] j)
Mask individual elements of the given matrix at the specified coordinates.static MatrixMask
maskRows(int rows, int cols, boolean[] rowMask)
Mask whole rows of the given matrix.
-
-
-
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.
-
-