pub struct PirGraph { /* private fields */ }Expand description
Arena-backed directed acyclic graph of probabilistic expressions.
Implementations§
Source§impl PirGraph
impl PirGraph
Sourcepub fn node(&self, id: PirNodeId) -> Option<&PirNode>
pub fn node(&self, id: PirNodeId) -> Option<&PirNode>
Returns a node by identifier, or None when the identifier is invalid.
Sourcepub fn const_true(&mut self) -> PirNodeId
pub fn const_true(&mut self) -> PirNodeId
Appends a true constant and returns its identifier.
Sourcepub fn const_false(&mut self) -> PirNodeId
pub fn const_false(&mut self) -> PirNodeId
Appends a false constant and returns its identifier.
Sourcepub fn lit(&mut self, leaf: LeafId) -> PirNodeId
pub fn lit(&mut self, leaf: LeafId) -> PirNodeId
Appends a positive leaf literal and returns its node identifier.
Sourcepub fn neg_lit(&mut self, leaf: LeafId) -> PirNodeId
pub fn neg_lit(&mut self, leaf: LeafId) -> PirNodeId
Appends a negated leaf literal and returns its node identifier.
Sourcepub fn and(&mut self, children: Vec<PirNodeId>) -> PirNodeId
pub fn and(&mut self, children: Vec<PirNodeId>) -> PirNodeId
Appends a conjunction and returns its node identifier.
Sourcepub fn or(&mut self, children: Vec<PirNodeId>) -> PirNodeId
pub fn or(&mut self, children: Vec<PirNodeId>) -> PirNodeId
Appends a disjunction and returns its node identifier.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PirGraph
impl RefUnwindSafe for PirGraph
impl Send for PirGraph
impl Sync for PirGraph
impl Unpin for PirGraph
impl UnsafeUnpin for PirGraph
impl UnwindSafe for PirGraph
Blanket Implementations§
impl<T> Allocation for T
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