pub struct ExpressionComplexity {Show 25 fields
pub additions: usize,
pub subtractions: usize,
pub multiplications: usize,
pub divisions: usize,
pub powers: usize,
pub exponentials: usize,
pub logarithms: usize,
pub square_roots: usize,
pub absolute_values: usize,
pub negations: usize,
pub comparisons: usize,
pub logical_ands: usize,
pub logical_ors: usize,
pub logical_nots: usize,
pub existential_quantifiers: usize,
pub universal_quantifiers: usize,
pub conditionals: usize,
pub predicates: usize,
pub constants: usize,
pub variables: usize,
pub min_operations: usize,
pub max_operations: usize,
pub max_depth: usize,
pub unique_variables: usize,
pub unique_predicates: usize,
}Expand description
Detailed complexity analysis of an expression.
Fields§
§additions: usizeNumber of addition operations
subtractions: usizeNumber of subtraction operations
multiplications: usizeNumber of multiplication operations
divisions: usizeNumber of division operations
powers: usizeNumber of power operations
exponentials: usizeNumber of exponential operations
logarithms: usizeNumber of logarithm operations
square_roots: usizeNumber of square root operations
absolute_values: usizeNumber of absolute value operations
negations: usizeNumber of negation operations
comparisons: usizeNumber of comparison operations
logical_ands: usizeNumber of logical AND operations
logical_ors: usizeNumber of logical OR operations
logical_nots: usizeNumber of logical NOT operations
existential_quantifiers: usizeNumber of existential quantifiers
universal_quantifiers: usizeNumber of universal quantifiers
conditionals: usizeNumber of conditional expressions
predicates: usizeNumber of predicate applications
constants: usizeNumber of constants
variables: usizeNumber of variables
min_operations: usizeNumber of min operations
max_operations: usizeNumber of max operations
max_depth: usizeMaximum nesting depth
unique_variables: usizeNumber of unique variable names
unique_predicates: usizeNumber of unique predicate names
Implementations§
Source§impl ExpressionComplexity
impl ExpressionComplexity
Sourcepub fn arithmetic_operations(&self) -> usize
pub fn arithmetic_operations(&self) -> usize
Get total number of arithmetic operations.
Sourcepub fn logical_operations(&self) -> usize
pub fn logical_operations(&self) -> usize
Get total number of logical operations.
Sourcepub fn total_operations(&self) -> usize
pub fn total_operations(&self) -> usize
Get total number of operations.
Sourcepub fn total_cost(&self) -> f64
pub fn total_cost(&self) -> f64
Calculate total weighted cost using default weights.
Sourcepub fn total_cost_with_weights(&self, weights: &CostWeights) -> f64
pub fn total_cost_with_weights(&self, weights: &CostWeights) -> f64
Calculate total weighted cost using custom weights.
Sourcepub fn leaf_count(&self) -> usize
pub fn leaf_count(&self) -> usize
Get the number of leaf nodes (constants, variables, predicates).
Sourcepub fn cse_potential(&self) -> bool
pub fn cse_potential(&self) -> bool
Estimate if this expression would benefit from CSE.
Sourcepub fn strength_reduction_potential(&self) -> bool
pub fn strength_reduction_potential(&self) -> bool
Estimate if this expression would benefit from strength reduction.
Sourcepub fn complexity_level(&self) -> &'static str
pub fn complexity_level(&self) -> &'static str
Estimate relative complexity as a string descriptor.
Trait Implementations§
Source§impl Clone for ExpressionComplexity
impl Clone for ExpressionComplexity
Source§fn clone(&self) -> ExpressionComplexity
fn clone(&self) -> ExpressionComplexity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more