#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;
/***********************************************************************/
//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);
saveCol = smallCol;
}
- colCell->dist = (colCell->dist + rowCell->dist) / 2.0;
+ colCell.dist = (colCell.dist + rowCell.dist) / 2.0;
return(true);
}