Skip to main content

Xgcf

Struct Xgcf 

Source
pub struct Xgcf {
    pub node_type: Vec<XgcfNodeType>,
    pub child_offsets: Vec<u32>,
    pub child_indices: Vec<u32>,
    pub lit: Vec<i32>,
    pub decision_var: Vec<u32>,
    pub decision_child_false: Vec<u32>,
    pub decision_child_true: Vec<u32>,
    pub roots: Vec<u32>,
    pub level_offsets: Vec<u32>,
    pub level_nodes: Vec<u32>,
}

Fields§

§node_type: Vec<XgcfNodeType>§child_offsets: Vec<u32>§child_indices: Vec<u32>§lit: Vec<i32>§decision_var: Vec<u32>§decision_child_false: Vec<u32>§decision_child_true: Vec<u32>§roots: Vec<u32>§level_offsets: Vec<u32>§level_nodes: Vec<u32>

Implementations§

Source§

impl Xgcf

Source

pub fn from_ddnnf(ddnnf: &DecisionDnnf) -> Result<Self>

Source

pub fn smooth_random_vars(&self, is_random_var: &[bool]) -> Result<Self>

Return a semantically equivalent circuit that is smooth with respect to the subset of variables marked as random in is_random_var.

Smoothness guarantees that, for any OR/DECISION node, all branches mention the same set of random variables. This makes WMC evaluation and gradients correct even when evidence/queries force random variables in non-smooth Decision-DNNF outputs.

Source

pub fn eval_log_wmc<F>(&self, var_log_weights: F) -> Result<f64>
where F: Fn(u32) -> (f64, f64),

Source

pub fn eval_log_wmc_and_grads( &self, var_log_weights: &[(f64, f64)], ) -> Result<(f64, Vec<f64>, Vec<f64>)>

Trait Implementations§

Source§

impl Clone for Xgcf

Source§

fn clone(&self) -> Xgcf

Returns a duplicate 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 Xgcf

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Xgcf

§

impl RefUnwindSafe for Xgcf

§

impl Send for Xgcf

§

impl Sync for Xgcf

§

impl Unpin for Xgcf

§

impl UnsafeUnpin for Xgcf

§

impl UnwindSafe for Xgcf

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

Source§

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

Source§

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

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,