/** * print method for debugging */ public void printMe() { for (int i = 0; i < this.row; i++) { for (int j = 0; j < this.col; j++) { MatrixElement e = this.matrix[i, j]; if (this.coveredRows[e.getMyRow()]) { Console.Out.Write("|"); } if (this.coveredCols[e.getMyCol()]) { Console.Out.Write("|"); } if (e.getValue() < Double.MaxValue) { double temp = ((int)(e.getValue() * 1000.0)) / 1000.0; Console.Out.Write(temp); } else { Console.Out.Write("inf"); } if (e.isPrimed()) { Console.Out.Write("'"); } if (e.isStarred()) { Console.Out.Write("*"); } if (this.coveredRows[e.getMyRow()]) { Console.Out.Write("|"); } if (this.coveredCols[e.getMyCol()]) { Console.Out.Write("|"); } Console.Out.Write("\t"); } Console.Out.WriteLine(); } Console.Out.Write("\n"); }
/** * @return true if the col of @param e is starred */ public bool isStarredCol(MatrixElement e) { int c = e.getMyCol(); for (int i = 0; i < this.row; i++) { if (this.matrix[i, c].isStarred()) { return(true); } } return(false); }
/** * @return the primed zero in the col of @param e */ public MatrixElement getPrimedZeroInC(MatrixElement e) { int c = e.getMyCol(); for (int i = 0; i < this.row; i++) { if (this.matrix[i, c].getValue() == 0) { if (this.matrix[i, c].isPrimed()) { return(this.matrix[i, c]); } } } return(null); }
/** * uncover the col of element @param e */ public void unCoverCol(MatrixElement e) { int c = e.getMyCol(); this.coveredCols[c] = false; }