pub struct GraphVertices { /* private fields */ }
Expand description

Symbolic representation of a vertex set.

Implementation contains all symbolic variables, but parameter variables are unconstrained.

Implementations§

source§

impl GraphVertices

source

pub fn new(bdd: Bdd, context: &SymbolicContext) -> Self

Create a new set of vertices using the given Bdd and a symbolic context.

source

pub fn copy(&self, bdd: Bdd) -> Self

Copy the context of this vertex set, but using a new bdd.

source

pub fn into_bdd(self) -> Bdd

Convert this vertex set into a raw Bdd.

source

pub fn as_bdd(&self) -> &Bdd

View this vertex set as a raw Bdd.

source

pub fn approx_cardinality(&self) -> f64

Approximate size of this set (error grows for large sets).

source

pub fn exact_cardinality(&self) -> BigInt

Compute exact BigInt cardinality of this set.

source

pub fn pick_singleton(&self) -> GraphVertices

Pick one vertex from this set and return it as a singleton.

If the set is empty, return empty set.

source

pub fn materialize(&self) -> IterableVertices

Create an iterable view of this vertex set.

Note that sadly you have to use set.materialize().iter() to actually iterate over the vertices, since we are not moving our the value of this set.

source

pub fn symbolic_size(&self) -> usize

Amount of storage used for this symbolic set.

source

pub fn to_dot_string(&self, context: &SymbolicContext) -> String

Convert this set to a .dot graph.

source

pub fn is_subspace(&self) -> bool

Return true if the set can be described by a single conjunction of literals. That is, the set is a hypercube in the $\mathbb{B}^n$ space.

source

pub fn is_singleton(&self) -> bool

Return true if the set represents a single vertex.

source

pub fn restrict_network_variable( &self, variable: VariableId, value: bool ) -> Self

Compute a set where the value of the given variable is restricted.

Restriction operation takes only the elements where variable=value, but then makes the result independent on this variable by erasing it. This is useful when you are computing various operations on subspaces.

source

pub fn fix_network_variable(&self, variable: VariableId, value: bool) -> Self

Compute a subset of this set where the given network variable is always fixed to the given value.

source

pub fn raw_projection(&self, eliminate: &[BddVariable]) -> RawProjection

Perform a “raw projection” which eliminates the given symbolic variables from this set.

Technically, you can supply any BddVariable, but the underlying Bdd of this set should only depend on state variables.

source

pub fn state_projection(&self, variables: &[VariableId]) -> StateProjection

Create an iterable symbolic projection which only retains the specified network variables.

source

pub fn iter(&self) -> GraphVertexIterator

Create an iterator equivalent to GraphVertices::into_iter, but without destroying the original object.

source

pub fn to_singleton_spaces(&self, ctx: &SymbolicSpaceContext) -> NetworkSpaces

Represent this set of vertices as a set of singleton subspaces instead.

Trait Implementations§

source§

impl Clone for GraphVertices

source§

fn clone(&self) -> GraphVertices

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GraphVertices

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for GraphVertices

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IntoIterator for GraphVertices

§

type Item = ArrayBitVector

The type of the elements being iterated over.
§

type IntoIter = GraphVertexIterator

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for GraphVertices

source§

fn eq(&self, other: &GraphVertices) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for GraphVertices

source§

impl StructuralPartialEq for GraphVertices

Auto Trait Implementations§

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> Set for T
where T: BddSet + Clone,

source§

fn union(&self, other: &T) -> T

source§

fn intersect(&self, other: &T) -> T

source§

fn minus(&self, other: &T) -> T

source§

fn is_empty(&self) -> bool

source§

fn is_subset(&self, other: &T) -> bool

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V