41 #ifndef _HIERARCHICALCLUSTERING_H_ 42 #define _HIERARCHICALCLUSTERING_H_ 72 static const std::string
WARD;
88 HierarchicalClustering(
const std::string& method,
const DistanceMatrix& matrix,
bool verbose =
false) throw (Exception) :
105 std::vector<size_t>
getBestPair() throw (Exception);
114 #endif // _HIERARCHICALCLUSTERING_H_ HierarchicalClustering * clone() const
virtual ~HierarchicalClustering()
virtual Node * getLeafNode(int id, const std::string &name)
Get a leaf node.
std::vector< double > computeBranchLengthsForPair(const std::vector< size_t > &pair)
Compute the branch lengths for two nodes to agglomerate.
Partial implementation of the AgglomerativeDistanceMethod interface.
HierarchicalClustering(const std::string &method, bool verbose=false)
Builds a new clustering object.
static const std::string SINGLE
The phylogenetic tree class.
static const std::string COMPLETE
double computeDistancesFromPair(const std::vector< size_t > &pair, const std::vector< double > &branchLengths, size_t pos)
Actualizes the distance matrix according to a given pair and the corresponding branch lengths...
static const std::string CENTROID
std::vector< size_t > getBestPair()
Get the best pair of nodes to agglomerate.
virtual void computeTree()
Compute the tree corresponding to the distance matrix.
The phylogenetic node class.
HierarchicalClustering(const std::string &method, const DistanceMatrix &matrix, bool verbose=false)
TreeTemplate< Node > * getTree() const
Get the computed tree, if there is one.
void finalStep(int idRoot)
Method called when there ar eonly three remaining node to agglomerate, and creates the root node of t...
static const std::string WARD
virtual Node * getParentNode(int id, Node *son1, Node *son2)
Get an inner node.
std::string getName() const
static const std::string MEDIAN
static const std::string AVERAGE