pub struct MatrixSliceMut<'a, T: 'a> { /* private fields */ }
Expand description

A mutable MatrixSliceMut

This struct provides a mutable slice into a matrix.

The struct contains the upper left point of the slice and the width and height of the slice.

Implementations

Produce a MatrixSliceMut from a mutable Matrix

Examples
use rulinalg::matrix::{Matrix, MatrixSliceMut};

let mut a = Matrix::new(3,3, (0..9).collect::<Vec<usize>>());
let slice = MatrixSliceMut::from_matrix(&mut a, [1,1], 2, 2);

Creates a MatrixSliceMut from raw parts.

Examples
use rulinalg::matrix::MatrixSliceMut;

let mut a = vec![4.0; 16];

unsafe {
    // Create a mutable matrix slice with 3 rows, and 3 cols
    // The row stride of 4 specifies the distance between the start of each row in the data.
    let b = MatrixSliceMut::from_raw_parts(a.as_mut_ptr(), 3, 3, 4);
}
Safety

The pointer must be followed by a contiguous slice of data larger than row_stride * rows. If not then other operations will produce undefined behaviour.

Additionally cols should be less than the row_stride. It is possible to use this function safely whilst violating this condition. So long as max(cols, row_stride) * rows is less than the data size.

Trait Implementations

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Scalar addition with matrix slice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Scalar addition with matrix slice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between Matrix and MatrixSlice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition between the slices.

The resulting type after applying the + operator.
Performs the + operation. Read more

Scalar addition with matrix slice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Scalar addition with matrix slice.

The resulting type after applying the + operator.
Performs the + operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs addition assignment between a mutable matrix slice and a scalar.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs elementwise addition assignment between two matrices.

Performs the += operation. Read more

Performs addition assignment between a mutable matrix slice and a scalar.

Performs the += operation. Read more
Rows in the matrix.
Columns in the matrix.
Row stride in the matrix.
Top left index of the matrix.
Returns true if the matrix contais no elements
Returns a MatrixSlice over the whole matrix. Read more
Get a reference to an element in the matrix without bounds checking.
Get a reference to an element in the matrix. Read more
Returns the column of a matrix at the given index. None if the index is out of bounds. Read more
Returns the column of a matrix at the given index without doing a bounds check. Read more
Returns the row of a matrix at the given index. Read more
Returns the row of a matrix at the given index without doing unbounds checking Read more
Returns an iterator over the matrix data. Read more
Iterate over the columns of the matrix. Read more
Iterate over the rows of the matrix. Read more
Iterate over diagonal entries Read more
Compute the metric distance between two matrices. Read more
Extract the diagonal of the matrix Read more
Split the matrix at the specified axis returning two MatrixSlices. Read more
Produce a MatrixSlice from an existing matrix. Read more

Top left index of the slice.

Returns a MatrixSliceMut over the whole matrix. Read more
Get a mutable reference to an element in the matrix without bounds checks.
Get a mutable reference to an element in the matrix. Read more
Returns a mutable iterator over the matrix. Read more
Returns a mutable reference to the column of a matrix at the given index. None if the index is out of bounds. Read more
Returns a mutable reference to the column of a matrix at the given index without doing a bounds check. Read more
Returns a mutable reference to the row of a matrix at the given index. None if the index is out of bounds. Read more
Returns a mutable reference to the row of a matrix at the given index without doing a bounds check. Read more
Swaps two rows in a matrix. Read more
Swaps two columns in a matrix. Read more
Iterate over the mutable columns of the matrix. Read more
Iterate over the mutable rows of the matrix. Read more
Iterate over diagonal entries mutably Read more
Split the matrix at the specified axis returning two MatrixSliceMuts. Read more
Produce a MatrixSliceMut from an existing matrix. Read more
Formats the value using the given formatter. Read more

Scalar division with matrix slice.

The resulting type after applying the / operator.
Performs the / operation. Read more

Scalar division with matrix slice.

The resulting type after applying the / operator.
Performs the / operation. Read more

Scalar division with matrix slice.

The resulting type after applying the / operator.
Performs the / operation. Read more

Scalar division with matrix slice.

The resulting type after applying the / operator.
Performs the / operation. Read more

Performs division assignment between a mutable matrix slice and a scalar.

Performs the /= operation. Read more

Performs division assignment between a mutable matrix slice and a scalar.

Performs the /= operation. Read more
Converts to this type from the input type.

Indexes mutable matrix slice. Takes row index first then column.

The returned type after indexing.
Performs the indexing (container[index]) operation. Read more

Indexes mutable matrix slice.

Takes row index first then column.

Performs the mutable indexing (container[index]) operation. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more

Left-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Left-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Right-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Right-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Scalar multiplication with matrix slice.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Scalar multiplication with matrix slice.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Multiplies two matrices together.

The resulting type after applying the * operator.
Performs the * operation. Read more

Left-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Left-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Right-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Right-multiply a matrix by a permutation matrix.

The resulting type after applying the * operator.
Performs the * operation. Read more

Scalar multiplication with matrix slice.

The resulting type after applying the * operator.
Performs the * operation. Read more

Scalar multiplication with matrix slice.

The resulting type after applying the * operator.
Performs the * operation. Read more

Performs multiplication assignment between a mutable matrix slice and a scalar.

Performs the *= operation. Read more

Performs multiplication assignment between a mutable matrix slice and a scalar.

Performs the *= operation. Read more

Gets negative of matrix slice.

The resulting type after applying the - operator.
Performs the unary - operation. Read more

Gets negative of matrix slice.

The resulting type after applying the - operator.
Performs the unary - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Scalar subtraction with matrix slice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Scalar subtraction with matrix slice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between Matrix and MatrixSlice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction between the slices.

The resulting type after applying the - operator.
Performs the - operation. Read more

Scalar subtraction with matrix slice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Scalar subtraction with matrix slice.

The resulting type after applying the - operator.
Performs the - operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs subtraction assignment between a mutable matrix slice and a scalar.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs elementwise subtraction assignment between two matrices.

Performs the -= operation. Read more

Performs subtraction assignment between a mutable matrix slice and a scalar.

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.