pub struct MarkedEdge {
pub a: DenseNodeId,
pub b: DenseNodeId,
pub at_a: Endpoint,
pub at_b: Endpoint,
pub middle: MiddleMark,
}Expand description
Directed marked edge between dense nodes.
Fields§
§a: DenseNodeIdEndpoint A node.
b: DenseNodeIdEndpoint B node.
at_a: EndpointMark at A.
at_b: EndpointMark at B.
middle: MiddleMarkLPCMCI middle mark (default MiddleMark::Empty outside LPCMCI search).
Implementations§
Source§impl MarkedEdge
impl MarkedEdge
Sourcepub const fn directed(from: DenseNodeId, to: DenseNodeId) -> Self
pub const fn directed(from: DenseNodeId, to: DenseNodeId) -> Self
Directed edge from -> to (tail at from, arrow at to).
Sourcepub fn undirected(a: DenseNodeId, b: DenseNodeId) -> Self
pub fn undirected(a: DenseNodeId, b: DenseNodeId) -> Self
Undirected edge a — b (tail–tail). Canonicalizes so a.raw() <= b.raw().
Sourcepub const fn is_dag_directed(self) -> bool
pub const fn is_dag_directed(self) -> bool
Whether this is a DAG-legal directed edge.
Sourcepub const fn is_undirected(self) -> bool
pub const fn is_undirected(self) -> bool
Whether this is an undirected CPDAG edge (tail–tail).
Sourcepub const fn is_bidirected(self) -> bool
pub const fn is_bidirected(self) -> bool
Whether this is a bidirected ADMG edge (arrow–arrow).
Sourcepub const fn is_conflict(self) -> bool
pub const fn is_conflict(self) -> bool
Whether this is a conflict edge (x-x, both endpoints Endpoint::Conflict).
Sourcepub fn bidirected(a: DenseNodeId, b: DenseNodeId) -> Self
pub fn bidirected(a: DenseNodeId, b: DenseNodeId) -> Self
Bidirected edge a ↔ b. Canonicalizes so a.raw() <= b.raw().
Sourcepub fn conflict(a: DenseNodeId, b: DenseNodeId) -> Self
pub fn conflict(a: DenseNodeId, b: DenseNodeId) -> Self
Conflict edge a x-x b. Canonicalizes so a.raw() <= b.raw().
Sourcepub const fn with_middle(self, middle: MiddleMark) -> Self
pub const fn with_middle(self, middle: MiddleMark) -> Self
Same endpoints with a different middle mark.
Sourcepub const fn is_cpdag_legal(self) -> bool
pub const fn is_cpdag_legal(self) -> bool
Whether marks are legal for a CPDAG (directed, undirected, or x-x; no Circle).
Sourcepub const fn is_admg_legal(self) -> bool
pub const fn is_admg_legal(self) -> bool
Whether marks are legal for an ADMG (directed or bidirected; no Circle/Conflict).
Sourcepub fn parent_child(self) -> Option<(DenseNodeId, DenseNodeId)>
pub fn parent_child(self) -> Option<(DenseNodeId, DenseNodeId)>
Oriented parent -> child for a DAG directed edge.
Sourcepub fn causal_arrow_direction(self) -> Option<(DenseNodeId, DenseNodeId)>
pub fn causal_arrow_direction(self) -> Option<(DenseNodeId, DenseNodeId)>
Source → arrowhead for a definite or partially directed edge.
Tail→Arrow and Circle→Arrow both place a definite arrowhead at the
child. Bidirected, undirected, and conflict marks return None.
Trait Implementations§
Source§impl Clone for MarkedEdge
impl Clone for MarkedEdge
Source§fn clone(&self) -> MarkedEdge
fn clone(&self) -> MarkedEdge
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more