pub struct CompiledCausalModel {
pub node_order: Arc<[DenseNodeId]>,
pub parent_gathers: Arc<[ParentGatherPlan]>,
pub mechanisms: CompiledMechanismStore,
pub output_layout: ModelOutputLayout,
pub graph: Arc<Dag>,
/* private fields */
}Expand description
Immutable compiled causal model plan.
Fields§
§node_order: Arc<[DenseNodeId]>Topological dense node order.
parent_gathers: Arc<[ParentGatherPlan]>Parent gather plans aligned with node_order.
mechanisms: CompiledMechanismStoreMechanisms per dense node.
output_layout: ModelOutputLayoutOutput layout.
graph: Arc<Dag>Source DAG (shared; never cloned per intervention).
Implementations§
Source§impl CompiledCausalModel
impl CompiledCausalModel
Sourcepub fn compile(graph: Dag) -> Result<Self, ModelError>
pub fn compile(graph: Dag) -> Result<Self, ModelError>
Compile a static DAG into a topological execution plan.
Mechanisms start vacant; assignment/fit fills them .
§Errors
Cyclic graph or non-static nodes.
Sourcepub fn dense_of(&self, var: VariableId) -> Option<DenseNodeId>
pub fn dense_of(&self, var: VariableId) -> Option<DenseNodeId>
Dense id for a variable, if present (O(1) via the compile-time map).
Sourcepub fn with_mechanisms(self, mechanisms: CompiledMechanismStore) -> Self
pub fn with_mechanisms(self, mechanisms: CompiledMechanismStore) -> Self
Replace mechanism store (fit / assignment).
Sourcepub fn gather_for(&self, child: DenseNodeId) -> Option<&ParentGatherPlan>
pub fn gather_for(&self, child: DenseNodeId) -> Option<&ParentGatherPlan>
Gather plan for a child dense id (O(1) via the compile-time index).
Trait Implementations§
Source§impl Clone for CompiledCausalModel
impl Clone for CompiledCausalModel
Source§fn clone(&self) -> CompiledCausalModel
fn clone(&self) -> CompiledCausalModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CompiledCausalModel
impl !UnwindSafe for CompiledCausalModel
impl Freeze for CompiledCausalModel
impl Send for CompiledCausalModel
impl Sync for CompiledCausalModel
impl Unpin for CompiledCausalModel
impl UnsafeUnpin for CompiledCausalModel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> ForeignBufferOwner for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more