]> git.donarmstrong.com Git - mothur.git/blobdiff - linearalgebra.cpp
added mantel command
[mothur.git] / linearalgebra.cpp
index 9308627d1335920ea49f9b4c5bbd543de629ae85..33464ca5b3519f615b1029b22793694d595eee2d 100644 (file)
@@ -637,7 +637,7 @@ double LinearAlgebra::calcKendall(vector< vector<double> >& euclidDists, vector<
                        int numWithLowerRank = 0;
                        float thisrank = user[l].score;
                                        
-                       for (int u = l; u < scores.size(); u++) {
+                       for (int u = l+1; u < scores.size(); u++) {
                                if (user[u].score > thisrank) { numWithHigherRank++; }
                                else if (user[u].score < thisrank) { numWithLowerRank++; }
                                count++;
@@ -647,9 +647,6 @@ double LinearAlgebra::calcKendall(vector< vector<double> >& euclidDists, vector<
                        numDisCoor += numWithLowerRank;
                }
                                
-               //comparing to yourself
-               count -= userDists.size();
-                               
                r = (numCoor - numDisCoor) / (float) count;
                
                //divide by zero error