bpp-phyl  2.2.0
bpp::PhyloStatistics Class Reference

Compute several quantities on a tree simulateously, optimizing the recursions on the tree. More...

#include <Bpp/Phyl/PhyloStatistics.h>

+ Inheritance diagram for bpp::PhyloStatistics:
+ Collaboration diagram for bpp::PhyloStatistics:

Public Member Functions

 PhyloStatistics ()
 
virtual ~PhyloStatistics ()
 
Clonable * clone () const
 
void setTree (const Tree &tree)
 Compute statistics for a given input tree. More...
 
size_t getNumberOfLeaves () const
 
size_t getNumberOfAncestors () const
 
const std::vector< double > & getBranchLengths () const
 
const std::vector< double > & getNodeHeights () const
 
const std::vector< size_t > & getNodeDepths () const
 
const std::vector< size_t > & getNodeNumberOfSons () const
 
const std::vector< int > & getNodeIds () const
 

Private Member Functions

void computeForSubtree_ (const Node *node, double &height, size_t &depth)
 

Private Attributes

size_t numberOfLeaves_
 
size_t numberOfAncestors_
 
std::vector< double > branchLengths_
 
std::vector< double > nodeHeights_
 
std::vector< size_t > nodeDepths_
 
std::vector< size_t > nodeNumberOfSons_
 
std::vector< int > nodeIds_
 

Detailed Description

Compute several quantities on a tree simulateously, optimizing the recursions on the tree.

This class uses a TreeTemplate. If the input tree is not a TreeTemplate, then a copy is performed before any computation.

See also
TreeTools, TreeTemplateTools.

Definition at line 60 of file PhyloStatistics.h.

Constructor & Destructor Documentation

◆ PhyloStatistics()

bpp::PhyloStatistics::PhyloStatistics ( )
inline

Definition at line 73 of file PhyloStatistics.h.

Referenced by clone().

◆ ~PhyloStatistics()

virtual bpp::PhyloStatistics::~PhyloStatistics ( )
inlinevirtual

Definition at line 77 of file PhyloStatistics.h.

Member Function Documentation

◆ clone()

Clonable* bpp::PhyloStatistics::clone ( ) const
inline

Definition at line 84 of file PhyloStatistics.h.

References PhyloStatistics().

◆ computeForSubtree_()

void PhyloStatistics::computeForSubtree_ ( const Node node,
double &  height,
size_t &  depth 
)
private

◆ getBranchLengths()

const std::vector<double>& bpp::PhyloStatistics::getBranchLengths ( ) const
inline

Definition at line 95 of file PhyloStatistics.h.

References branchLengths_.

◆ getNodeDepths()

const std::vector<size_t>& bpp::PhyloStatistics::getNodeDepths ( ) const
inline

Definition at line 97 of file PhyloStatistics.h.

References nodeDepths_.

◆ getNodeHeights()

const std::vector<double>& bpp::PhyloStatistics::getNodeHeights ( ) const
inline

Definition at line 96 of file PhyloStatistics.h.

References nodeHeights_.

◆ getNodeIds()

const std::vector<int>& bpp::PhyloStatistics::getNodeIds ( ) const
inline

Definition at line 99 of file PhyloStatistics.h.

References nodeIds_.

◆ getNodeNumberOfSons()

const std::vector<size_t>& bpp::PhyloStatistics::getNodeNumberOfSons ( ) const
inline

Definition at line 98 of file PhyloStatistics.h.

References nodeNumberOfSons_.

◆ getNumberOfAncestors()

size_t bpp::PhyloStatistics::getNumberOfAncestors ( ) const
inline

Definition at line 94 of file PhyloStatistics.h.

References numberOfAncestors_.

◆ getNumberOfLeaves()

size_t bpp::PhyloStatistics::getNumberOfLeaves ( ) const
inline

Definition at line 93 of file PhyloStatistics.h.

References numberOfLeaves_.

◆ setTree()

void PhyloStatistics::setTree ( const Tree tree)

Compute statistics for a given input tree.

Parameters
treeThe tree for which the statistics should be computed.

Definition at line 47 of file PhyloStatistics.cpp.

References bpp::TreeTemplate< N >::getRootNode().

Member Data Documentation

◆ branchLengths_

std::vector<double> bpp::PhyloStatistics::branchLengths_
private

Definition at line 66 of file PhyloStatistics.h.

Referenced by getBranchLengths().

◆ nodeDepths_

std::vector<size_t> bpp::PhyloStatistics::nodeDepths_
private

Definition at line 68 of file PhyloStatistics.h.

Referenced by getNodeDepths().

◆ nodeHeights_

std::vector<double> bpp::PhyloStatistics::nodeHeights_
private

Definition at line 67 of file PhyloStatistics.h.

Referenced by getNodeHeights().

◆ nodeIds_

std::vector<int> bpp::PhyloStatistics::nodeIds_
private

Definition at line 70 of file PhyloStatistics.h.

Referenced by getNodeIds().

◆ nodeNumberOfSons_

std::vector<size_t> bpp::PhyloStatistics::nodeNumberOfSons_
private

Definition at line 69 of file PhyloStatistics.h.

Referenced by getNodeNumberOfSons().

◆ numberOfAncestors_

size_t bpp::PhyloStatistics::numberOfAncestors_
private

Definition at line 65 of file PhyloStatistics.h.

Referenced by getNumberOfAncestors().

◆ numberOfLeaves_

size_t bpp::PhyloStatistics::numberOfLeaves_
private

Definition at line 64 of file PhyloStatistics.h.

Referenced by getNumberOfLeaves().


The documentation for this class was generated from the following files: