Class ChengAndChurch.BiclusterCandidate

  • Enclosing class:
    ChengAndChurch

    protected static class ChengAndChurch.BiclusterCandidate
    extends java.lang.Object
    Bicluster candidate.
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double allM
      Mean of the current bicluster.
      (package private) int colcard
      Cardinalities.
      (package private) double[] colM
      Means.
      (package private) long[] cols
      Row and column bitmasks.
      (package private) long[] irow
      Row and column bitmasks.
      private ChengAndChurch.CellVisitor MEANVISITOR
      Visitor for updating the means.
      (package private) double residue
      The current bicluster score (mean squared residue).
      (package private) int rowcard
      Cardinalities.
      (package private) double[] rowM
      Means.
      (package private) long[] rows
      Row and column bitmasks.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BiclusterCandidate​(int rows, int cols)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected double computeColResidue​(double[][] mat, int col)
      Computes the mean column residue of the given col.
      protected double computeMeanSquaredDeviation​(double[][] mat)
      Compute the mean square residue.
      protected double computeRowResidue​(double[][] mat, int row, boolean rowinverted)
      Computes the mean row residue of the given row.
      protected void invertRow​(int rnum, boolean b)  
      protected void maskMatrix​(double[][] mat, Distribution replacement, java.util.Random rnd)
      Updates the mask with replacement values for all data in the given rows and columns.
      protected void reset()
      Resets the values for the next cluster search.
      protected void selectColumn​(int cnum, boolean set)
      Select or deselect a column.
      protected void selectRow​(int rnum, boolean set)
      Select or deselect a row.
      protected double updateRowAndColumnMeans​(double[][] mat, boolean all)
      Update the row means and column means.
      protected void visitAll​(double[][] mat, int mode, ChengAndChurch.CellVisitor visitor)
      Visit all selected cells in the data matrix.
      protected void visitColumn​(double[][] mat, int col, int mode, ChengAndChurch.CellVisitor visitor)
      Visit a column of the matrix.
      protected void visitRow​(double[][] mat, int row, int mode, ChengAndChurch.CellVisitor visitor)
      Visit a row of the data matrix.
      • Methods inherited from class java.lang.Object

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

      • rowcard

        int rowcard
        Cardinalities.
      • colcard

        int colcard
        Cardinalities.
      • rowM

        double[] rowM
        Means.
      • colM

        double[] colM
        Means.
      • rows

        long[] rows
        Row and column bitmasks.
      • irow

        long[] irow
        Row and column bitmasks.
      • cols

        long[] cols
        Row and column bitmasks.
      • allM

        double allM
        Mean of the current bicluster.
      • residue

        double residue
        The current bicluster score (mean squared residue).
    • Constructor Detail

      • BiclusterCandidate

        protected BiclusterCandidate​(int rows,
                                     int cols)
        Constructor.
        Parameters:
        rows - Row dimensionality.
        cols - Column dimensionality.
    • Method Detail

      • reset

        protected void reset()
        Resets the values for the next cluster search.
      • visitAll

        protected void visitAll​(double[][] mat,
                                int mode,
                                ChengAndChurch.CellVisitor visitor)
        Visit all selected cells in the data matrix.
        Parameters:
        mat - Data matrix
        mode - Operation mode
        visitor - Visitor function
      • visitColumn

        protected void visitColumn​(double[][] mat,
                                   int col,
                                   int mode,
                                   ChengAndChurch.CellVisitor visitor)
        Visit a column of the matrix.
        Parameters:
        mat - Data matrix
        col - Column to visit
        mode - Operation mode
        visitor - Visitor function
      • visitRow

        protected void visitRow​(double[][] mat,
                                int row,
                                int mode,
                                ChengAndChurch.CellVisitor visitor)
        Visit a row of the data matrix.
        Parameters:
        mat - Data matrix
        row - Row to visit
        visitor - Visitor function
      • updateRowAndColumnMeans

        protected double updateRowAndColumnMeans​(double[][] mat,
                                                 boolean all)
        Update the row means and column means.
        Parameters:
        mat - Data matrix
        all - Flag, to update all
        Returns:
        overall mean
      • computeMeanSquaredDeviation

        protected double computeMeanSquaredDeviation​(double[][] mat)
        Compute the mean square residue.
        Parameters:
        mat - Data matrix
        Returns:
        mean squared residue
      • computeRowResidue

        protected double computeRowResidue​(double[][] mat,
                                           int row,
                                           boolean rowinverted)
        Computes the mean row residue of the given row.
        Parameters:
        mat - Data matrix
        row - The row who's residue should be computed.
        rowinverted - Indicates if the row should be considered inverted.
        Returns:
        The row residue of the given row.
      • computeColResidue

        protected double computeColResidue​(double[][] mat,
                                           int col)
        Computes the mean column residue of the given col.
        Parameters:
        col - The column who's residue should be computed.
        Returns:
        The row residue of the given colum.
      • maskMatrix

        protected void maskMatrix​(double[][] mat,
                                  Distribution replacement,
                                  java.util.Random rnd)
        Updates the mask with replacement values for all data in the given rows and columns.
        Parameters:
        mat - Mask to update.
        replacement - Distribution to sample replacement values from.
        rnd - Random generator.
      • selectColumn

        protected void selectColumn​(int cnum,
                                    boolean set)
        Select or deselect a column.
        Parameters:
        cnum - Column to select
        set - Value to set
      • selectRow

        protected void selectRow​(int rnum,
                                 boolean set)
        Select or deselect a row.
        Parameters:
        rnum - Row to select
        set - Value to set
      • invertRow

        protected void invertRow​(int rnum,
                                 boolean b)