Struct biodivine_lib_bdd::BddPointer
source · [−]pub(crate) struct BddPointer(pub(crate) u32);
Expand description
(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.
Tuple Fields
0: u32
Implementations
sourceimpl BddPointer
impl BddPointer
sourcepub fn zero() -> BddPointer
pub fn zero() -> BddPointer
Make a new pointer to the 0
terminal node.
sourcepub fn one() -> BddPointer
pub fn one() -> BddPointer
Make a new pointer to the 1
terminal node.
sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if the pointer corresponds to the 0
or 1
terminal.
sourcepub fn from_index(index: usize) -> BddPointer
pub fn from_index(index: usize) -> BddPointer
Create a pointer from an usize index.
sourcepub fn from_bool(value: bool) -> BddPointer
pub fn from_bool(value: bool) -> BddPointer
Convert a bool
value to valid terminal BDD pointer.
sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
If this pointer is a terminal, convert it to bool
, otherwise return None
.
sourcepub fn flip_if_terminal(&mut self)
pub fn flip_if_terminal(&mut self)
If this pointer corresponds to a terminal node, flip it (switching 1
to 0
and
vice versa).
sourcepub fn to_le_bytes(self) -> [u8; 4]
pub fn to_le_bytes(self) -> [u8; 4]
Convert to little endian bytes
sourcepub fn from_le_bytes(bytes: [u8; 4]) -> BddPointer
pub fn from_le_bytes(bytes: [u8; 4]) -> BddPointer
Read from little endian byte representation
Trait Implementations
sourceimpl Clone for BddPointer
impl Clone for BddPointer
sourcefn clone(&self) -> BddPointer
fn clone(&self) -> BddPointer
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BddPointer
impl Debug for BddPointer
sourceimpl Display for BddPointer
impl Display for BddPointer
For display purposes, pointer is just a number.
sourceimpl Hash for BddPointer
impl Hash for BddPointer
sourceimpl Ord for BddPointer
impl Ord for BddPointer
sourceimpl PartialEq<BddPointer> for BddPointer
impl PartialEq<BddPointer> for BddPointer
sourcefn eq(&self, other: &BddPointer) -> bool
fn eq(&self, other: &BddPointer) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BddPointer) -> bool
fn ne(&self, other: &BddPointer) -> bool
This method tests for !=
.
sourceimpl PartialOrd<BddPointer> for BddPointer
impl PartialOrd<BddPointer> for BddPointer
sourcefn partial_cmp(&self, other: &BddPointer) -> Option<Ordering>
fn partial_cmp(&self, other: &BddPointer) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for BddPointer
impl Eq for BddPointer
impl StructuralEq for BddPointer
impl StructuralPartialEq for BddPointer
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more