[][src]Trait fp_wavelet_trees::graph_wt::GraphWithWT

pub trait GraphWithWT {
    fn neighbor(&mut self, node: u64, nth_neighbor: u64) -> Option<u64>;
fn reverse_neigbor(
        &mut self,
        node: u64,
        nth_reverse_neighbor: u64
    ) -> Option<u64>; }

Required methods

fn neighbor(&mut self, node: u64, nth_neighbor: u64) -> Option<u64>

Creates the bitmap and the WaveletTree from the underlying list (if not done yet) returns the 'nth_neighbor' of the 'node' or None if there is None

fn reverse_neigbor(
    &mut self,
    node: u64,
    nth_reverse_neighbor: u64
) -> Option<u64>

Creates the bitmap and the WaveletTree from the underlying list (if not done yet) returns the 'nth_reverse_neighbor' of the 'node' or None if there is None

Loading content...

Implementors

impl GraphWithWT for WaveletTreeGraph[src]

fn neighbor(&mut self, node: u64, nth_neighbor: u64) -> Option<u64>[src]

Returns the nth-neigbor of a node in a graph stored in a WaveletTree

Arguments

  • node The index of the node in the graph whose neigbor is to be searched
  • nth_neighbor The nth-neigbor (by the order of insertion)

Example

use fp_wavelet_trees::graph_wt::*;
let mut w_builder = fp_wavelet_trees::graph_wt::WTGraphBuilder::with_capacities(6);
w_builder.add_edge(0, 1).expect("Could not add edge to graph");
let mut graph = w_builder.to_graph();
assert_eq!(Some(1), graph.neighbor(0, 1));

fn reverse_neigbor(
    &mut self,
    node: u64,
    nth_reverse_neighbor: u64
) -> Option<u64>
[src]

Returns the nth-reverse-neigbor of a node in a graph stored in a WaveletTree

Arguments

  • node The index of the node in the graph whose reverse-neigbor is to be searched
  • nth_reverse_neighbor The nth-reverse-neigbor (by the order of insertion)

Example

use fp_wavelet_trees::graph_wt::*;
let mut w_builder = fp_wavelet_trees::graph_wt::WTGraphBuilder::with_capacities(6);
w_builder.add_edge(0, 1).expect("Could not add edge to graph");
let mut graph = w_builder.to_graph();
assert_eq!(Some(0), graph.reverse_neigbor(1, 1));
Loading content...