Enum tract_core::internal::tract_ndarray::Order   
source · #[non_exhaustive]pub enum Order {
    RowMajor,
    ColumnMajor,
}Expand description
Array order
Order refers to indexing order, or how a linear sequence is translated into a two-dimensional or multi-dimensional array.
- RowMajormeans that the index along the row is the most rapidly changing
- ColumnMajormeans that the index along the column is the most rapidly changing
Given a sequence like: 1, 2, 3, 4, 5, 6
If it is laid it out in a 2 x 3 matrix using row major ordering, it results in:
1  2  3
4  5  6
If it is laid using column major ordering, it results in:
1  3  5
2  4  6
It can be seen as filling in “rows first” or “columns first”.
Order can be used both to refer to logical ordering as well as memory ordering or memory
layout. The orderings have common short names, also seen in other environments, where
row major is called “C” order (after the C programming language) and column major is called “F”
or “Fortran” order.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
source§impl Order
 
impl Order
sourcepub const F: Order = Order::ColumnMajor
 
pub const F: Order = Order::ColumnMajor
“F” (for Fortran) is an alias for column major ordering
sourcepub fn is_row_major(self) -> bool
 
pub fn is_row_major(self) -> bool
Return true if input is Order::RowMajor, false otherwise
sourcepub fn is_column_major(self) -> bool
 
pub fn is_column_major(self) -> bool
Return true if input is Order::ColumnMajor, false otherwise
sourcepub fn row_major(row_major: bool) -> Order
 
pub fn row_major(row_major: bool) -> Order
Return Order::RowMajor if the input is true, Order::ColumnMajor otherwise
sourcepub fn column_major(column_major: bool) -> Order
 
pub fn column_major(column_major: bool) -> Order
Return Order::ColumnMajor if the input is true, Order::RowMajor otherwise
Trait Implementations§
source§impl PartialEq for Order
 
impl PartialEq for Order
impl Copy for Order
impl Eq for Order
impl StructuralPartialEq for Order
Auto Trait Implementations§
impl Freeze for Order
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnwindSafe for Order
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
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>
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>
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)
&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)
&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> ⓘ
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> ⓘ
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