JAL-4159 disable the score model combo box when pasimap is selected
[jalview.git] / src / jalview / math / Matrix.java
index 7870c14..7ae4b94 100755 (executable)
@@ -494,7 +494,7 @@ public class Matrix implements MatrixI
           }
           else
           {
-            // System.out.println("Iteration " + iter);
+            // jalview.bin.Console.outPrintln("Iteration " + iter);
           }
 
           g = (d[l] - d[l - 1]) / (2.0 * e[l - 1]);
@@ -758,7 +758,7 @@ public class Matrix implements MatrixI
           }
           else
           {
-            // System.out.println("Iteration " + iter);
+            // jalview.bin.Console.outPrintln("Iteration " + iter);
           }
 
           g = (d[l] - d[l - 1]) / (2.0 * e[l - 1]);
@@ -1415,4 +1415,29 @@ public class Matrix implements MatrixI
     return result;
   }
 
+  /**
+  * mirrors columns of the matrix
+  *
+  * @return
+  */
+  @Override
+  public MatrixI mirrorCol()
+  {
+    double[][] result = new double[rows][cols];
+    for (int i = 0; i < rows; i++)
+    {
+      int k = cols - 1;        // reverse col
+      for (int j = 0; j < cols; j++)
+      {
+       result[i][k--] = this.getValue(i,j);
+      }
+    }
+    MatrixI resultMatrix = new Matrix(result);
+    if (d != null)
+      resultMatrix.setD(d);
+    if (e != null)
+      resultMatrix.setE(e);
+
+    return resultMatrix;
+  }
 }