本文整理汇总了C++中SequenceTree::partition方法的典型用法代码示例。如果您正苦于以下问题:C++ SequenceTree::partition方法的具体用法?C++ SequenceTree::partition怎么用?C++ SequenceTree::partition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SequenceTree
的用法示例。
在下文中一共展示了SequenceTree::partition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: choose_SPR_target
int choose_SPR_target(SequenceTree& T1, int b1_)
{
const_branchview b1 = T1.directed_branch(b1_);
//----- Select the branch to move to ------//
dynamic_bitset<> subtree_nodes = T1.partition(b1.reverse());
subtree_nodes[b1.target()] = true;
vector<int> branches;
vector<double> lengths;
for(int i=0; i<T1.n_branches(); i++)
{
const_branchview bi = T1.branch(i);
// skip branch if its contained in the subtree
if (subtree_nodes[bi.target()] and
subtree_nodes[bi.source()])
continue;
double L = 1.0;
// down-weight branch if it is one of the subtree's 2 neighbors
if (subtree_nodes[bi.target()] or
subtree_nodes[bi.source()])
L = 0.5;
branches.push_back(i);
lengths.push_back(L);
}
int b2 = branches[ choose(lengths) ];
return b2;
}
示例2: partition_from_branch
Partition partition_from_branch(const SequenceTree& T,int b)
{
dynamic_bitset<> group(T.n_leaves());
const dynamic_bitset<>& with_internal = T.partition(b);
for(int i=0;i<group.size();i++)
group[i] = with_internal[i];
return Partition(T.get_leaf_labels(), group);
}