Skip to main content

MatUninitMut

Type Alias MatUninitMut 

Source
pub type MatUninitMut<'a, T, Rows = usize, Cols = usize, RStride = isize, CStride = isize> = Mat<UninitMut<'a, T, Rows, Cols, RStride, CStride>>;
Expand description

mutable view over a matrix whose elements may be uninitialized.

Unlike MatMut, this type does not expose element references. It is intended for APIs that overwrite every logical destination element before the storage is converted into an initialized matrix. The only operations available on this type are metadata queries and raw-pointer access for write-only kernels.

Aliased Type§

#[repr(transparent)]
pub struct MatUninitMut<'a, T, Rows = usize, Cols = usize, RStride = isize, CStride = isize>(/* private fields */);

Implementations§

Source§

impl<'a, T, Rows: Shape, Cols: Shape, RStride: Stride, CStride: Stride> MatUninitMut<'a, T, Rows, Cols, RStride, CStride>

Source

pub const unsafe fn from_raw_parts_mut( ptr: *mut MaybeUninit<T>, nrows: Rows, ncols: Cols, row_stride: RStride, col_stride: CStride, ) -> Self

creates a write-only matrix view from a raw pointer.

§safety

the pointed-to memory must contain the complete matrix described by the dimensions and strides, be properly aligned for MaybeUninit<T>, and remain exclusively borrowed for 'a. Matrix elements must not overlap each other. Unlike [MatMut::from_raw_parts_mut], the elements do not need to be initialized.

Source

pub fn as_ptr_mut(&self) -> *mut MaybeUninit<T>

returns the raw pointer to the first matrix element.

Source

pub fn nrows(&self) -> Rows

returns the number of rows.

Source

pub fn ncols(&self) -> Cols

returns the number of columns.

Source

pub fn row_stride(&self) -> RStride

returns the row stride in elements.

Source

pub fn col_stride(&self) -> CStride

returns the column stride in elements.

Source

pub fn as_dyn(self) -> MatUninitMut<'a, T, usize, usize, isize, isize>

converts this view to dynamic dimensions and strides.

Source§

impl<'a, T, Rows: Shape, Cols: Shape> MatUninitMut<'a, T, Rows, Cols, isize, isize>

Source

pub fn from_column_major_slice_mut( slice: &'a mut [MaybeUninit<T>], nrows: Rows, ncols: Cols, ) -> Self

creates a column-major write-only view over a MaybeUninit slice.

Source

pub fn from_row_major_slice_mut( slice: &'a mut [MaybeUninit<T>], nrows: Rows, ncols: Cols, ) -> Self

creates a row-major write-only view over a MaybeUninit slice.