Struct faer_core::MatMut

source ·
pub struct MatMut<'a, T> { /* private fields */ }
Expand description

Mutable matrix view with general row and column strides.

For usage examples, see MatRef.

Implementations

Returns a mutable matrix slice from the given arguments.
ptr: pointer to the first element of the matrix.
nrows: number of rows of the matrix.
ncols: number of columns of the matrix.
row_stride: offset between the first elements of two successive rows in the matrix. col_stride: offset between the first elements of two successive columns in the matrix.

Safety

ptr must be non null and properly aligned for type T.
For each i < nrows and j < ncols,
ptr.offset(i as isize * row_stride + j as isize * col_stride) must point to a valid initialized object of type T, unless memory pointing to that address is never read. Additionally, when (i, j) != (0, 0), this pointer is never equal to ptr (no self aliasing).
The referenced memory must not be accessed by another pointer which was not derived from the return value, during the lifetime 'a.

Returns a mutable pointer to the first (top left) element of the matrix.

Returns the number of rows of the matrix.

Returns the number of columns of the matrix.

Returns the offset between the first elements of two successive rows in the matrix.

Returns the offset between the first elements of two successive columns in the matrix.

Returns a mutable pointer to the element at position (i, j) in the matrix.

Returns a mutable pointer to the element at position (i, j) in the matrix, assuming it falls within its bounds with no bound checks.

Safety

Requires that i < self.nrows() and j < self.ncols().

Otherwise, the behavior is undefined.

Returns a mutable pointer to the element at position (i, j) in the matrix, while asserting that it falls within its bounds.

Panics

Requires that i < self.nrows() and j < self.ncols().

Otherwise, it panics.

Splits the matrix into four corner parts in the following order: top left, top right, bottom left, bottom right.

Safety

Requires that i <= self.nrows() and j <= self.ncols().

Otherwise, the behavior is undefined.

Splits the matrix into four corner parts in the following order: top left, top right, bottom left, bottom right.

Panics

Requires that i <= self.nrows() and j <= self.ncols().

Otherwise, it panics.

Returns a mutable reference to the element at position (i, j), with no bound checks.

Safety

Requires that i < self.nrows() and j < self.ncols().

Otherwise, the behavior is undefined.

Returns a mutable reference to the element at position (i, j), or panics if the indices are out of bounds.

Returns the i-th row of the matrix, with no bound checks.

Safety

Requires that i < self.nrows().

Otherwise, the behavior is undefined.

Returns the i-th row of the matrix.

Panics

Requires that i < self.nrows().

Otherwise, it panics.

Returns the j-th column of the matrix, with no bound checks.

Safety

Requires that j < self.ncols().

Otherwise, the behavior is undefined.

Returns the j-th column of the matrix.

Panics

Requires that j < self.ncols().

Otherwise, it panics.

Returns the transpose of self.

Returns a matrix whose rows are the the rows of the input matrix in reverse order.

Returns a matrix whose columns are the the columns of the input matrix in reverse order.

Returns a matrix whose rows and columns are the the rows and columns of the input matrix in reverse order.

Returns the diagonal of the matrix, as a column vector.

Safety

Requires that the matrix be square.

Otherwise, the behavior is undefined.

Returns the diagonal of the matrix, as a column vector.

Panics

Requires that the matrix be square.

Otherwise, it panics.

Returns an iterator over the rows of the matrix.

Returns an iterator over the columns of the matrix.

Returns a view over a submatrix of self, starting at position (i, j) with dimensions (nrows, ncols).

Safety

Requires that i <= self.nrows(),
j <= self.ncols(),
nrows <= self.nrows() - i
and ncols <= self.ncols() - j.

Otherwise, the behavior is undefined.

Returns a view over a submatrix of self, starting at position (i, j) with dimensions (nrows, ncols).

Panics

Requires that i <= self.nrows(),
j <= self.ncols(),
nrows <= self.nrows() - i
and ncols <= self.ncols() - j.

Otherwise, it panics.

Returns a thin wrapper that can be used to execute coefficientwise operations on matrices.

Trait Implementations

Formats the value using the given formatter. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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 alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
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.