bpp-phyl3  3.0.0
bpp::AbstractTreeLikelihood::SimpleBranchIterator Class Reference

A very simple branch iterator. More...

#include <Bpp/Phyl/Legacy/Likelihood/AbstractTreeLikelihood.h>

+ Inheritance diagram for bpp::AbstractTreeLikelihood::SimpleBranchIterator:
+ Collaboration diagram for bpp::AbstractTreeLikelihood::SimpleBranchIterator:

Public Member Functions

 SimpleBranchIterator (const std::vector< int > &nodesId)
 
int next ()
 
bool hasNext () const
 

Private Attributes

std::vector< int > nodesId_
 
size_t index_
 

Detailed Description

A very simple branch iterator.

The constructor takes a vector of nodes id to iterate over.

Definition at line 45 of file AbstractTreeLikelihood.h.

Constructor & Destructor Documentation

◆ SimpleBranchIterator()

bpp::AbstractTreeLikelihood::SimpleBranchIterator::SimpleBranchIterator ( const std::vector< int > &  nodesId)
inline

Definition at line 53 of file AbstractTreeLikelihood.h.

Member Function Documentation

◆ hasNext()

bool bpp::AbstractTreeLikelihood::SimpleBranchIterator::hasNext ( ) const
inlinevirtual
Returns
True if there is at least another node in the set.

Implements bpp::TreeLikelihoodInterface::BranchIterator.

Definition at line 64 of file AbstractTreeLikelihood.h.

References index_, and nodesId_.

Referenced by next().

◆ next()

int bpp::AbstractTreeLikelihood::SimpleBranchIterator::next ( )
inlinevirtual
Returns
The id of the next node in the set.

Implements bpp::TreeLikelihoodInterface::BranchIterator.

Definition at line 57 of file AbstractTreeLikelihood.h.

References hasNext(), index_, and nodesId_.

Member Data Documentation

◆ index_

size_t bpp::AbstractTreeLikelihood::SimpleBranchIterator::index_
private

Definition at line 50 of file AbstractTreeLikelihood.h.

Referenced by hasNext(), and next().

◆ nodesId_

std::vector<int> bpp::AbstractTreeLikelihood::SimpleBranchIterator::nodesId_
private

Definition at line 49 of file AbstractTreeLikelihood.h.

Referenced by hasNext(), and next().


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