Search in sources :

Example 6 with CladeRef

use of dr.evomodel.bigfasttree.constrainedtree.CladeRef in project beast-mcmc by beast-dev.

the class CladeAwareSubtreeLeapTest method testTreeRemoveRoot.

public void testTreeRemoveRoot() {
    NodeRef node = tree.getNode(3);
    NodeRef parent = tree.getParent(node);
    NodeRef grandparent = tree.getParent(parent);
    NodeRef sibling = tree.getNode(7);
    NodeRef j = tree.getNode(6);
    CladeRef clade = cladeNodeModel.getClade(node);
    operator.doOperation(node, parent, sibling, j, clade, 1.5);
    assertEquals(7, cladeNodeModel.getRootNode(clade).getNumber());
    assertTrue(noNodeLeftBehind(tree));
}
Also used : NodeRef(dr.evolution.tree.NodeRef) CladeRef(dr.evomodel.bigfasttree.constrainedtree.CladeRef)

Example 7 with CladeRef

use of dr.evomodel.bigfasttree.constrainedtree.CladeRef in project beast-mcmc by beast-dev.

the class CladeAwareSubtreeLeapTest method testSuperSeedTreeRoot.

public void testSuperSeedTreeRoot() {
    NodeRef node = tree.getNode(5);
    NodeRef parent = tree.getParent(node);
    NodeRef grandparent = tree.getParent(parent);
    NodeRef sibling = tree.getNode(4);
    NodeRef j = tree.getNode(10);
    CladeRef clade = cladeNodeModel.getClade(parent);
    operator.doOperation(node, parent, sibling, j, clade, 4.5);
    assertEquals(9, cladeNodeModel.getRootNode(clade).getNumber());
    assertEquals(9, tree.getRoot().getNumber());
    assertTrue(noNodeLeftBehind(tree));
}
Also used : NodeRef(dr.evolution.tree.NodeRef) CladeRef(dr.evomodel.bigfasttree.constrainedtree.CladeRef)

Aggregations

NodeRef (dr.evolution.tree.NodeRef)7 CladeRef (dr.evomodel.bigfasttree.constrainedtree.CladeRef)7 NewickImporter (dr.evolution.io.NewickImporter)3 CladeNodeModel (dr.evomodel.bigfasttree.constrainedtree.CladeNodeModel)3 ConstrainedTreeBranchLengthProvider (dr.evomodel.bigfasttree.constrainedtree.ConstrainedTreeBranchLengthProvider)3 StrictClockBranchRates (dr.evomodel.branchratemodel.StrictClockBranchRates)3 PoissonDistribution (dr.math.distributions.PoissonDistribution)1