pub enum ExprNode {
Show 18 variants
RealConst(f64),
ComplexConst(Complex<f64>),
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(Complex<f64>)
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: Complex<f64>) -> ExprNode
pub fn from_folded_const(value: Complex<f64>) -> ExprNode
Creates the most compact constant-node representation for value.
Sourcepub fn const_value(&self) -> Option<Complex<f64>>
pub fn const_value(&self) -> Option<Complex<f64>>
Returns the node’s scalar constant value, if it is a constant.
Sourcepub fn children(&self) -> impl ExactSizeIterator + DoubleEndedIterator
pub fn children(&self) -> impl ExactSizeIterator + 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) -> ExprNode
pub fn map_children(&self, map: impl FnMut(ExprId) -> ExprId) -> ExprNode
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ExprNode
impl<'de> Deserialize<'de> for ExprNode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExprNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ExprNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ExprNode
impl Serialize for ExprNode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ExprNode
Auto Trait Implementations§
impl Freeze for ExprNode
impl RefUnwindSafe for ExprNode
impl Send for ExprNode
impl Sync for ExprNode
impl Unpin for ExprNode
impl UnsafeUnpin for ExprNode
impl UnwindSafe for ExprNode
Blanket Implementations§
impl<T> Allocation for T
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.