pub enum Expr {
Input {
index: usize,
is_real: bool,
},
Const(f64),
Add(Box<Self>, Box<Self>),
Sub(Box<Self>, Box<Self>),
Mul(Box<Self>, Box<Self>),
Neg(Box<Self>),
Temp(String),
}Expand description
A symbolic expression representing FFT operations.
Variants§
Input
Input variable: x[index].re or x[index].im
Const(f64)
Constant value
Add(Box<Self>, Box<Self>)
Addition
Sub(Box<Self>, Box<Self>)
Subtraction
Mul(Box<Self>, Box<Self>)
Multiplication
Neg(Box<Self>)
Negation
Temp(String)
Named temporary (result of CSE)
Implementations§
Source§impl Expr
impl Expr
Sourcepub const fn const_value(&self) -> Option<f64>
pub const fn const_value(&self) -> Option<f64>
Get constant value if this is a constant.
Sourcepub fn structural_hash(&self) -> u64
pub fn structural_hash(&self) -> u64
Hash the expression for CSE.
Sourcepub fn collect_temp_refs(&self, refs: &mut HashSet<String>)
pub fn collect_temp_refs(&self, refs: &mut HashSet<String>)
Collect all Temp variable names referenced in this expression.
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
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
Mutably borrows from an owned value. Read more