BwtBuilder

Struct BwtBuilder 

Source
pub struct BwtBuilder<'a> { /* private fields */ }
Expand description

BWT builder in small space.

Given a typical text, it runs in O(n log n loglog n) time and O(n) additional bits of space, where n is the length of the input string and the alphabet size is much smaller than n. See the book for more details.

§Requirements

This assumes that the smallest character appears only at the end of the text. Given an unexpected text, the behavior is undefined. If you want to verify the text, use verify_terminator.

§Examples

See the top page.

Implementations§

Source§

impl<'a> BwtBuilder<'a>

Source

pub fn new(text: &'a [u8]) -> Result<Self>

Creates a new builder.

§Arguments
§Errors

An error is returned if text is empty.

Source

pub const fn verbose(self, verbose: bool) -> Self

Sets the verbosity. If verbose is true, the progress is printed to stderr.

§Arguments
  • verbose - The verbosity.
§Default value

false

Source

pub fn build<W: Write>(&self, wrt: W) -> Result<()>

Builds the BWT and writes it to wrt.

§Arguments
  • wrt - The writer to write the BWT.
§Errors

An error is returned if wrt returns an error.

Auto Trait Implementations§

§

impl<'a> Freeze for BwtBuilder<'a>

§

impl<'a> RefUnwindSafe for BwtBuilder<'a>

§

impl<'a> Send for BwtBuilder<'a>

§

impl<'a> Sync for BwtBuilder<'a>

§

impl<'a> Unpin for BwtBuilder<'a>

§

impl<'a> UnwindSafe for BwtBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.