File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1+ use super :: bindings:: tsk_id_t;
12use super :: bindings:: tsk_size_t;
23use super :: bindings:: tsk_tree_t;
34use super :: flags:: TreeFlags ;
5+ use super :: newtypes:: NodeId ;
46use super :: tskbox:: TskBox ;
57use super :: TreeSequence ;
68use super :: TskitError ;
@@ -56,6 +58,11 @@ impl<'treeseq> LLTree<'treeseq> {
5658 )
5759 }
5860
61+ /// Return the virtual root of the tree.
62+ pub fn virtual_root ( & self ) -> tsk_id_t {
63+ self . as_ref ( ) . virtual_root
64+ }
65+
5966 pub fn as_mut_ptr ( & mut self ) -> * mut tsk_tree_t {
6067 self . inner . as_mut ( )
6168 }
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ impl<'treeseq> Tree<'treeseq> {
9696 pub fn samples_array ( & self ) -> Result < & [ NodeId ] , TskitError > {
9797 self . inner . samples_array ( )
9898 }
99+
100+ /// Return the virtual root of the tree.
101+ pub fn virtual_root ( & self ) -> NodeId {
102+ self . inner . virtual_root ( ) . into ( )
103+ }
99104}
100105
101106impl < ' ts > streaming_iterator:: StreamingIterator for Tree < ' ts > {
You can’t perform that action at this time.
0 commit comments