Merge branch 'develop' into features/JAL-2379pcaMemory
[jalview.git] / src / jalview / math / Matrix.java
index 2b2314b..ee74b9b 100755 (executable)
@@ -26,15 +26,12 @@ import jalview.util.MessageManager;
 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;
 
@@ -48,10 +45,8 @@ public class Matrix implements MatrixI
    */
   protected int cols;
 
-  /** DOCUMENT ME!! */
   protected double[] d; // Diagonal
 
-  /** DOCUMENT ME!! */
   protected double[] e; // off diagonal
 
   /**
@@ -89,10 +84,7 @@ public class Matrix implements MatrixI
   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;
   }
 
@@ -372,7 +364,7 @@ public class Matrix implements MatrixI
 
           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)));
           }
         }
       }