]> git.donarmstrong.com Git - mothur.git/blob - completelinkage.cpp
fixes while testing 1.33.0
[mothur.git] / completelinkage.cpp
1
2 #include "cluster.hpp"
3
4 /***********************************************************************/
5
6 CompleteLinkage::CompleteLinkage(RAbundVector* rav, ListVector* lv, SparseDistanceMatrix* dm, float c, string s, float a) :
7         Cluster(rav, lv, dm, c, s, a)
8 {}
9
10 /***********************************************************************/
11 //This function returns the tag of the method.
12 string CompleteLinkage::getTag() {
13         return("fn");
14 }
15
16
17 /***********************************************************************/
18 //This function updates the distance based on the furthest neighbor method.
19 bool CompleteLinkage::updateDistance(PDistCell& colCell, PDistCell& rowCell) {
20         try {
21                 bool changed = false;
22                 if (colCell.dist < rowCell.dist) {
23                         colCell.dist = rowCell.dist;
24                         changed = true;
25                 }       
26                 return(changed);
27         }
28         catch(exception& e) {
29                 m->errorOut(e, "CompleteLinkage", "updateDistance");
30                 exit(1);
31         }
32 }
33
34 /***********************************************************************/