pub enum TDim {
    Sym(Symbol),
    Val(i64),
    Add(Vec<TDim, Global>),
    Mul(Vec<TDim, Global>),
    MulInt(i64, Box<TDim, Global>),
    Div(Box<TDim, Global>, u64),
}

Variants§

§

Sym(Symbol)

§

Val(i64)

§

Add(Vec<TDim, Global>)

§

Mul(Vec<TDim, Global>)

§

MulInt(i64, Box<TDim, Global>)

§

Div(Box<TDim, Global>, u64)

Implementations§

§

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(&self, values: &SymbolValues) -> TDim

pub fn reduce(self) -> TDim

pub fn simplify(self) -> TDim

pub fn div_ceil(self, rhs: u64) -> TDim

pub fn slope(&self, sym: &Symbol) -> (i64, u64)

pub fn symbols(&self) -> HashSet<Symbol, RandomState>

pub fn compatible_with(&self, _other: &TDim) -> bool

Check if a dim is ‘compatible with’ another, meaning that the current dim is a “sub” dimension within or equal to the _other dim

Trait Implementations§

§

impl<'a> Add<&'a TDim> for TDim

§

type Output = TDim

The resulting type after applying the + operator.
§

fn add(self, rhs: &'a TDim) -> TDim

Performs the + operation. Read more
§

impl<I> Add<I> for TDimwhere I: Into<TDim>,

§

type Output = TDim

The resulting type after applying the + operator.
§

fn add(self, rhs: I) -> TDim

Performs the + operation. Read more
§

impl<'a> AddAssign<&'a TDim> for TDim

§

fn add_assign(&mut self, rhs: &'a TDim)

Performs the += operation. Read more
§

impl<I> AddAssign<I> for TDimwhere I: Into<TDim>,

§

fn add_assign(&mut self, rhs: I)

Performs the += operation. Read more
§

impl Bounded for TDim

§

fn min_value() -> TDim

Returns the smallest finite number this type can represent
§

fn max_value() -> TDim

Returns the largest finite number this type can represent
§

impl Clone for TDim

§

fn clone(&self) -> TDim

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl CoerceFrom<Value> for TDim

§

fn coerce(builder: &mut ModelBuilder<'_>, from: &Value) -> Result<TDim, Error>

§

impl Datum for TDim

§

fn name() -> &'static str

§

fn datum_type() -> DatumType

§

impl Debug for TDim

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for TDim

§

fn default() -> TDim

Returns the “default value” for a type. Read more
§

impl DimLike for TDim

§

fn maybe_div(&self, other: &TDim) -> Result<(TDim, u64), Error>

§

fn to_i64(&self) -> Result<i64, Error>

Convert to regular integer.
§

fn one() -> TDim

do not use num_traits::Mul as it implies a regular Mul
§

fn eval(&self, values: &SymbolValues) -> TDim

§

fn divceil(&self, other: usize) -> Self

Integer divise, rounding up to next integer.
§

fn to_usize(&self) -> Result<usize, Error>

§

fn to_isize(&self) -> Result<isize, Error>

§

fn to_i32(&self) -> Result<i32, Error>

§

impl Display for TDim

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<I> Div<I> for TDimwhere I: AsPrimitive<u64> + PrimInt,

§

type Output = TDim

The resulting type after applying the / operator.
§

fn div(self, rhs: I) -> TDim

Performs the / operation. Read more
§

impl<I> DivAssign<I> for TDimwhere I: AsPrimitive<u64> + PrimInt,

§

fn div_assign(&mut self, rhs: I)

Performs the /= operation. Read more
§

impl<'a> From<&'a Symbol> for TDim

§

fn from(it: &'a Symbol) -> TDim

Converts to this type from the input type.
§

impl<'a> From<&'a i32> for TDim

§

fn from(v: &'a i32) -> TDim

Converts to this type from the input type.
§

impl<'a> From<&'a i64> for TDim

§

fn from(v: &'a i64) -> TDim

Converts to this type from the input type.
§

impl<'a> From<&'a isize> for TDim

§

fn from(v: &'a isize) -> TDim

Converts to this type from the input type.
§

impl<'a> From<&'a u64> for TDim

§

fn from(v: &'a u64) -> TDim

Converts to this type from the input type.
§

impl<'a> From<&'a usize> for TDim

§

fn from(v: &'a usize) -> TDim

Converts to this type from the input type.
§

impl From<Symbol> for TDim

§

fn from(it: Symbol) -> TDim

Converts to this type from the input type.
§

impl From<TDim> for Tensor

§

fn from(it: TDim) -> Tensor

Converts to this type from the input type.
§

impl From<i32> for TDim

§

fn from(v: i32) -> TDim

Converts to this type from the input type.
§

impl From<i64> for TDim

§

fn from(v: i64) -> TDim

Converts to this type from the input type.
§

impl From<isize> for TDim

§

fn from(v: isize) -> TDim

Converts to this type from the input type.
§

impl From<u64> for TDim

§

fn from(v: u64) -> TDim

Converts to this type from the input type.
§

impl From<usize> for TDim

§

fn from(v: usize) -> TDim

Converts to this type from the input type.
§

impl Hash for TDim

§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<'a> Mul<&'a TDim> for TDim

§

type Output = TDim

The resulting type after applying the * operator.
§

fn mul(self, rhs: &'a TDim) -> TDim

Performs the * operation. Read more
§

impl<I> Mul<I> for TDimwhere I: Into<TDim>,

§

type Output = TDim

The resulting type after applying the * operator.
§

fn mul(self, rhs: I) -> TDim

Performs the * operation. Read more
§

impl<'a> MulAssign<&'a TDim> for TDim

§

fn mul_assign(&mut self, rhs: &'a TDim)

Performs the *= operation. Read more
§

impl<I> MulAssign<I> for TDimwhere I: Into<TDim>,

§

fn mul_assign(&mut self, rhs: I)

Performs the *= operation. Read more
§

impl Neg for TDim

§

type Output = TDim

The resulting type after applying the - operator.
§

fn neg(self) -> TDim

Performs the unary - operation. Read more
§

impl One for TDim

§

fn one() -> TDim

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> boolwhere Self: PartialEq<Self>,

Returns true if self is equal to the multiplicative identity. Read more
§

impl Ord for TDim

§

fn cmp(&self, other: &TDim) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
§

impl PartialEq<TDim> for TDim

§

fn eq(&self, other: &TDim) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd<TDim> for TDim

§

fn partial_cmp(&self, other: &TDim) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<'a> Product<&'a TDim> for TDim

§

fn product<I>(iter: I) -> TDimwhere I: Iterator<Item = &'a TDim>,

Method which takes an iterator and generates Self from the elements by multiplying the items.
§

impl Product<TDim> for TDim

§

fn product<I>(iter: I) -> TDimwhere I: Iterator<Item = TDim>,

Method which takes an iterator and generates Self from the elements by multiplying the items.
§

impl<I> Rem<I> for TDimwhere I: AsPrimitive<u64> + PrimInt,

§

type Output = TDim

The resulting type after applying the % operator.
§

fn rem(self, rhs: I) -> TDim

Performs the % operation. Read more
§

impl<I> RemAssign<I> for TDimwhere I: AsPrimitive<u64> + PrimInt,

§

fn rem_assign(&mut self, rhs: I)

Performs the %= operation. Read more
§

impl<'a> Sub<&'a TDim> for TDim

§

type Output = TDim

The resulting type after applying the - operator.
§

fn sub(self, rhs: &'a TDim) -> TDim

Performs the - operation. Read more
§

impl<I> Sub<I> for TDimwhere I: Into<TDim>,

§

type Output = TDim

The resulting type after applying the - operator.
§

fn sub(self, rhs: I) -> TDim

Performs the - operation. Read more
§

impl<'a> SubAssign<&'a TDim> for TDim

§

fn sub_assign(&mut self, rhs: &'a TDim)

Performs the -= operation. Read more
§

impl<I> SubAssign<I> for TDimwhere I: Into<TDim>,

§

fn sub_assign(&mut self, rhs: I)

Performs the -= operation. Read more
§

impl<'a> Sum<&'a TDim> for TDim

§

fn sum<I>(iter: I) -> TDimwhere I: Iterator<Item = &'a TDim>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
§

impl Sum<TDim> for TDim

§

fn sum<I>(iter: I) -> TDimwhere I: Iterator<Item = TDim>,

Method which takes an iterator and generates Self from the elements by “summing up” the items.
§

impl<'a> ToDim for &'a TDim

§

fn to_dim(&self) -> TDim

Convert self to a TDim.
§

impl<'a> TryFrom<&'a TDim> for TDim

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(d: &'a TDim) -> Result<TDim, Error>

Performs the conversion.
§

impl<'a> TryFrom<&'a TDim> for usize

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(d: &'a TDim) -> Result<usize, Error>

Performs the conversion.
§

impl Zero for TDim

§

fn zero() -> TDim

Returns the additive identity element of Self, 0. Read more
§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
§

impl Eq for TDim

§

impl StructuralEq for TDim

§

impl StructuralPartialEq for TDim

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

§

impl<T> DatumExt for Twhere T: Datum,

§

fn scalar_fact() -> TypedFact

§

fn fact<S>(shape: S) -> TypedFactwhere S: Into<ShapeFact>,

source§

impl<T> Downcast for Twhere T: Any,

source§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

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 + 'static>

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)

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)

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 Twhere T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send + 'static>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> LowerBounded for Twhere T: Bounded,

source§

fn min_value() -> T

Returns the smallest finite number this type can represent
§

impl<I> ToDim for Iwhere I: Into<TDim> + Clone,

§

fn to_dim(&self) -> TDim

Convert self to a TDim.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UpperBounded for Twhere T: Bounded,

source§

fn max_value() -> T

Returns the largest finite number this type can represent
source§

impl<T, Rhs> NumAssignOps<Rhs> for Twhere T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,