pub enum ReferenceExpression<T: Clone> {
Constant(T),
Variable(usize),
Table(TableExpression<T>),
}Expand description
Expression referring to a constant or a variable.
Variants§
Constant(T)
Constant.
Variable(usize)
Variable index.
Table(TableExpression<T>)
Constant in a table.
Implementations§
Source§impl<T: Clone> ReferenceExpression<T>
impl<T: Clone> ReferenceExpression<T>
Sourcepub fn simplify(
&self,
registry: &TableRegistry,
tables: &TableData<T>,
) -> ReferenceExpression<T>
pub fn simplify( &self, registry: &TableRegistry, tables: &TableData<T>, ) -> ReferenceExpression<T>
Returns a simplified version by precomputation.
§Panics
Panics if a min/max reduce operation is performed on an empty set or vector.
Source§impl ReferenceExpression<Set>
impl ReferenceExpression<Set>
Sourcepub fn eval<'a, S: StateInterface>(
&'a self,
state: &'a S,
function_cache: &mut StateFunctionCache,
state_functions: &StateFunctions,
registry: &'a TableRegistry,
) -> &'a Set
pub fn eval<'a, S: StateInterface>( &'a self, state: &'a S, function_cache: &mut StateFunctionCache, state_functions: &StateFunctions, registry: &'a TableRegistry, ) -> &'a Set
Returns the evaluation result.
§Panics
Panics if the cost of the transition state is used or a min/max reduce operation is performed on an empty set or vector.
Source§impl ReferenceExpression<Vector>
impl ReferenceExpression<Vector>
Sourcepub fn eval<'a, U: StateInterface>(
&'a self,
state: &'a U,
function_cache: &mut StateFunctionCache,
state_functions: &StateFunctions,
registry: &'a TableRegistry,
) -> &'a Vector
pub fn eval<'a, U: StateInterface>( &'a self, state: &'a U, function_cache: &mut StateFunctionCache, state_functions: &StateFunctions, registry: &'a TableRegistry, ) -> &'a Vector
Returns the evaluation result.
§Panics
Panics if the cost of the transition state is used or a min/max reduce operation is performed on an empty set or vector.
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for ReferenceExpression<T>
impl<T: Clone + Clone> Clone for ReferenceExpression<T>
Source§fn clone(&self) -> ReferenceExpression<T>
fn clone(&self) -> ReferenceExpression<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: PartialEq + Clone> PartialEq for ReferenceExpression<T>
impl<T: PartialEq + Clone> PartialEq for ReferenceExpression<T>
Source§fn eq(&self, other: &ReferenceExpression<T>) -> bool
fn eq(&self, other: &ReferenceExpression<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T: PartialEq + Clone> StructuralPartialEq for ReferenceExpression<T>
Auto Trait Implementations§
impl<T> Freeze for ReferenceExpression<T>where
T: Freeze,
impl<T> RefUnwindSafe for ReferenceExpression<T>where
T: RefUnwindSafe,
impl<T> Send for ReferenceExpression<T>where
T: Send,
impl<T> Sync for ReferenceExpression<T>where
T: Sync,
impl<T> Unpin for ReferenceExpression<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReferenceExpression<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ReferenceExpression<T>where
T: UnwindSafe,
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