41 #ifndef _NEIGHBORJOINING_H_ 42 #define _NEIGHBORJOINING_H_ 70 NeighborJoining(
bool rooted =
false,
bool positiveLengths =
false,
bool verbose =
true) :
84 NeighborJoining(
const DistanceMatrix& matrix,
bool rooted =
false,
bool positiveLengths =
false,
bool verbose =
true) throw (Exception) :
98 std::string
getName()
const {
return "NJ"; }
109 std::vector<size_t>
getBestPair() throw (Exception);
118 #endif //_NEIGHBORJOINING_H_ NeighborJoining(bool rooted=false, bool positiveLengths=false, bool verbose=true)
Create a new NeighborJoining object instance, without performing any computation. ...
std::vector< double > sumDist_
Partial implementation of the AgglomerativeDistanceMethod interface.
void finalStep(int idRoot)
Method called when there ar eonly three remaining node to agglomerate, and creates the root node of t...
virtual void setDistanceMatrix(const DistanceMatrix &matrix)
Set the distance matrix to use.
virtual void outputPositiveLengths(bool yn)
std::vector< double > computeBranchLengthsForPair(const std::vector< size_t > &pair)
Compute the branch lengths for two nodes to agglomerate.
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...
NeighborJoining * clone() const
virtual void computeTree()
Compute the tree corresponding to the distance matrix.
std::vector< size_t > getBestPair()
Get the best pair of nodes to agglomerate.
NeighborJoining(const DistanceMatrix &matrix, bool rooted=false, bool positiveLengths=false, bool verbose=true)
Create a new NeighborJoining object instance and compute a tree from a distance matrix.
The neighbor joining distance method.
virtual ~NeighborJoining()
virtual void setDistanceMatrix(const DistanceMatrix &matrix)
Set the distance matrix to use.
std::string getName() const