X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=weightedlinkage.cpp;h=c1e4d51be52b95b7eec757930532a8d231f07ea5;hp=0851bd7ef94392ac2b2e269c16082981a7a0445a;hb=a8e2df1b96a57f5f29576b08361b86a96a8eff4f;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc diff --git a/weightedlinkage.cpp b/weightedlinkage.cpp index 0851bd7..c1e4d51 100644 --- a/weightedlinkage.cpp +++ b/weightedlinkage.cpp @@ -5,13 +5,12 @@ #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) : +WeightedLinkage::WeightedLinkage(RAbundVector* rav, ListVector* lv, SparseDistanceMatrix* dm, float c, string s) : Cluster(rav, lv, dm, c, s) { saveRow = -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); }