Skip to main content

MarkedEdge

Struct MarkedEdge 

Source
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: DenseNodeId

Endpoint A node.

§b: DenseNodeId

Endpoint B node.

§at_a: Endpoint

Mark at A.

§at_b: Endpoint

Mark at B.

§middle: MiddleMark

LPCMCI middle mark (default MiddleMark::Empty outside LPCMCI search).

Implementations§

Source§

impl MarkedEdge

Source

pub const fn directed(from: DenseNodeId, to: DenseNodeId) -> Self

Directed edge from -> to (tail at from, arrow at to).

Source

pub fn undirected(a: DenseNodeId, b: DenseNodeId) -> Self

Undirected edge a — b (tail–tail). Canonicalizes so a.raw() <= b.raw().

Source

pub const fn is_dag_directed(self) -> bool

Whether this is a DAG-legal directed edge.

Source

pub const fn is_undirected(self) -> bool

Whether this is an undirected CPDAG edge (tail–tail).

Source

pub const fn is_bidirected(self) -> bool

Whether this is a bidirected ADMG edge (arrow–arrow).

Source

pub const fn is_conflict(self) -> bool

Whether this is a conflict edge (x-x, both endpoints Endpoint::Conflict).

Source

pub fn bidirected(a: DenseNodeId, b: DenseNodeId) -> Self

Bidirected edge a ↔ b. Canonicalizes so a.raw() <= b.raw().

Source

pub fn conflict(a: DenseNodeId, b: DenseNodeId) -> Self

Conflict edge a x-x b. Canonicalizes so a.raw() <= b.raw().

Source

pub const fn with_middle(self, middle: MiddleMark) -> Self

Same endpoints with a different middle mark.

Whether marks are legal for a CPDAG (directed, undirected, or x-x; no Circle).

Whether marks are legal for an ADMG (directed or bidirected; no Circle/Conflict).

Source

pub fn parent_child(self) -> Option<(DenseNodeId, DenseNodeId)>

Oriented parent -> child for a DAG directed edge.

Source

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

Source§

fn clone(&self) -> MarkedEdge

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MarkedEdge

Source§

impl Debug for MarkedEdge

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for MarkedEdge

Source§

impl Hash for MarkedEdge

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MarkedEdge

Source§

fn eq(&self, other: &MarkedEdge) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MarkedEdge

Auto Trait Implementations§

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.