import java.io.PrintStream;
/**
- * DOCUMENT ME!
- *
- * @author $author$
- * @version $Revision$
+ * A class to model rectangular matrices of double values and operations on them
*/
public class Matrix implements MatrixI
{
/*
- * the [row][column] values in the matrix
+ * the cell values in row-major order
*/
private double[][] value;
*/
protected int cols;
- /** DOCUMENT ME!! */
protected double[] d; // Diagonal
- /** DOCUMENT ME!! */
protected double[] e; // off diagonal
/**
public Matrix(double[][] values)
{
this.rows = values.length;
- if (rows > 0)
- {
- this.cols = values[0].length;
- }
+ this.cols = this.rows == 0 ? 0 : values[0].length;
this.value = values;
}
for (k = 1; k <= l; k++)
{
- double x = addValue(k - 1, j - 1, -(g * getValue(k - 1, i - 1)));
+ addValue(k - 1, j - 1, -(g * getValue(k - 1, i - 1)));
}
}
}