]> git.donarmstrong.com Git - mothur.git/commitdiff
added average and nearest neighbor methods to hcluster
authorwestcott <westcott>
Wed, 23 Dec 2009 19:16:36 +0000 (19:16 +0000)
committerwestcott <westcott>
Wed, 23 Dec 2009 19:16:36 +0000 (19:16 +0000)
hcluster.cpp

index 4e8c9945bd11574cfc7c15b6411343fd79576b6b..72af7c8423ac38032de4455800b171f2114d1eac 100644 (file)
@@ -280,7 +280,8 @@ void HCluster::update(int row, int col, float distance){
                        bool cluster = false;
                        
                        if (method == "nearest") { cluster = true;  }
-                       else if (method == "average") { cout << "still working on this... " << endl; //got to figure this out 
+                       else if (method == "average") { 
+                               if (linkValue == (ceil(((clusterArray[smallRow].numSeq * clusterArray[smallCol].numSeq)) / (float) 2.0))) { cluster = true; }
                        }else{ //assume furthest
                                if (linkValue == (clusterArray[smallRow].numSeq * clusterArray[smallCol].numSeq)) { cluster = true; }
                        }