pub enum TDim {
Val(i64),
Sym(Symbol),
Add(Vec<TDim>),
Mul(Vec<TDim>),
MulInt(i64, Box<TDim>),
Div(Box<TDim>, u64),
Broadcast(Vec<TDim>),
Min(Vec<TDim>),
Max(Vec<TDim>),
}
Variants§
Val(i64)
Sym(Symbol)
Add(Vec<TDim>)
Mul(Vec<TDim>)
MulInt(i64, Box<TDim>)
Div(Box<TDim>, u64)
Broadcast(Vec<TDim>)
Min(Vec<TDim>)
Max(Vec<TDim>)
Implementations§
Source§impl TDim
impl TDim
pub fn is_one(&self) -> bool
pub fn to_i64(&self) -> Result<i64, Error>
pub fn as_i64(&self) -> Option<i64>
pub fn eval_to_i64(&self, values: &SymbolValues) -> Result<i64, Error>
pub fn eval(&self, values: &SymbolValues) -> TDim
pub fn eval_with_scenario(&self, scenario: &str) -> TDim
pub fn substitute(&self, from: &Symbol, to: &TDim) -> Result<TDim, Error>
pub fn reduce(self) -> TDim
pub fn find_scope(&self) -> Option<SymbolScope>
pub fn simplify(self) -> TDim
pub fn low_inclusive_bound(&self) -> Option<i64>
pub fn high_inclusive_bound(&self) -> Option<i64>
pub fn prove_positive_or_zero(&self) -> bool
pub fn prove_strict_positive(&self) -> bool
pub fn prove_negative_or_zero(&self) -> bool
pub fn prove_strict_negative(&self) -> bool
pub fn gcd(&self) -> u64
pub fn div_ceil(self, rhs: u64) -> TDim
pub fn symbols(&self) -> HashSet<Symbol>
pub fn compatible_with(&self, other: &TDim) -> bool
Trait Implementations§
Source§impl<'a> AddAssign<&'a TDim> for TDim
impl<'a> AddAssign<&'a TDim> for TDim
Source§fn add_assign(&mut self, rhs: &'a TDim)
fn add_assign(&mut self, rhs: &'a TDim)
Performs the
+=
operation. Read moreSource§impl<I> AddAssign<I> for TDim
impl<I> AddAssign<I> for TDim
Source§fn add_assign(&mut self, rhs: I)
fn add_assign(&mut self, rhs: I)
Performs the
+=
operation. Read moreSource§impl CoerceFrom<Value> for TDim
impl CoerceFrom<Value> for TDim
Source§impl DimLike for TDim
impl DimLike for TDim
fn maybe_div(&self, other: &TDim) -> Result<(TDim, u64), Error>
Source§fn eval(&self, values: &SymbolValues) -> TDim
fn eval(&self, values: &SymbolValues) -> TDim
Substitute as many symbols as possible in the dim value.
fn substitute(&self, from: &Symbol, to: &TDim) -> Result<TDim, Error>
Source§fn eval_to_i64(&self, values: &SymbolValues) -> Result<i64, Error>
fn eval_to_i64(&self, values: &SymbolValues) -> Result<i64, Error>
Full evaluation of the symbol, failing if a symbol is missing
fn broadcast(self, other: TDim) -> Result<TDim, Error>
fn compatible_with(&self, other: &TDim) -> bool
fn mini(self, other: TDim) -> TDim
fn maxi(self, other: TDim) -> TDim
fn to_usize(&self) -> Result<usize, Error>
fn to_isize(&self) -> Result<isize, Error>
fn to_i32(&self) -> Result<i32, Error>
Source§impl<I> DivAssign<I> for TDim
impl<I> DivAssign<I> for TDim
Source§fn div_assign(&mut self, rhs: I)
fn div_assign(&mut self, rhs: I)
Performs the
/=
operation. Read moreSource§impl<'a> MulAssign<&'a TDim> for TDim
impl<'a> MulAssign<&'a TDim> for TDim
Source§fn mul_assign(&mut self, rhs: &'a TDim)
fn mul_assign(&mut self, rhs: &'a TDim)
Performs the
*=
operation. Read moreSource§impl<I> MulAssign<I> for TDim
impl<I> MulAssign<I> for TDim
Source§fn mul_assign(&mut self, rhs: I)
fn mul_assign(&mut self, rhs: I)
Performs the
*=
operation. Read moreSource§impl<I> RemAssign<I> for TDim
impl<I> RemAssign<I> for TDim
Source§fn rem_assign(&mut self, rhs: I)
fn rem_assign(&mut self, rhs: I)
Performs the
%=
operation. Read moreSource§impl<'a> SubAssign<&'a TDim> for TDim
impl<'a> SubAssign<&'a TDim> for TDim
Source§fn sub_assign(&mut self, rhs: &'a TDim)
fn sub_assign(&mut self, rhs: &'a TDim)
Performs the
-=
operation. Read moreSource§impl<I> SubAssign<I> for TDim
impl<I> SubAssign<I> for TDim
Source§fn sub_assign(&mut self, rhs: I)
fn sub_assign(&mut self, rhs: I)
Performs the
-=
operation. Read moreimpl Eq for TDim
impl StructuralPartialEq for TDim
Auto Trait Implementations§
impl Freeze for TDim
impl !RefUnwindSafe for TDim
impl Send for TDim
impl Sync for TDim
impl Unpin for TDim
impl !UnwindSafe for TDim
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more