]> git.donarmstrong.com Git - mothur.git/blobdiff - pam.cpp
working of get.mimarkspackage and sra command
[mothur.git] / pam.cpp
diff --git a/pam.cpp b/pam.cpp
index d33bab81b17c7f0f77366a048014e9781c2eb0bd..d962a363f8330a063a1d63ac2129686164bc706f 100644 (file)
--- a/pam.cpp
+++ b/pam.cpp
@@ -35,6 +35,7 @@ Pam::Pam(vector<vector<int> > c, vector<vector<double> > d, int p) : CommunityTy
        }
 }
 /**************************************************************************************************/
+//build and swap functions based on pam.c by maechler from R cluster package
 //sets Dp[0] does not set Dp[1]. chooses intial medoids.
 int Pam::buildPhase() {
     try {
@@ -124,10 +125,10 @@ int Pam::swapPhase() {
                             for (int j = 0; j < numSamples; j++) {
                                 if (m->control_pressed) { break; }
                                 if (dists[i][j] == Dp[j][0]) {
-                                    double small = 0.0;
-                                    if (Dp[j][1] > dists[h][j]) {   small = dists[h][j];    }
-                                    else                        {   small = Dp[j][1];       }
-                                    dz += (- Dp[j][0]+ small);
+                                    double smallValue; smallValue = 0.0;
+                                    if (Dp[j][1] > dists[h][j]) {   smallValue = dists[h][j];    }
+                                    else                        {   smallValue = Dp[j][1];       }
+                                    dz += (- Dp[j][0]+ smallValue);
                                 }else if (dists[h][j] < Dp[j][0]) {
                                     dz += (- Dp[j][0] + dists[h][j]);
                                 }