[][src]Struct biodivine_lib_bdd::BddPointer

pub(crate) struct BddPointer(u32);

(internal) A type-safe index into the Bdd node array representation.

BDD pointers are an internal type-safe wrapper around indices into BDD arrays. Outside this crate, no one should know or care about their existence. Since we can't reasonably expect a BDD to be larger than 2^32 right now, the pointer is represented as u32 instead of usize, because usize can be 64-bits and pointers represent most of the memory consumed by our BDDs.

Implementations

impl BddPointer[src]

pub fn zero() -> BddPointer[src]

Make a new pointer to the 0 terminal node.

pub fn one() -> BddPointer[src]

Make a new pointer to the 1 terminal node.

pub fn is_zero(&self) -> bool[src]

Check if the pointer corresponds to the 0 terminal.

pub fn is_one(&self) -> bool[src]

Check if the pointer corresponds to the 1 terminal.

pub fn is_terminal(&self) -> bool[src]

Check if the pointer corresponds to the 0 or 1 terminal.

pub fn to_index(&self) -> usize[src]

Cast this pointer to standard usize index.

pub fn from_index(index: usize) -> BddPointer[src]

Create a pointer from an usize index.

pub fn from_bool(value: bool) -> BddPointer[src]

Convert a bool value to valid terminal BDD pointer.

pub fn as_bool(&self) -> Option<bool>[src]

If this pointer is a terminal, convert it to bool, otherwise return None.

pub fn flip_if_terminal(&mut self)[src]

If this pointer corresponds to a terminal node, flip it (switching 1 to 0 and vice versa).

pub fn to_le_bytes(&self) -> [u8; 4][src]

Convert to little endian bytes

pub fn from_le_bytes(bytes: [u8; 4]) -> BddPointer[src]

Read from little endian byte representation

Trait Implementations

impl Clone for BddPointer[src]

impl Copy for BddPointer[src]

impl Debug for BddPointer[src]

impl Display for BddPointer[src]

For display purposes, pointer is just a number.

impl Eq for BddPointer[src]

impl Hash for BddPointer[src]

impl Ord for BddPointer[src]

impl PartialEq<BddPointer> for BddPointer[src]

impl PartialOrd<BddPointer> for BddPointer[src]

impl StructuralEq for BddPointer[src]

impl StructuralPartialEq for BddPointer[src]

Auto Trait Implementations

impl RefUnwindSafe for BddPointer

impl Send for BddPointer

impl Sync for BddPointer

impl Unpin for BddPointer

impl UnwindSafe for BddPointer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.