Enum ndarray::Order[][src]

#[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.

  • RowMajor means that the index along the row is the most rapidly changing
  • ColumnMajor means 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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
RowMajor
Expand description

Row major or “C” order

ColumnMajor
Expand description

Column major or “F” order

Implementations

impl Order[src]

pub const C: Order[src]

“C” is an alias for row major ordering

pub const F: Order[src]

“F” (for Fortran) is an alias for column major ordering

pub fn is_row_major(self) -> bool[src]

Return true if input is Order::RowMajor, false otherwise

pub fn is_column_major(self) -> bool[src]

Return true if input is Order::ColumnMajor, false otherwise

pub fn row_major(row_major: bool) -> Order[src]

Return Order::RowMajor if the input is true, Order::ColumnMajor otherwise

pub fn column_major(column_major: bool) -> Order[src]

Return Order::ColumnMajor if the input is true, Order::RowMajor otherwise

pub fn transpose(self) -> Order[src]

Return the transpose: row major becomes column major and vice versa.

Trait Implementations

impl Clone for Order[src]

fn clone(&self) -> Order[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Order[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<Order> for Order[src]

fn eq(&self, other: &Order) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Copy for Order[src]

impl Eq for Order[src]

impl StructuralEq for Order[src]

impl StructuralPartialEq for Order[src]

Auto Trait Implementations

impl RefUnwindSafe for Order

impl Send for Order

impl Sync for Order

impl Unpin for Order

impl UnwindSafe for Order

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.