Struct biodivine_lib_param_bn::Space
source · pub struct Space(/* private fields */);
Expand description
Space
represents a hypercube (multi-dimensional rectangle) in the Boolean state space.
Keep in mind that there is no way of representing an empty hypercube at the moment. So any API
that can take/return an empty set has to use Option<Space>
or something similar.
Implementations§
source§impl Space
impl Space
sourcepub fn new(network: &BooleanNetwork) -> Space
pub fn new(network: &BooleanNetwork) -> Space
Create a new space tracking the variables of the given network, where all values are
initially assigned as Any
.
pub fn new_raw(num_vars: usize) -> Space
sourcepub fn from_values(
bn: &BooleanNetwork,
values: Vec<(VariableId, bool)>
) -> Space
pub fn from_values( bn: &BooleanNetwork, values: Vec<(VariableId, bool)> ) -> Space
Convert a list of values (such as used by SymbolicAsyncGraph
) into a proper “space” object.
sourcepub fn to_values(&self) -> Vec<(VariableId, bool)>
pub fn to_values(&self) -> Vec<(VariableId, bool)>
Convert a space into a list of values compatible with the normal SymbolicAsyncGraph
.
sourcepub fn intersect(&self, other: &Space) -> Option<Space>
pub fn intersect(&self, other: &Space) -> Option<Space>
Try to intersect two spaces. If the result is empty, returns None
.
sourcepub fn count_fixed(&self) -> usize
pub fn count_fixed(&self) -> usize
Count the number of 0
and 1
in this space.
Trait Implementations§
source§impl Index<VariableId> for Space
impl Index<VariableId> for Space
§type Output = ExtendedBoolean
type Output = ExtendedBoolean
The returned type after indexing.
source§impl IndexMut<VariableId> for Space
impl IndexMut<VariableId> for Space
source§impl PartialEq for Space
impl PartialEq for Space
source§impl PartialOrd for Space
impl PartialOrd for Space
1.0.0 · source§fn 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 moreimpl Eq for Space
impl StructuralPartialEq for Space
Auto Trait Implementations§
impl Freeze for Space
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnwindSafe for Space
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more