JAL-2397 scale PCA by PID to alignment width to match SeqSpace
[jalview.git] / src / jalview / math / Matrix.java
index aaeb8da..821fc66 100755 (executable)
@@ -957,4 +957,23 @@ public class Matrix implements MatrixI
       }
     }
   }
+
+  /**
+   * Multiply every entry in the matrix by the given value. This method is not
+   * thread-safe.
+   */
+  @Override
+  public void multiply(double d)
+  {
+    for (double[] row : value)
+    {
+      if (row != null)
+      {
+        for (int i = 0; i < row.length; i++)
+        {
+          row[i] *= d;
+        }
+      }
+    }
+  }
 }