X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cluster.hpp;h=d7c2737a05ed1a0198be9713aa4345f288ec3976;hb=2ecee16fec29d4c525f740ec19b27962ca09c050;hp=a6024e79d45a52274040a53cca4f8b32d9d2e998;hpb=c82900be3ceed3d9bc491bdc98b1819ef85c1af7;p=mothur.git diff --git a/cluster.hpp b/cluster.hpp index a6024e7..d7c2737 100644 --- a/cluster.hpp +++ b/cluster.hpp @@ -4,6 +4,7 @@ #include "mothur.h" #include "sparsematrix.hpp" +#include "mothurout.h" class RAbundVector; class ListVector; @@ -13,8 +14,8 @@ typedef vector MatVec; class Cluster { public: - Cluster(RAbundVector*, ListVector*, SparseMatrix*); - virtual void update(); + Cluster(RAbundVector*, ListVector*, SparseMatrix*, float, string); + virtual void update(double&); virtual string getTag() = 0; virtual void setMapWanted(bool m); virtual map getSeqtoBin() { return seq2Bin; } @@ -37,20 +38,23 @@ protected: int smallCol; float smallDist; bool mapWanted; + float cutoff; map seq2Bin; + string method; vector seqVec; // contains vectors of cells related to a certain sequence MatVec rowCells; MatVec colCells; ull nRowCells; ull nColCells; + MothurOut* m; }; /***********************************************************************/ class CompleteLinkage : public Cluster { public: - CompleteLinkage(RAbundVector*, ListVector*, SparseMatrix*); + CompleteLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string); bool updateDistance(MatData& colCell, MatData& rowCell); string getTag(); @@ -62,8 +66,8 @@ private: class SingleLinkage : public Cluster { public: - SingleLinkage(RAbundVector*, ListVector*, SparseMatrix*); - void update(); + SingleLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string); + void update(double&); bool updateDistance(MatData& colCell, MatData& rowCell); string getTag(); @@ -75,7 +79,7 @@ private: class AverageLinkage : public Cluster { public: - AverageLinkage(RAbundVector*, ListVector*, SparseMatrix*); + AverageLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string); bool updateDistance(MatData& colCell, MatData& rowCell); string getTag(); @@ -90,4 +94,17 @@ private: /***********************************************************************/ +class WeightedLinkage : public Cluster { +public: + WeightedLinkage(RAbundVector*, ListVector*, SparseMatrix*, float, string); + bool updateDistance(MatData& colCell, MatData& rowCell); + string getTag(); + +private: + int saveRow; + int saveCol; +}; + +/***********************************************************************/ + #endif