Skip to main content

ExprNode

Enum ExprNode 

Source
pub enum ExprNode {
Show 18 variants RealConst(f64), ComplexConst(Complex64), ScalarParam(Parameter), EventScalar(Arc<str>), EventP4Component { name: Arc<str>, component: P4Component, }, Unary { op: UnaryOp, input: ExprId, }, Binary { op: BinaryOp, lhs: ExprId, rhs: ExprId, }, NaryAdd { terms: Vec<ExprId>, }, NaryMul { factors: Vec<ExprId>, }, Complex { re: ExprId, im: ExprId, }, Vector { elements: Vec<ExprId>, }, Matrix { rows: usize, cols: usize, elements: Vec<ExprId>, }, Component { input: ExprId, index: usize, }, MatrixElement { input: ExprId, row: usize, col: usize, }, MatMul { lhs: ExprId, rhs: ExprId, }, MatVec { matrix: ExprId, vector: ExprId, }, Dot { lhs: ExprId, rhs: ExprId, }, Solve { matrix: ExprId, rhs: ExprId, },
}
Expand description

Serialized node in a topologically ordered ExprGraph.

Variants§

§

RealConst(f64)

A real constant.

§

ComplexConst(Complex64)

A complex constant.

§

ScalarParam(Parameter)

A scalar fit parameter.

§

EventScalar(Arc<str>)

A named scalar event column.

§

EventP4Component

One component of a named event four-momentum.

Fields

§name: Arc<str>

Event column base name.

§component: P4Component

Requested four-momentum component.

§

Unary

A unary operation.

Fields

§op: UnaryOp

Operation to apply.

§input: ExprId

Input node.

§

Binary

A binary operation.

Fields

§op: BinaryOp

Operation to apply.

§lhs: ExprId

Left operand.

§rhs: ExprId

Right operand.

§

NaryAdd

A sum of zero or more terms.

Fields

§terms: Vec<ExprId>

Term nodes.

§

NaryMul

A product of zero or more factors.

Fields

§factors: Vec<ExprId>

Factor nodes.

§

Complex

A complex scalar assembled from real and imaginary expressions.

Fields

§re: ExprId

Real component.

§im: ExprId

Imaginary component.

§

Vector

A vector assembled from scalar elements.

Fields

§elements: Vec<ExprId>

Scalar element nodes.

§

Matrix

A row-major matrix assembled from scalar elements.

Fields

§rows: usize

Number of rows.

§cols: usize

Number of columns.

§elements: Vec<ExprId>

Row-major scalar elements.

§

Component

A vector component selection.

Fields

§input: ExprId

Vector input.

§index: usize

Zero-based component index.

§

MatrixElement

A matrix element selection.

Fields

§input: ExprId

Matrix input.

§row: usize

Zero-based row index.

§col: usize

Zero-based column index.

§

MatMul

Matrix-matrix multiplication.

Fields

§lhs: ExprId

Left matrix.

§rhs: ExprId

Right matrix.

§

MatVec

Matrix-vector multiplication.

Fields

§matrix: ExprId

Matrix operand.

§vector: ExprId

Vector operand.

§

Dot

Vector dot product.

Fields

§lhs: ExprId

Left vector.

§rhs: ExprId

Right vector.

§

Solve

Solution of a linear system.

Fields

§matrix: ExprId

Coefficient matrix.

§rhs: ExprId

Right-hand-side vector or matrix.

Implementations§

Source§

impl ExprNode

Source

pub fn from_folded_const(value: Complex64) -> Self

Creates the most compact constant-node representation for value.

Source

pub fn const_value(&self) -> Option<Complex64>

Returns the node’s scalar constant value, if it is a constant.

Source

pub fn is_zero(node: &ExprNode) -> bool

Returns whether node is the scalar constant zero.

Source

pub fn is_one(node: &ExprNode) -> bool

Returns whether node is the scalar constant one.

Source

pub fn child_ids(&self) -> Vec<ExprId>

Returns the identifiers of this node’s direct dependencies.

Trait Implementations§

Source§

impl Clone for ExprNode

Source§

fn clone(&self) -> ExprNode

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 Debug for ExprNode

Source§

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

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

impl<'de> Deserialize<'de> for ExprNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<Complex<f64>> for ExprNode

Source§

fn from(value: Complex64) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ExprNode

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ExprNode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ExprNode

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.