Struct tskit::bindings::tsk_tree_t [−][src]
@brief A single tree in a tree sequence.
@rst
A tsk_tree_t
object has two basic functions:
- Represent the state of a single tree in a tree sequence;
- Provide methods to transform this state into different trees in the sequence.
The state of a single tree in the tree sequence is represented using the
quintuply linked encoding: please see the
:ref:data model <sec_data_model_tree_structure>
section for details on
how this works. The left-to-right ordering of nodes in this encoding
is arbitrary, and may change depending on the order in which trees are
accessed within the sequence. Please see the
:ref:sec_c_api_examples_tree_traversals
examples for recommended
usage.
On initialisation, a tree is in a “null” state: each sample is a
root and there are no edges. We must call one of the ‘seeking’ methods
to make the state of the tree object correspond to a particular tree
in the sequence. Please see the
:ref:sec_c_api_examples_tree_iteration
examples for recommended
usage.
@endrst
Fields
tree_sequence: *const tsk_treeseq_t
@brief The parent tree sequence.
left_root: tsk_id_t
@brief The leftmost root in the tree. Roots are siblings, and other roots can be found using right_sib.
parent: *mut tsk_id_t
@brief The parent of node u is parent[u]. Equal to TSK_NULL if node u is a root or is not a node in the current tree.
left_child: *mut tsk_id_t
@brief The leftmost child of node u is left_child[u]. Equal to TSK_NULL if node u is a leaf or is not a node in the current tree.
right_child: *mut tsk_id_t
@brief The rightmost child of node u is right_child[u]. Equal to TSK_NULL if node u is a leaf or is not a node in the current tree.
left_sib: *mut tsk_id_t
@brief The sibling to the left of node u is left_sib[u]. Equal to TSK_NULL if node u has no siblings to its left.
right_sib: *mut tsk_id_t
@brief The sibling to the right of node u is right_sib[u]. Equal to TSK_NULL if node u has no siblings to its right.
num_nodes: tsk_size_t
options: tsk_flags_t
root_threshold: tsk_size_t
samples: *const tsk_id_t
left: f64
right: f64
index: tsk_id_t
num_samples: *mut tsk_id_t
num_tracked_samples: *mut tsk_id_t
marked: *mut u8
mark: u8
left_sample: *mut tsk_id_t
right_sample: *mut tsk_id_t
next_sample: *mut tsk_id_t
sites: *const tsk_site_t
sites_length: tsk_size_t
direction: c_int
left_index: tsk_id_t
right_index: tsk_id_t
Trait Implementations
impl Clone for tsk_tree_t
[src]
fn clone(&self) -> tsk_tree_t
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for tsk_tree_t
[src]
impl Debug for tsk_tree_t
[src]
impl TskitTypeAccess<tsk_tree_t> for Tree
[src]
fn as_ptr(&self) -> *const tsk_tree_t
[src]
fn as_mut_ptr(&mut self) -> *mut tsk_tree_t
[src]
Auto Trait Implementations
impl RefUnwindSafe for tsk_tree_t
impl !Send for tsk_tree_t
impl !Sync for tsk_tree_t
impl Unpin for tsk_tree_t
impl UnwindSafe for tsk_tree_t
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,