pub enum VectorExpression {
Reference(ReferenceExpression<Vector>),
Indices(Box<VectorExpression>),
Reverse(Box<VectorExpression>),
Set(ElementExpression, Box<VectorExpression>, ElementExpression),
Push(ElementExpression, Box<VectorExpression>),
Pop(Box<VectorExpression>),
FromSet(Box<SetExpression>),
If(Box<Condition>, Box<VectorExpression>, Box<VectorExpression>),
}Expand description
Vector expression.
Variants§
Reference(ReferenceExpression<Vector>)
Reference to a constant or a variable.
Indices(Box<VectorExpression>)
Indices of a vector.
Reverse(Box<VectorExpression>)
Reverse a vector.
Set(ElementExpression, Box<VectorExpression>, ElementExpression)
Set an element in a vector.
Push(ElementExpression, Box<VectorExpression>)
Push an element to a vector.
Pop(Box<VectorExpression>)
Pop an element from a vector.
FromSet(Box<SetExpression>)
Conversion from a set.
If(Box<Condition>, Box<VectorExpression>, Box<VectorExpression>)
If-then-else expression, which returns the first one if the condition holds and the second one otherwise.
Implementations§
Source§impl VectorExpression
impl VectorExpression
Sourcepub fn eval<T: StateInterface>(
&self,
state: &T,
function_cache: &mut StateFunctionCache,
state_functions: &StateFunctions,
registry: &TableRegistry,
) -> Vector
pub fn eval<T: StateInterface>( &self, state: &T, function_cache: &mut StateFunctionCache, state_functions: &StateFunctions, registry: &TableRegistry, ) -> 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.
Sourcepub fn simplify(&self, registry: &TableRegistry) -> VectorExpression
pub fn simplify(&self, registry: &TableRegistry) -> VectorExpression
Returns a simplified version by precomputation.
§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 AddEffect<VectorVariable, VectorExpression> for Transition
impl AddEffect<VectorVariable, VectorExpression> for Transition
Source§fn add_effect<V>(
&mut self,
v: VectorVariable,
expression: V,
) -> Result<(), ModelErr>where
VectorExpression: From<V>,
fn add_effect<V>(
&mut self,
v: VectorVariable,
expression: V,
) -> Result<(), ModelErr>where
VectorExpression: From<V>,
Adds an effect. Read more
Source§impl CheckExpression<VectorExpression> for Model
impl CheckExpression<VectorExpression> for Model
Source§fn check_expression(
&self,
expression: &VectorExpression,
allow_cost: bool,
) -> Result<(), ModelErr>
fn check_expression( &self, expression: &VectorExpression, allow_cost: bool, ) -> Result<(), ModelErr>
Checks if an expression is valid. Read more
Source§impl Clone for VectorExpression
impl Clone for VectorExpression
Source§fn clone(&self) -> VectorExpression
fn clone(&self) -> VectorExpression
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 Debug for VectorExpression
impl Debug for VectorExpression
Source§impl From<VectorExpression> for ArgumentExpression
impl From<VectorExpression> for ArgumentExpression
Source§fn from(v: VectorExpression) -> ArgumentExpression
fn from(v: VectorExpression) -> ArgumentExpression
Converts to this type from the input type.
Source§impl PartialEq for VectorExpression
impl PartialEq for VectorExpression
Source§fn eq(&self, other: &VectorExpression) -> bool
fn eq(&self, other: &VectorExpression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for VectorExpression
Auto Trait Implementations§
impl Freeze for VectorExpression
impl RefUnwindSafe for VectorExpression
impl Send for VectorExpression
impl Sync for VectorExpression
impl Unpin for VectorExpression
impl UnsafeUnpin for VectorExpression
impl UnwindSafe for VectorExpression
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