bpp-phyl  2.2.0
bpp::AbstractTreeLikelihood::SimpleBranchIterator Class Reference

A very simple branch iterator. More...

#include <Bpp/Phyl/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 () throw (Exception)
 
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 79 of file AbstractTreeLikelihood.h.

Constructor & Destructor Documentation

◆ SimpleBranchIterator()

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

Definition at line 87 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::TreeLikelihood::BranchIterator.

Definition at line 98 of file AbstractTreeLikelihood.h.

References index_, and nodesId_.

Referenced by next().

◆ next()

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

Implements bpp::TreeLikelihood::BranchIterator.

Definition at line 91 of file AbstractTreeLikelihood.h.

References hasNext(), index_, and nodesId_.

Member Data Documentation

◆ index_

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

Definition at line 84 of file AbstractTreeLikelihood.h.

Referenced by hasNext(), and next().

◆ nodesId_

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

Definition at line 83 of file AbstractTreeLikelihood.h.

Referenced by hasNext(), and next().


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