Function tskit::bindings::tsk_tree_seek

source ·
pub unsafe extern "C" fn tsk_tree_seek(
    self_: *mut tsk_tree_t,
    position: f64,
    options: tsk_flags_t
) -> c_int
Expand description

@brief Seek to a particular position on the genome.

@rst Set the state of this tree to reflect the tree in parent tree sequence covering the specified position. That is, on success we will have tree.interval.left <= position and we will have position < tree.interval.right.

Seeking to a position currently covered by the tree is a constant time operation.

.. warning:: The current implementation of seek does not provide efficient random access to arbitrary positions along the genome. However, sequentially seeking in either direction is as efficient as calling :c:func:tsk_tree_next or :c:func:tsk_tree_prev directly. @endrst

@param self A pointer to an initialised tsk_tree_t object. @param position The position in genome coordinates @param options Seek options. Currently unused. Set to 0 for compatibility with future versions of tskit. @return Return 0 on success or a negative value on failure.