From e16c0028eadeb0c5a39860e11bebfb58bda84503 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 15 Jun 2012 16:08:38 +0100 Subject: [PATCH] JAL-1123 - make clear where off-by-one error was occuring (patched problem in previous commit) --- src/jalview/viewmodel/PCAModel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jalview/viewmodel/PCAModel.java b/src/jalview/viewmodel/PCAModel.java index 30f8783..6002c8a 100644 --- a/src/jalview/viewmodel/PCAModel.java +++ b/src/jalview/viewmodel/PCAModel.java @@ -97,14 +97,15 @@ public class PCAModel /** * update the 2d coordinates for the list of points to the given dimensions - * Principal dimension is getTop(). Next greated eigenvector is getTop()-1. - * Note - pca.getComponents starts counting the spectrum from zero rather than one, so getComponents(dimN ...) == updateRcView(dimN+1 ..) + * Principal dimension is getTop(). Next greatest eigenvector is getTop()-1. + * Note - pca.getComponents starts counting the spectrum from rank-2 to zero, rather than rank-1, so getComponents(dimN ...) == updateRcView(dimN+1 ..) * @param dim1 * @param dim2 * @param dim3 */ public void updateRcView(int dim1, int dim2, int dim3) { + // note: actual indices for components are dim1-1, etc (patch for JAL-1123) float[][] scores = pca.getComponents(dim1-1, dim2-1, dim3-1, 100); for (int i = 0; i < pca.getM().rows; i++) -- 1.7.10.2