pub enum SetReduceExpression {
Constant(Set),
Table1D(SetReduceOperator, usize, usize, Box<ArgumentExpression>),
Table2D(SetReduceOperator, usize, usize, Box<ArgumentExpression>, Box<ArgumentExpression>),
Table3D(SetReduceOperator, usize, usize, Box<ArgumentExpression>, Box<ArgumentExpression>, Box<ArgumentExpression>),
Table(SetReduceOperator, usize, usize, Vec<ArgumentExpression>),
}Expand description
Expression performing a reduce operation on a tables of sets.
Variants§
Constant(Set)
Constant.
Table1D(SetReduceOperator, usize, usize, Box<ArgumentExpression>)
Reduce operation over a 1D table.
Table2D(SetReduceOperator, usize, usize, Box<ArgumentExpression>, Box<ArgumentExpression>)
Reduce operation over a 2D table.
Table3D(SetReduceOperator, usize, usize, Box<ArgumentExpression>, Box<ArgumentExpression>, Box<ArgumentExpression>)
Reduce operation over a 3D table.
Table(SetReduceOperator, usize, usize, Vec<ArgumentExpression>)
Reduce operation over a table.
Implementations§
Source§impl SetReduceExpression
impl SetReduceExpression
Sourcepub fn eval<U: StateInterface>(
&self,
state: &U,
function_cache: &mut StateFunctionCache,
state_functions: &StateFunctions,
registry: &TableRegistry,
) -> Set
pub fn eval<U: StateInterface>( &self, state: &U, function_cache: &mut StateFunctionCache, state_functions: &StateFunctions, registry: &TableRegistry, ) -> Set
Returns the evaluation result.
§Panics
Panics if the cost of the transitioned state is used or an empty set or vector is passed to a reduce operation or a min/max reduce operation is performed on an empty set or vector.
Sourcepub fn simplify(&self, registry: &TableRegistry) -> Self
pub fn simplify(&self, registry: &TableRegistry) -> Self
Returns a simplified version by precomputation.
§Panics
Panics if a min/max reduce operation is performed on an empty set or vector.
Trait Implementations§
Source§impl CheckExpression<SetReduceExpression> for Model
impl CheckExpression<SetReduceExpression> for Model
Source§fn check_expression(
&self,
expression: &SetReduceExpression,
allow_cost: bool,
) -> Result<(), ModelErr>
fn check_expression( &self, expression: &SetReduceExpression, allow_cost: bool, ) -> Result<(), ModelErr>
Checks if an expression is valid. Read more
Source§impl Clone for SetReduceExpression
impl Clone for SetReduceExpression
Source§fn clone(&self) -> SetReduceExpression
fn clone(&self) -> SetReduceExpression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SetReduceExpression
impl Debug for SetReduceExpression
Source§impl PartialEq for SetReduceExpression
impl PartialEq for SetReduceExpression
impl StructuralPartialEq for SetReduceExpression
Auto Trait Implementations§
impl Freeze for SetReduceExpression
impl RefUnwindSafe for SetReduceExpression
impl Send for SetReduceExpression
impl Sync for SetReduceExpression
impl Unpin for SetReduceExpression
impl UnwindSafe for SetReduceExpression
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