X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=completelinkage.cpp;fp=completelinkage.cpp;h=86e90547f494ef0883705f640521cb82cf6dbb8f;hb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;hp=0000000000000000000000000000000000000000;hpb=1b73ff67c83892a025e597dabd9df6fe7b58206a;p=mothur.git diff --git a/completelinkage.cpp b/completelinkage.cpp new file mode 100644 index 0000000..86e9054 --- /dev/null +++ b/completelinkage.cpp @@ -0,0 +1,34 @@ + +#include "cluster.hpp" + +/***********************************************************************/ + +CompleteLinkage::CompleteLinkage(RAbundVector* rav, ListVector* lv, SparseMatrix* dm, float c, string s) : + Cluster(rav, lv, dm, c, s) +{} + +/***********************************************************************/ +//This function returns the tag of the method. +string CompleteLinkage::getTag() { + return("fn"); +} + + +/***********************************************************************/ +//This function updates the distance based on the furthest neighbor method. +bool CompleteLinkage::updateDistance(MatData& colCell, MatData& rowCell) { + try { + bool changed = false; + if (colCell->dist < rowCell->dist) { + colCell->dist = rowCell->dist; + changed = true; + } + return(changed); + } + catch(exception& e) { + m->errorOut(e, "CompleteLinkage", "updateDistance"); + exit(1); + } +} + +/***********************************************************************/