X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fmath%2FMatrix.java;h=821fc664a0c3134003248d0aec828d019452bff6;hb=eb0d71ed66dcd7d8519eae1f084b76d60b374142;hp=aaeb8dab19de465a8ff14b6a988c106f4155096b;hpb=4b84334624d62fc15f3067fd96cae4880e654a02;p=jalview.git diff --git a/src/jalview/math/Matrix.java b/src/jalview/math/Matrix.java index aaeb8da..821fc66 100755 --- a/src/jalview/math/Matrix.java +++ b/src/jalview/math/Matrix.java @@ -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; + } + } + } + } }