5 #ifndef BPP_PHYL_DISTANCE_HIERARCHICALCLUSTERING_H
6 #define BPP_PHYL_DISTANCE_HIERARCHICALCLUSTERING_H
37 static const std::string
WARD;
65 std::string
getName()
const {
return "Hierarchical clustering: " +
method_; }
70 double computeDistancesFromPair(
const std::vector<size_t>& pair,
const std::vector<double>& branchLengths,
size_t pos);
Partial implementation of the AgglomerativeDistanceMethod interface.
void computeTree() override
Compute the tree corresponding to the distance matrix.
std::string getName() const
HierarchicalClustering * clone() const
virtual ~HierarchicalClustering()
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.
std::vector< double > computeBranchLengthsForPair(const std::vector< size_t > &pair)
Compute the branch lengths for two nodes to agglomerate.
static const std::string AVERAGE
static const std::string CENTROID
virtual Node * getLeafNode(int id, const std::string &name)
Get a leaf node.
std::vector< size_t > getBestPair()
Get the best pair of nodes to agglomerate.
static const std::string COMPLETE
HierarchicalClustering(const std::string &method, bool verbose=false)
Builds a new clustering object.
static const std::string MEDIAN
virtual Node * getParentNode(int id, Node *son1, Node *son2)
Get an inner node.
void finalStep(int idRoot)
Method called when there ar eonly three remaining node to agglomerate, and creates the root node of t...
HierarchicalClustering(const std::string &method, const DistanceMatrix &matrix, bool verbose=false)
static const std::string SINGLE
static const std::string WARD
The phylogenetic node class.
Defines the basic types of data flow nodes.