X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=weightedlinkage.cpp;h=b79986bd159866cd5b80aec76c570f7acac6e092;hp=0851bd7ef94392ac2b2e269c16082981a7a0445a;hb=615301e57c25e241356a9c2380648d117709458d;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc diff --git a/weightedlinkage.cpp b/weightedlinkage.cpp index 0851bd7..b79986b 100644 --- a/weightedlinkage.cpp +++ b/weightedlinkage.cpp @@ -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); }