]> git.donarmstrong.com Git - mothur.git/blobdiff - weightedlinkage.cpp
changing command name classify.shared to classifyrf.shared
[mothur.git] / weightedlinkage.cpp
index 0851bd7ef94392ac2b2e269c16082981a7a0445a..b79986bd159866cd5b80aec76c570f7acac6e092 100644 (file)
@@ -5,14 +5,13 @@
 #include "mothur.h"
 #include "cluster.hpp"
 #include "rabundvector.hpp"
-#include "sparsematrix.hpp"
 
 /* This class implements the WPGMA, weighted average neighbor clustering algorithm */
 
 /***********************************************************************/
 
-WeightedLinkage::WeightedLinkage(RAbundVector* rav, ListVector* lv, SparseMatrix* dm, float c, string s) :
-       Cluster(rav, lv, dm, c, s)
+WeightedLinkage::WeightedLinkage(RAbundVector* rav, ListVector* lv, SparseDistanceMatrix* dm, float c, string s, float a) :
+       Cluster(rav, lv, dm, c, s, a)
 {
        saveRow = -1;
        saveCol = -1;
@@ -28,7 +27,7 @@ string WeightedLinkage::getTag() {
 
 /***********************************************************************/
 //This function updates the distance based on the average linkage method.
-bool WeightedLinkage::updateDistance(MatData& colCell, MatData& rowCell) {
+bool WeightedLinkage::updateDistance(PDistCell& colCell, PDistCell& rowCell) {
        try {
                if ((saveRow != smallRow) || (saveCol != smallCol)) {
 //                     rowBin = rabund->get(smallRow);
@@ -38,7 +37,7 @@ bool WeightedLinkage::updateDistance(MatData& colCell, MatData& rowCell) {
                        saveCol = smallCol;
                }
                
-               colCell->dist = (colCell->dist + rowCell->dist) / 2.0;
+               colCell.dist = (colCell.dist + rowCell.dist) / 2.0;
                
                return(true);
        }