MatrixView in nalgebra::base - Rust
Description: A matrix view.
Keywords: rust, rustlang, rust-lang, MatrixView

# Type Definition nalgebra::base::MatrixView

source ·

    pub type MatrixView<'a, T, R, C, RStride = U1, CStride = R> = Matrix<T, R, C, ViewStorage<'a, T, R, C, RStride, CStride>>;

Expand description

A matrix view.

## Implementations§

source§

### impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> MatrixView<'a, T, R, C, RStride, CStride>

#### Creating matrix views from `&[T]`

source

#### pub unsafe fn from_slice_with_strides_generic_unchecked(
data: &'a [T],
start: usize,
nrows: R,
ncols: C,
rstride: RStride,
cstride: CStride
) -> Self

Creates, without bounds checking, a matrix view from an array and with dimensions and strides specified by generic types instances.

##### Safety

This method is unsafe because the input data array is not checked to contain enough elements. The generic types `R`, `C`, `RStride`, `CStride` can either be type-level integers or integers wrapped with `Dyn()`.

source

#### pub fn from_slice_with_strides_generic(
data: &'a [T],
nrows: R,
ncols: C,
rstride: RStride,
cstride: CStride
) -> Self

Creates a matrix view from an array and with dimensions and strides specified by generic types instances.

Panics if the input data array dose not contain enough elements. The generic types `R`, `C`, `RStride`, `CStride` can either be type-level integers or integers wrapped with `Dyn()`.

source§

### impl<'a, T: Scalar, R: Dim, C: Dim> MatrixView<'a, T, R, C>

source

#### pub unsafe fn from_slice_generic_unchecked(
data: &'a [T],
start: usize,
nrows: R,
ncols: C
) -> Self

Creates, without bound-checking, a matrix view from an array and with dimensions specified by generic types instances.

##### Safety

This method is unsafe because the input data array is not checked to contain enough elements. The generic types `R` and `C` can either be type-level integers or integers wrapped with `Dyn()`.

source

#### pub fn from_slice_generic(data: &'a [T], nrows: R, ncols: C) -> Self

Creates a matrix view from an array and with dimensions and strides specified by generic types instances.

Panics if the input data array dose not contain enough elements. The generic types `R` and `C` can either be type-level integers or integers wrapped with `Dyn()`.

source§

### impl<'a, T: Scalar, R: DimName, C: DimName> MatrixView<'a, T, R, C>

source

#### pub fn from_slice(data: &'a [T]) -> Self

Creates a new matrix view from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_unchecked(data: &'a [T], start: usize) -> Self

Creates, without bound checking, a new matrix view from the given data array.

source§

### impl<'a, T: Scalar, R: DimName, C: DimName> MatrixView<'a, T, R, C, Dyn, Dyn>

source

#### pub fn from_slice_with_strides(
data: &'a [T],
rstride: usize,
cstride: usize
) -> Self

Creates a new matrix view with the specified strides from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_with_strides_unchecked(
data: &'a [T],
start: usize,
rstride: usize,
cstride: usize
) -> Self

Creates, without bound checking, a new matrix view with the specified strides from the given data array.

source§

### impl<'a, T: Scalar, R: DimName> MatrixView<'a, T, R, Dyn>

source

#### pub fn from_slice(data: &'a [T], ncols: usize) -> Self

Creates a new matrix view from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_unchecked(
data: &'a [T],
start: usize,
ncols: usize
) -> Self

Creates, without bound checking, a new matrix view from the given data array.

source§

### impl<'a, T: Scalar, R: DimName> MatrixView<'a, T, R, Dyn, Dyn, Dyn>

source

#### pub fn from_slice_with_strides(
data: &'a [T],
ncols: usize,
rstride: usize,
cstride: usize
) -> Self

Creates a new matrix view with the specified strides from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_with_strides_unchecked(
data: &'a [T],
start: usize,
ncols: usize,
rstride: usize,
cstride: usize
) -> Self

Creates, without bound checking, a new matrix view with the specified strides from the given data array.

source§

### impl<'a, T: Scalar, C: DimName> MatrixView<'a, T, Dyn, C>

source

#### pub fn from_slice(data: &'a [T], nrows: usize) -> Self

Creates a new matrix view from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_unchecked(
data: &'a [T],
start: usize,
nrows: usize
) -> Self

Creates, without bound checking, a new matrix view from the given data array.

source§

### impl<'a, T: Scalar, C: DimName> MatrixView<'a, T, Dyn, C, Dyn, Dyn>

source

#### pub fn from_slice_with_strides(
data: &'a [T],
nrows: usize,
rstride: usize,
cstride: usize
) -> Self

Creates a new matrix view with the specified strides from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_with_strides_unchecked(
data: &'a [T],
start: usize,
nrows: usize,
rstride: usize,
cstride: usize
) -> Self

Creates, without bound checking, a new matrix view with the specified strides from the given data array.

source§

### impl<'a, T: Scalar> MatrixView<'a, T, Dyn, Dyn>

source

#### pub fn from_slice(data: &'a [T], nrows: usize, ncols: usize) -> Self

Creates a new matrix view from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_unchecked(
data: &'a [T],
start: usize,
nrows: usize,
ncols: usize
) -> Self

Creates, without bound checking, a new matrix view from the given data array.

source§

### impl<'a, T: Scalar> MatrixView<'a, T, Dyn, Dyn, Dyn, Dyn>

source

#### pub fn from_slice_with_strides(
data: &'a [T],
nrows: usize,
ncols: usize,
rstride: usize,
cstride: usize
) -> Self

Creates a new matrix view with the specified strides from the given data array.

Panics if `data` does not contain enough elements.

source

#### pub unsafe fn from_slice_with_strides_unchecked(
data: &'a [T],
start: usize,
nrows: usize,
ncols: usize,
rstride: usize,
cstride: usize
) -> Self

Creates, without bound checking, a new matrix view with the specified strides from the given data array.

## Trait Implementations§

source§

### impl<'a, T, R, C, RView, CView, RStride, CStride, S> From<&'a Matrix<T, R, C, S>> for MatrixView<'a, T, RView, CView, RStride, CStride>where
R: Dim,
C: Dim,
RView: Dim,
CView: Dim,
RStride: Dim,
CStride: Dim,
S: RawStorage<T, R, C>,
ShapeConstraint: DimEq<R, RView> + DimEq<C, CView> + DimEq<RStride, S::RStride> + DimEq<CStride, S::CStride>,

source§

#### fn from(m: &'a Matrix<T, R, C, S>) -> Self

Converts to this type from the input type.
source§

### impl<'a, T, R, C, RView, CView, RStride, CStride, S> From<&'a mut Matrix<T, R, C, S>> for MatrixView<'a, T, RView, CView, RStride, CStride>where
R: Dim,
C: Dim,
RView: Dim,
CView: Dim,
RStride: Dim,
CStride: Dim,
S: RawStorage<T, R, C>,
ShapeConstraint: DimEq<R, RView> + DimEq<C, CView> + DimEq<RStride, S::RStride> + DimEq<CStride, S::CStride>,

source§

#### fn from(m: &'a mut Matrix<T, R, C, S>) -> Self

Converts to this type from the input type.
source§

### impl<'a, T, R, C, RStride, CStride> From<Matrix<T, R, C, ViewStorageMut<'a, T, R, C, RStride, CStride>>> for MatrixView<'a, T, R, C, RStride, CStride>where
R: Dim,
C: Dim,
RStride: Dim,
CStride: Dim,

source§

#### fn from(view_mut: MatrixViewMut<'a, T, R, C, RStride, CStride>) -> Self

Converts to this type from the input type.