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
component: P4ComponentRequested four-momentum component.
Unary
A unary operation.
Binary
A binary operation.
NaryAdd
A sum of zero or more terms.
NaryMul
A product of zero or more factors.
Complex
A complex scalar assembled from real and imaginary expressions.
Vector
A vector assembled from scalar elements.
Matrix
A row-major matrix assembled from scalar elements.
Fields
Component
A vector component selection.
MatrixElement
A matrix element selection.
Fields
MatMul
Matrix-matrix multiplication.
MatVec
Matrix-vector multiplication.
Dot
Vector dot product.
Solve
Solution of a linear system.
Implementations§
Source§impl ExprNode
impl ExprNode
Sourcepub fn semantics(&self, children: &[ExprNodeSemantics]) -> ExprNodeSemantics
pub fn semantics(&self, children: &[ExprNodeSemantics]) -> ExprNodeSemantics
Infers this node’s context-free value semantics from the already computed semantics of earlier nodes in the expression graph.
Sourcepub fn dependency_kind(&self) -> ExprDependencyKind
pub fn dependency_kind(&self) -> ExprDependencyKind
Returns the intrinsic source of this node’s evaluation dependencies.
Sourcepub fn from_folded_const(value: Complex64) -> Self
pub fn from_folded_const(value: Complex64) -> Self
Creates the most compact constant-node representation for value.
Sourcepub fn const_value(&self) -> Option<Complex64>
pub fn const_value(&self) -> Option<Complex64>
Returns the node’s scalar constant value, if it is a constant.
Sourcepub fn children(
&self,
) -> impl ExactSizeIterator<Item = ExprId> + DoubleEndedIterator + '_
pub fn children( &self, ) -> impl ExactSizeIterator<Item = ExprId> + DoubleEndedIterator + '_
Iterates over this node’s direct dependencies in semantic operand order.
The iterator borrows the node and does not allocate. Binary operands are returned left-to-right, and vector, matrix, sum, and product children retain their stored order.
Sourcepub fn child_ids(&self) -> Vec<ExprId>
pub fn child_ids(&self) -> Vec<ExprId>
Returns the identifiers of this node’s direct dependencies.
This compatibility helper collects Self::children. Prefer the
borrowed iterator when an owned vector is not required.
Sourcepub fn map_children(&self, map: impl FnMut(ExprId) -> ExprId) -> Self
pub fn map_children(&self, map: impl FnMut(ExprId) -> ExprId) -> Self
Returns a copy of this node with each direct dependency transformed.
Children are passed to map in the same semantic order as
Self::children. Non-child fields are preserved exactly.