1 #ifndef WEIGHTEDLINKAGE_H
2 #define WEIGHTEDLINKAGE_H
7 #include "rabundvector.hpp"
9 /* This class implements the WPGMA, weighted average neighbor clustering algorithm */
11 /***********************************************************************/
13 WeightedLinkage::WeightedLinkage(RAbundVector* rav, ListVector* lv, SparseDistanceMatrix* dm, float c, string s) :
14 Cluster(rav, lv, dm, c, s)
21 /***********************************************************************/
22 //This function returns the tag of the method.
23 string WeightedLinkage::getTag() {
28 /***********************************************************************/
29 //This function updates the distance based on the average linkage method.
30 bool WeightedLinkage::updateDistance(PDistCell& colCell, PDistCell& rowCell) {
32 if ((saveRow != smallRow) || (saveCol != smallCol)) {
33 // rowBin = rabund->get(smallRow);
34 // colBin = rabund->get(smallCol);
35 // totalBin = rowBin + colBin;
40 colCell.dist = (colCell.dist + rowCell.dist) / 2.0;
45 m->errorOut(e, "WeightedLinkage", "updateDistance");
50 /***********************************************************************/
53 /***********************************************************************/