Enum ndarray_linalg::layout::MatrixLayout
source · pub enum MatrixLayout {
C {
row: i32,
lda: i32,
},
F {
col: i32,
lda: i32,
},
}
Variants§
Implementations§
source§impl MatrixLayout
impl MatrixLayout
pub fn size(&self) -> (i32, i32)
pub fn resized(&self, row: i32, col: i32) -> MatrixLayout
pub fn lda(&self) -> i32
pub fn len(&self) -> i32
pub fn is_empty(&self) -> bool
pub fn same_order(&self, other: &MatrixLayout) -> bool
pub fn toggle_order(&self) -> MatrixLayout
sourcepub fn t(&self) -> MatrixLayout
pub fn t(&self) -> MatrixLayout
Transpose without changing memory representation
C-contigious row=2, lda=3
[[1, 2, 3]
[4, 5, 6]]
and F-contigious col=2, lda=3
[[1, 4]
[2, 5]
[3, 6]]
have same memory representation [1, 2, 3, 4, 5, 6]
, and this toggles them.
let layout = MatrixLayout::C { row: 2, lda: 3 };
assert_eq!(layout.t(), MatrixLayout::F { col: 2, lda: 3 });
Trait Implementations§
source§impl Clone for MatrixLayout
impl Clone for MatrixLayout
source§fn clone(&self) -> MatrixLayout
fn clone(&self) -> MatrixLayout
Returns a copy of the value. Read more
1.0.0 · 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 MatrixLayout
impl Debug for MatrixLayout
source§impl PartialEq for MatrixLayout
impl PartialEq for MatrixLayout
impl Copy for MatrixLayout
impl Eq for MatrixLayout
impl StructuralPartialEq for MatrixLayout
Auto Trait Implementations§
impl Freeze for MatrixLayout
impl RefUnwindSafe for MatrixLayout
impl Send for MatrixLayout
impl Sync for MatrixLayout
impl Unpin for MatrixLayout
impl UnwindSafe for MatrixLayout
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)