本文整理汇总了C++中TopologyNode::getTaxaStringVector方法的典型用法代码示例。如果您正苦于以下问题:C++ TopologyNode::getTaxaStringVector方法的具体用法?C++ TopologyNode::getTaxaStringVector怎么用?C++ TopologyNode::getTaxaStringVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopologyNode
的用法示例。
在下文中一共展示了TopologyNode::getTaxaStringVector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void TmrcaStatistic::update( void ) {
const std::vector<TopologyNode*> &n = tree->getValue().getNodes();
size_t minCaldeSize = n.size() + 2;
bool found = false;
if ( index != RbConstants::Size_t::nan )
{
TopologyNode *node = n[index];
std::vector<std::string> taxa;
node->getTaxaStringVector( taxa );
size_t cladeSize = taxa.size();
if ( node->containsClade( clade, false ) && taxaCount == cladeSize )
{
found = true;
}
else
{
minCaldeSize = cladeSize;
}
}
if ( found == false )
{
for (size_t i = tree->getValue().getNumberOfTips(); i < n.size(); ++i)
{
TopologyNode *node = n[i];
std::vector<std::string> taxa;
node->getTaxaStringVector( taxa );
size_t cladeSize = taxa.size();
if ( cladeSize < minCaldeSize && cladeSize >= taxaCount && node->containsClade( clade, false ) )
{
index = node->getIndex();
minCaldeSize = cladeSize;
if ( taxaCount == cladeSize )
{
break;
}
}
}
}
if ( index == RbConstants::Size_t::nan )
{
throw RbException("TMRCA-Statistics can only be applied if clade is present.");
}
if ( stemAge )
{
size_t parentIndex = tree->getValue().getNode(index).getParent().getIndex();
double tmrca = tree->getValue().getAge(parentIndex);
*value = tmrca;
}
else
{
double tmrca = tree->getValue().getAge(index);
*value = tmrca;
}
}