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
impl GraphVertices
sourcepub fn new(bdd: Bdd, context: &SymbolicContext) -> Self
pub fn new(bdd: Bdd, context: &SymbolicContext) -> Self
Create a new set of vertices using the given Bdd
and a symbolic context
.
sourcepub fn approx_cardinality(&self) -> f64
pub fn approx_cardinality(&self) -> f64
Approximate size of this set (error grows for large sets).
sourcepub fn exact_cardinality(&self) -> BigInt
pub fn exact_cardinality(&self) -> BigInt
Compute exact BigInt
cardinality of this set.
sourcepub fn pick_singleton(&self) -> GraphVertices
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.
sourcepub fn materialize(&self) -> IterableVertices
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.
sourcepub fn symbolic_size(&self) -> usize
pub fn symbolic_size(&self) -> usize
Amount of storage used for this symbolic set.
sourcepub fn to_dot_string(&self, context: &SymbolicContext) -> String
pub fn to_dot_string(&self, context: &SymbolicContext) -> String
Convert this set to a .dot
graph.
sourcepub fn is_subspace(&self) -> bool
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.
sourcepub fn is_singleton(&self) -> bool
pub fn is_singleton(&self) -> bool
Return true
if the set represents a single vertex.
sourcepub fn restrict_network_variable(
&self,
variable: VariableId,
value: bool
) -> Self
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.
sourcepub fn fix_network_variable(&self, variable: VariableId, value: bool) -> Self
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.
sourcepub fn raw_projection(&self, eliminate: &[BddVariable]) -> RawProjection
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.
sourcepub fn state_projection(&self, variables: &[VariableId]) -> StateProjection
pub fn state_projection(&self, variables: &[VariableId]) -> StateProjection
Create an iterable symbolic projection which only retains the specified network variables.
sourcepub fn iter(&self) -> GraphVertexIterator ⓘ
pub fn iter(&self) -> GraphVertexIterator ⓘ
Create an iterator equivalent to GraphVertices::into_iter, but without destroying the original object.
sourcepub fn to_singleton_spaces(&self, ctx: &SymbolicSpaceContext) -> NetworkSpaces
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
impl Clone for GraphVertices
source§fn clone(&self) -> GraphVertices
fn clone(&self) -> GraphVertices
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GraphVertices
impl Debug for GraphVertices
source§impl Hash for GraphVertices
impl Hash for GraphVertices
source§impl IntoIterator for GraphVertices
impl IntoIterator for GraphVertices
source§impl PartialEq for GraphVertices
impl PartialEq for GraphVertices
source§fn eq(&self, other: &GraphVertices) -> bool
fn eq(&self, other: &GraphVertices) -> bool
self
and other
values to be equal, and is used
by ==
.