MatMut

Type Alias MatMut 

Source
pub type MatMut<'a, E> = Matrix<DenseMut<'a, E>>;
Expand description

Mutable view over a matrix, similar to a mutable reference to a 2D strided slice.

§Note

Unlike a slice, the data pointed to by MatMut<'_, E> is allowed to be partially or fully uninitialized under certain conditions. In this case, care must be taken to not perform any operations that read the uninitialized values, or form references to them, either directly through MatMut::read, or indirectly through any of the numerical library routines, unless it is explicitly permitted.

§Move semantics

Since MatMut mutably borrows data, it cannot be Copy. This means that if we pass a MatMut to a function that takes it by value, or use a method that consumes self like MatMut::transpose, this renders the original variable unusable.

use faer_core::{Mat, MatMut};

fn takes_matmut(view: MatMut<'_, f64>) {}

let mut matrix = Mat::new();
let view = matrix.as_mut();

takes_matmut(view); // `view` is moved (passed by value)
takes_matmut(view); // this fails to compile since `view` was moved

The way to get around it is to use the reborrow::ReborrowMut trait, which allows us to mutably borrow a MatMut to obtain another MatMut for the lifetime of the borrow. It’s also similarly possible to immutably borrow a MatMut to obtain a MatRef for the lifetime of the borrow, using reborrow::Reborrow.

use faer_core::{Mat, MatMut, MatRef};
use reborrow::*;

fn takes_matmut(view: MatMut<'_, f64>) {}
fn takes_matref(view: MatRef<'_, f64>) {}

let mut matrix = Mat::new();
let mut view = matrix.as_mut();

takes_matmut(view.rb_mut());
takes_matmut(view.rb_mut());
takes_matref(view.rb());
// view is still usable here

Aliased Type§

pub struct MatMut<'a, E> { /* private fields */ }

Implementations§

Source§

impl<'a, E: Entity> MatMut<'a, E>

Source

pub fn nrows(&self) -> usize

Returns the number of rows of the matrix.

Source

pub fn ncols(&self) -> usize

Returns the number of columns of the matrix.

Source

pub fn as_ptr_mut(self) -> GroupFor<E, *mut E::Unit>

Returns pointers to the matrix data.

Source

pub fn row_stride(&self) -> isize

Returns the row stride of the matrix, specified in number of elements, not in bytes.

Source

pub fn col_stride(&self) -> isize

Returns the column stride of the matrix, specified in number of elements, not in bytes.

Source

pub fn ptr_at_mut(self, row: usize, col: usize) -> GroupFor<E, *mut E::Unit>

Returns raw pointers to the element at the given indices.

Source

pub unsafe fn ptr_inbounds_at_mut( self, row: usize, col: usize, ) -> GroupFor<E, *mut E::Unit>

Returns raw pointers to the element at the given indices, assuming the provided indices are within the matrix dimensions.

§Safety

The behavior is undefined if any of the following conditions are violated:

  • row < self.nrows().
  • col < self.ncols().
Source

pub unsafe fn split_at_mut_unchecked( self, row: usize, col: usize, ) -> (Self, Self, Self, Self)

Splits the matrix horizontally and vertically at the given indices into four corners and returns an array of each submatrix, in the following order:

  • top left.
  • top right.
  • bottom left.
  • bottom right.
§Safety

The behavior is undefined if any of the following conditions are violated:

  • row <= self.nrows().
  • col <= self.ncols().
Source

pub fn split_at_mut(self, row: usize, col: usize) -> (Self, Self, Self, Self)

Splits the matrix horizontally and vertically at the given indices into four corners and returns an array of each submatrix, in the following order:

  • top left.
  • top right.
  • bottom left.
  • bottom right.
§Panics

The function panics if any of the following conditions are violated:

  • row <= self.nrows().
  • col <= self.ncols().
Source

pub unsafe fn split_at_row_mut_unchecked(self, row: usize) -> (Self, Self)

Splits the matrix horizontally at the given row into two parts and returns an array of each submatrix, in the following order:

  • top.
  • bottom.
§Safety

The behavior is undefined if the following condition is violated:

  • row <= self.nrows().
Source

pub fn split_at_row_mut(self, row: usize) -> (Self, Self)

Splits the matrix horizontally at the given row into two parts and returns an array of each submatrix, in the following order:

  • top.
  • bottom.
§Panics

The function panics if the following condition is violated:

  • row <= self.nrows().
Source

pub unsafe fn split_at_col_mut_unchecked(self, col: usize) -> (Self, Self)

Splits the matrix vertically at the given row into two parts and returns an array of each submatrix, in the following order:

  • left.
  • right.
§Safety

The behavior is undefined if the following condition is violated:

  • col <= self.ncols().
Source

pub fn split_at_col_mut(self, col: usize) -> (Self, Self)

Splits the matrix vertically at the given row into two parts and returns an array of each submatrix, in the following order:

  • left.
  • right.
§Panics

The function panics if the following condition is violated:

  • col <= self.ncols().
Source

pub unsafe fn get_mut_unchecked<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <Self as MatIndex<RowRange, ColRange>>::Target
where Self: MatIndex<RowRange, ColRange>,

Returns mutable references to the element at the given indices, or submatrices if either row or col is a range.

§Note

The values pointed to by the references are expected to be initialized, even if the pointed-to value is not read, otherwise the behavior is undefined.

§Safety

The behavior is undefined if any of the following conditions are violated:

  • row must be contained in [0, self.nrows()).
  • col must be contained in [0, self.ncols()).
Source

pub fn get_mut<RowRange, ColRange>( self, row: RowRange, col: ColRange, ) -> <Self as MatIndex<RowRange, ColRange>>::Target
where Self: MatIndex<RowRange, ColRange>,

Returns mutable references to the element at the given indices, or submatrices if either row or col is a range, with bound checks.

§Note

The values pointed to by the references are expected to be initialized, even if the pointed-to value is not read, otherwise the behavior is undefined.

§Panics

The function panics if any of the following conditions are violated:

  • row must be contained in [0, self.nrows()).
  • col must be contained in [0, self.ncols()).
Source

pub unsafe fn read_unchecked(&self, row: usize, col: usize) -> E

Reads the value of the element at the given indices.

§Safety

The behavior is undefined if any of the following conditions are violated:

  • row < self.nrows().
  • col < self.ncols().
Source

pub fn read(&self, row: usize, col: usize) -> E

Reads the value of the element at the given indices, with bound checks.

§Panics

The function panics if any of the following conditions are violated:

  • row < self.nrows().
  • col < self.ncols().
Source

pub unsafe fn write_unchecked(&mut self, row: usize, col: usize, value: E)

Writes the value to the element at the given indices.

§Safety

The behavior is undefined if any of the following conditions are violated:

  • row < self.nrows().
  • col < self.ncols().
Source

pub fn write(&mut self, row: usize, col: usize, value: E)

Writes the value to the element at the given indices, with bound checks.

§Panics

The function panics if any of the following conditions are violated:

  • row < self.nrows().
  • col < self.ncols().
Source

pub fn copy_from_triangular_lower(&mut self, other: impl AsMatRef<E>)

Copies the values from the lower triangular part of other into the lower triangular part of self. The diagonal part is included.

§Panics

The function panics if any of the following conditions are violated:

  • self.nrows() == other.nrows().
  • self.ncols() == other.ncols().
  • self.nrows() == self.ncols().
Source

pub fn copy_from_strict_triangular_lower(&mut self, other: impl AsMatRef<E>)

Copies the values from the lower triangular part of other into the lower triangular part of self. The diagonal part is excluded.

§Panics

The function panics if any of the following conditions are violated:

  • self.nrows() == other.nrows().
  • self.ncols() == other.ncols().
  • self.nrows() == self.ncols().
Source

pub fn copy_from_triangular_upper(&mut self, other: impl AsMatRef<E>)

Copies the values from the upper triangular part of other into the upper triangular part of self. The diagonal part is included.

§Panics

The function panics if any of the following conditions are violated:

  • self.nrows() == other.nrows().
  • self.ncols() == other.ncols().
  • self.nrows() == self.ncols().
Source

pub fn copy_from_strict_triangular_upper(&mut self, other: impl AsMatRef<E>)

Copies the values from the upper triangular part of other into the upper triangular part of self. The diagonal part is excluded.

§Panics

The function panics if any of the following conditions are violated:

  • self.nrows() == other.nrows().
  • self.ncols() == other.ncols().
  • self.nrows() == self.ncols().
Source

pub fn copy_from(&mut self, other: impl AsMatRef<E>)

Copies the values from other into self.

§Panics

The function panics if any of the following conditions are violated:

  • self.nrows() == other.nrows().
  • self.ncols() == other.ncols().
Source

pub fn fill_zero(&mut self)
where E: ComplexField,

Fills the elements of self with zeros.

Source

pub fn fill(&mut self, constant: E)

Fills the elements of self with copies of constant.

Source

pub fn transpose_mut(self) -> Self

Returns a view over the transpose of self.

§Example
use faer_core::mat;

let mut matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_mut();
let transpose = view.transpose_mut();

let mut expected = mat![[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]];
assert_eq!(expected.as_mut(), transpose);
Source

pub fn conjugate_mut(self) -> MatMut<'a, E::Conj>
where E: Conjugate,

Returns a view over the conjugate of self.

Source

pub fn adjoint_mut(self) -> MatMut<'a, E::Conj>
where E: Conjugate,

Returns a view over the conjugate transpose of self.

Source

pub fn canonicalize_mut(self) -> (MatMut<'a, E::Canonical>, Conj)
where E: Conjugate,

Returns a view over the canonical representation of self, as well as a flag declaring whether self is implicitly conjugated or not.

Source

pub fn reverse_rows_mut(self) -> Self

Returns a view over the self, with the rows in reversed order.

§Example
use faer_core::mat;

let mut matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_mut();
let reversed_rows = view.reverse_rows_mut();

let mut expected = mat![[4.0, 5.0, 6.0], [1.0, 2.0, 3.0]];
assert_eq!(expected.as_mut(), reversed_rows);
Source

pub fn reverse_cols_mut(self) -> Self

Returns a view over the self, with the columns in reversed order.

§Example
use faer_core::mat;

let mut matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_mut();
let reversed_cols = view.reverse_cols_mut();

let mut expected = mat![[3.0, 2.0, 1.0], [6.0, 5.0, 4.0]];
assert_eq!(expected.as_mut(), reversed_cols);
Source

pub fn reverse_rows_and_cols_mut(self) -> Self

Returns a view over the self, with the rows and the columns in reversed order.

§Example
use faer_core::mat;

let mut matrix = mat![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let view = matrix.as_mut();
let reversed = view.reverse_rows_and_cols_mut();

let mut expected = mat![[6.0, 5.0, 4.0], [3.0, 2.0, 1.0]];
assert_eq!(expected.as_mut(), reversed);
Source

pub fn submatrix_mut( self, row_start: usize, col_start: usize, nrows: usize, ncols: usize, ) -> Self

Returns a view over the submatrix starting at indices (row_start, col_start), and with dimensions (nrows, ncols).

§Panics

The function panics if any of the following conditions are violated:

  • row_start <= self.nrows().
  • col_start <= self.ncols().
  • nrows <= self.nrows() - row_start.
  • ncols <= self.ncols() - col_start.
§Example
use faer_core::mat;

let mut matrix = mat![
    [1.0, 5.0, 9.0],
    [2.0, 6.0, 10.0],
    [3.0, 7.0, 11.0],
    [4.0, 8.0, 12.0f64],
];

let view = matrix.as_mut();
let submatrix = view.submatrix_mut(2, 1, 2, 2);

let mut expected = mat![[7.0, 11.0], [8.0, 12.0f64]];
assert_eq!(expected.as_mut(), submatrix);
Source

pub fn subrows_mut(self, row_start: usize, nrows: usize) -> Self

Returns a view over the submatrix starting at row row_start, and with number of rows nrows.

§Panics

The function panics if any of the following conditions are violated:

  • row_start <= self.nrows().
  • nrows <= self.nrows() - row_start.
§Example
use faer_core::mat;

let mut matrix = mat![
    [1.0, 5.0, 9.0],
    [2.0, 6.0, 10.0],
    [3.0, 7.0, 11.0],
    [4.0, 8.0, 12.0f64],
];

let view = matrix.as_mut();
let subrows = view.subrows_mut(1, 2);

let mut expected = mat![[2.0, 6.0, 10.0], [3.0, 7.0, 11.0],];
assert_eq!(expected.as_mut(), subrows);
Source

pub fn subcols_mut(self, col_start: usize, ncols: usize) -> Self

Returns a view over the submatrix starting at column col_start, and with number of columns ncols.

§Panics

The function panics if any of the following conditions are violated:

  • col_start <= self.ncols().
  • ncols <= self.ncols() - col_start.
§Example
use faer_core::mat;

let mut matrix = mat![
    [1.0, 5.0, 9.0],
    [2.0, 6.0, 10.0],
    [3.0, 7.0, 11.0],
    [4.0, 8.0, 12.0f64],
];

let view = matrix.as_mut();
let subcols = view.subcols_mut(2, 1);

let mut expected = mat![[9.0], [10.0], [11.0], [12.0f64]];
assert_eq!(expected.as_mut(), subcols);
Source

pub fn row_mut(self, row_idx: usize) -> RowMut<'a, E>

Returns a view over the row at the given index.

§Panics

The function panics if any of the following conditions are violated:

  • row_idx < self.nrows().
Source

pub fn col_mut(self, col_idx: usize) -> ColMut<'a, E>

Returns a view over the column at the given index.

§Panics

The function panics if any of the following conditions are violated:

  • col_idx < self.ncols().
Source

pub fn column_vector_as_diagonal_mut(self) -> Matrix<DiagMut<'a, E>>

Given a matrix with a single column, returns an object that interprets the column as a diagonal matrix, whoes diagonal elements are values in the column.

Source

pub fn diagonal_mut(self) -> Matrix<DiagMut<'a, E>>

Returns the diagonal of the matrix.

Source

pub fn to_owned(&self) -> Mat<E::Canonical>
where E: Conjugate,

Returns an owning Mat of the data

Source

pub fn has_nan(&self) -> bool
where E: ComplexField,

Returns true if any of the elements is NaN, otherwise returns false.

Source

pub fn is_all_finite(&self) -> bool
where E: ComplexField,

Returns true if all of the elements are finite, otherwise returns false.

Source

pub fn norm_max(&self) -> E::Real
where E: ComplexField,

Returns the maximum norm of self.

Source

pub fn norm_l2(&self) -> E::Real
where E: ComplexField,

Returns the L2 norm of self.

Source

pub fn sum(&self) -> E
where E: ComplexField,

Returns the sum of self.

Source

pub fn kron(&self, rhs: impl As2D<E>) -> Mat<E>
where E: ComplexField,

Kroneckor product of self and rhs.

This is an allocating operation; see kron for the allocation-free version or more info in general.

Source

pub fn as_ref(&self) -> MatRef<'_, E>

Returns a view over the matrix.

Source

pub fn as_mut(&mut self) -> MatMut<'_, E>

Returns a mutable view over the matrix.

Source

pub fn col_chunks_mut( self, chunk_size: usize, ) -> impl 'a + DoubleEndedIterator<Item = MatMut<'a, E>>

Returns an iterator that provides successive chunks of the columns of this matrix, with each having at most chunk_size columns.

If the number of columns is a multiple of chunk_size, then all chunks have chunk_size columns.

Source

pub fn row_chunks_mut( self, chunk_size: usize, ) -> impl 'a + DoubleEndedIterator<Item = MatMut<'a, E>>

Returns an iterator that provides successive chunks of the rows of this matrix, with each having at most chunk_size rows.

If the number of rows is a multiple of chunk_size, then all chunks have chunk_size rows.

Source

pub fn par_col_chunks_mut( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatMut<'a, E>>

Available on crate feature rayon only.

Returns a parallel iterator that provides successive chunks of the columns of this matrix, with each having at most chunk_size columns.

If the number of columns is a multiple of chunk_size, then all chunks have chunk_size columns.

Only available with the rayon feature.

Source

pub fn par_row_chunks_mut( self, chunk_size: usize, ) -> impl 'a + IndexedParallelIterator<Item = MatMut<'a, E>>

Available on crate feature rayon only.

Returns a parallel iterator that provides successive chunks of the rows of this matrix, with each having at most chunk_size rows.

If the number of rows is a multiple of chunk_size, then all chunks have chunk_size rows.

Only available with the rayon feature.

Source§

impl<'a, E: RealField> MatMut<'a, Complex<E>>

Source

pub fn real_imag_mut(self) -> Complex<MatMut<'a, E>>

Returns the real and imaginary components of self.

Trait Implementations§

Source§

impl<E: Entity> As2D<E> for &MatMut<'_, E>

Source§

fn as_2d_ref(&self) -> MatRef<'_, E>

Convert to a 2D matrix view.
Source§

impl<E: Entity> As2D<E> for MatMut<'_, E>

Source§

fn as_2d_ref(&self) -> MatRef<'_, E>

Convert to a 2D matrix view.
Source§

impl<E: Entity> As2DMut<E> for &mut MatMut<'_, E>

Source§

fn as_2d_mut(&mut self) -> MatMut<'_, E>

Convert to a mutable 2D matrix view.
Source§

impl<E: Entity> As2DMut<E> for MatMut<'_, E>

Source§

fn as_2d_mut(&mut self) -> MatMut<'_, E>

Convert to a mutable 2D matrix view.
Source§

impl<E: Entity> AsMatMut<E> for &mut MatMut<'_, E>

Source§

fn as_mat_mut(&mut self) -> MatMut<'_, E>

Convert to a mutable matrix view.
Source§

impl<E: Entity> AsMatMut<E> for MatMut<'_, E>

Source§

fn as_mat_mut(&mut self) -> MatMut<'_, E>

Convert to a mutable matrix view.
Source§

impl<E: Entity> AsMatRef<E> for &MatMut<'_, E>

Source§

fn as_mat_ref(&self) -> MatRef<'_, E>

Convert to a matrix view.
Source§

impl<E: Entity> AsMatRef<E> for MatMut<'_, E>

Source§

fn as_mat_ref(&self) -> MatRef<'_, E>

Convert to a matrix view.
Source§

impl<'a, FromE: Entity, ToE: Entity> Coerce<Matrix<DenseMut<'a, ToE>>> for MatMut<'a, FromE>

Source§

fn coerce(self) -> MatMut<'a, ToE>

Source§

impl<'a, E: Entity> Debug for MatMut<'a, E>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<E: Entity> DenseAccess<E> for MatMut<'_, E>

Available on crate feature std only.
Source§

fn fetch_single(&self, row: usize, col: usize) -> E

Source§

impl<E: SimpleEntity> Index<(usize, usize)> for MatMut<'_, E>

Source§

type Output = E

The returned type after indexing.
Source§

fn index(&self, (row, col): (usize, usize)) -> &E

Performs the indexing (container[index]) operation. Read more
Source§

impl<E: SimpleEntity> IndexMut<(usize, usize)> for MatMut<'_, E>

Source§

fn index_mut(&mut self, (row, col): (usize, usize)) -> &mut E

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, E: Entity> IntoConst for MatMut<'a, E>

Source§

type Target = Matrix<DenseRef<'a, E>>

Source§

fn into_const(self) -> Self::Target

Source§

impl<'a, E: Entity> MatIndex<'a> for MatMut<'_, E>

Source§

type Item = ReadWrite<'a, E>

Item produced by the zipped views.
Source§

unsafe fn get_unchecked(&'a mut self, (i, j): Self::Index) -> Self::Item

Get the item at the given index, skipping bound checks.
Source§

unsafe fn get_from_slice_unchecked( slice: &'a mut Self::Slice, idx: usize, ) -> Self::Item

Get the item at the given slice position, skipping bound checks.
Source§

fn is_contiguous(&self) -> bool

Checks if the zipped matrices are contiguous.
Source§

fn preferred_layout(&self) -> Self::LayoutTransform

Computes the preferred iteration layout of the matrices.
Source§

fn with_layout(self, layout: Self::LayoutTransform) -> Self

Applies the layout transformation to the matrices.
Source§

impl<E: Entity> MatIndex<Range<usize>, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: Range<usize>, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<Range<usize>, usize> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: Range<usize>, col: usize) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeFrom<usize>, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeFrom<usize>, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeFrom<usize>, usize> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeFrom<usize>, col: usize) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeFull, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeFull, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<'a, E: Entity> MatIndex<RangeFull, usize> for MatMut<'a, E>

Source§

type Target = Matrix<DenseColMut<'a, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeFull, col: usize) -> Self::Target

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeInclusive<usize>, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeInclusive<usize>, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeInclusive<usize>, usize> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeInclusive<usize>, col: usize) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeTo<usize>, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeTo<usize>, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeTo<usize>, usize> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeTo<usize>, col: usize) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeToInclusive<usize>, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeToInclusive<usize>, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<RangeToInclusive<usize>, usize> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: RangeToInclusive<usize>, col: usize) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity, RowRange> MatIndex<RowRange, RangeFrom<usize>> for MatMut<'_, E>
where Self: MatIndex<RowRange, Range<usize>>,

Source§

type Target = <Matrix<DenseMut<'_, E>> as MatIndex<RowRange, Range<usize>>>::Target

Resulting type of the indexing operation.
Source§

fn get( this: Self, row: RowRange, col: RangeFrom<usize>, ) -> <Self as MatIndex<RowRange, Range<usize>>>::Target

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity, RowRange> MatIndex<RowRange, RangeFull> for MatMut<'_, E>
where Self: MatIndex<RowRange, Range<usize>>,

Source§

type Target = <Matrix<DenseMut<'_, E>> as MatIndex<RowRange, Range<usize>>>::Target

Resulting type of the indexing operation.
Source§

fn get( this: Self, row: RowRange, col: RangeFull, ) -> <Self as MatIndex<RowRange, Range<usize>>>::Target

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity, RowRange> MatIndex<RowRange, RangeInclusive<usize>> for MatMut<'_, E>
where Self: MatIndex<RowRange, Range<usize>>,

Source§

type Target = <Matrix<DenseMut<'_, E>> as MatIndex<RowRange, Range<usize>>>::Target

Resulting type of the indexing operation.
Source§

fn get( this: Self, row: RowRange, col: RangeInclusive<usize>, ) -> <Self as MatIndex<RowRange, Range<usize>>>::Target

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity, RowRange> MatIndex<RowRange, RangeTo<usize>> for MatMut<'_, E>
where Self: MatIndex<RowRange, Range<usize>>,

Source§

type Target = <Matrix<DenseMut<'_, E>> as MatIndex<RowRange, Range<usize>>>::Target

Resulting type of the indexing operation.
Source§

fn get( this: Self, row: RowRange, col: RangeTo<usize>, ) -> <Self as MatIndex<RowRange, Range<usize>>>::Target

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity, RowRange> MatIndex<RowRange, RangeToInclusive<usize>> for MatMut<'_, E>
where Self: MatIndex<RowRange, Range<usize>>,

Source§

type Target = <Matrix<DenseMut<'_, E>> as MatIndex<RowRange, Range<usize>>>::Target

Resulting type of the indexing operation.
Source§

fn get( this: Self, row: RowRange, col: RangeToInclusive<usize>, ) -> <Self as MatIndex<RowRange, Range<usize>>>::Target

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<E: Entity> MatIndex<usize, Range<usize>> for MatMut<'_, E>

Source§

type Target = Matrix<DenseMut<'_, E>>

Resulting type of the indexing operation.
Source§

fn get(this: Self, row: usize, col: Range<usize>) -> Self

Index the matrix at (row, col).
Source§

unsafe fn get_unchecked( this: Self, row: RowRange, col: ColRange, ) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

impl<'a, E: Entity> MatIndex<usize, usize> for MatMut<'a, E>

Source§

type Target = <<E as Entity>::Group as ForType>::FaerOf<&'a mut <E as Entity>::Unit>

Resulting type of the indexing operation.
Source§

unsafe fn get_unchecked(this: Self, row: usize, col: usize) -> Self::Target

Index the matrix at (row, col), without bound checks.
Source§

fn get(this: Self, row: usize, col: usize) -> Self::Target

Index the matrix at (row, col).
Source§

impl<E: Entity> MatShape for MatMut<'_, E>

Source§

type Rows = usize

Type of rows.
Source§

type Cols = usize

Type of columns.
Source§

fn nrows(&self) -> Self::Rows

Returns the number of rows.
Source§

fn ncols(&self) -> Self::Cols

Returns the number of columns.
Source§

impl<E: Entity> Matrix<E> for MatMut<'_, E>

Available on crate feature std only.
Source§

fn rows(&self) -> usize

Source§

fn cols(&self) -> usize

Source§

fn access(&self) -> Access<'_, E>

Expose dense or sparse access to the matrix.
Source§

impl<E: Entity> MaybeContiguous for MatMut<'_, E>

Source§

type Index = (usize, usize)

Indexing type.
Source§

type Slice = <<E as Entity>::Group as ForType>::FaerOf<&'static mut [MaybeUninit<<E as Entity>::Unit>]>

Contiguous slice type.
Source§

type LayoutTransform = MatLayoutTransform

Layout transformation type.
Source§

unsafe fn get_slice_unchecked( &mut self, (i, j): Self::Index, n_elems: usize, ) -> Self::Slice

Returns slice at index of length n_elems.
Source§

impl<'short, 'a, E: Entity> Reborrow<'short> for MatMut<'a, E>

Source§

type Target = Matrix<DenseRef<'short, E>>

Source§

fn rb(&'short self) -> Self::Target

Source§

impl<'short, 'a, E: Entity> ReborrowMut<'short> for MatMut<'a, E>

Source§

type Target = Matrix<DenseMut<'short, E>>

Source§

fn rb_mut(&'short mut self) -> Self::Target

Source§

impl<E: Entity> ViewMut for &MatMut<'_, E>

Source§

type Target<'a> = Matrix<DenseRef<'a, E>> where Self: 'a

View type.
Source§

fn view_mut(&mut self) -> Self::Target<'_>

Returns the view over self.
Source§

impl<E: Entity> ViewMut for &mut MatMut<'_, E>

Source§

type Target<'a> = Matrix<DenseMut<'a, E>> where Self: 'a

View type.
Source§

fn view_mut(&mut self) -> Self::Target<'_>

Returns the view over self.
Source§

impl<E: Entity> ViewMut for MatMut<'_, E>

Source§

type Target<'a> = Matrix<DenseMut<'a, E>> where Self: 'a

View type.
Source§

fn view_mut(&mut self) -> Self::Target<'_>

Returns the view over self.