From 64ead0dc966e9a9768a24c8f55518db83ed2e82f Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 23 Dec 2009 19:16:36 +0000 Subject: [PATCH] added average and nearest neighbor methods to hcluster --- hcluster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hcluster.cpp b/hcluster.cpp index 4e8c994..72af7c8 100644 --- a/hcluster.cpp +++ b/hcluster.cpp @@ -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; } } -- 2.39.2