diff --git a/src/lib.rs b/src/lib.rs index f08ebd10c26f8cffeafcae89e3de8e9499371469..964976ea8e4c085b7b7a37316fdbce45c9c83ef0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,13 @@ +// Copyright 2018 Kevin Kaßelmann, David Mehren, Daniel Rose and Frederik Stehli. +// Licensed under the MIT license (http://opensource.org/licenses/MIT) +// This file may not be copied, modified, or distributed +// except according to those terms. + +//! Succinct Tree library with implementations for the succinct trees LOUDS, BP +//! and the Range Min Max data structure. LOUDS and BP use the Rank/Select data +//! structure from the Rust-Bio crate. Code examples can be found in the submodules. + + extern crate bio; #[macro_use] extern crate bv; diff --git a/src/trees/bp_tree.rs b/src/trees/bp_tree.rs index eb12b6e9c946af2ad2fe2176b0257f8cafbab1f9..6f49d24afc9bde68375b6c1a39105eb625bc2364 100644 --- a/src/trees/bp_tree.rs +++ b/src/trees/bp_tree.rs @@ -1,3 +1,30 @@ +// Copyright 2018 Kevin Kaßelmann. +// Licensed under the MIT license (http://opensource.org/licenses/MIT) +// This file may not be copied, modified, or distributed +// except according to those terms. + +//! BP succinct tree implementation based on Jacobson (1989), Munro and Raman (2001), +//! Arroyuelo et al. (2010) and Cordova and Navarro (2016). +//! +//! Example +//! +//! ``` +//! #[macro_use] +//! extern crate bv; +//! # extern crate fp_succinct_trees_1; +//! +//! # fn main() { +//! use bv::BitVec; +//! use bv::Bits; +//! use fp_succinct_trees_1::common::succinct_tree::SuccinctTree; +//! use fp_succinct_trees_1::trees::bp_tree::BPTree; +//! +//! let bitvec = bit_vec!(true, true, false, false); +//! let tree = BPTree::from_bitvec(bitvec.clone()).unwrap(); +//! assert!(tree.is_leaf(1).unwrap()); +//! # } +//! ``` + use bincode::{deserialize, serialize}; use bio::data_structures::rank_select::RankSelect; use bv::BitVec; diff --git a/src/trees/louds_tree.rs b/src/trees/louds_tree.rs index e2d974ee78a358321d270385a96e0aa63d84a2a6..ae469130ee1a94d2ce96e944a85c61150406f221 100644 --- a/src/trees/louds_tree.rs +++ b/src/trees/louds_tree.rs @@ -1,3 +1,29 @@ +// Copyright 2018 David Mehren. +// Licensed under the MIT license (http://opensource.org/licenses/MIT) +// This file may not be copied, modified, or distributed +// except according to those terms. + +//! LOUDS succinct tree implementation based on Jacobson (1989) and Arroyuelo et al. (2010) +//! +//! Example +//! +//! ``` +//! #[macro_use] +//! extern crate bv; +//! # extern crate fp_succinct_trees_1; +//! +//! # fn main() { +//! use bv::BitVec; +//! use bv::Bits; +//! use fp_succinct_trees_1::common::succinct_tree::SuccinctTree; +//! use fp_succinct_trees_1::trees::louds_tree::LOUDSTree; +//! +//! let bitvec = bit_vec![true, true, false, false]; +//! let tree = LOUDSTree::from_bitvec(bitvec.clone()).unwrap(); +//! assert!(tree.is_leaf(3).unwrap()); +//! # } +//! ``` + use bincode::{deserialize, serialize}; use bio::data_structures::rank_select::RankSelect; use bv::{BitVec, Bits};