Struct stack_algebra::Matrix

source ·
#[repr(C)]
pub struct Matrix<const M: usize, const N: usize, T = f32> { /* private fields */ }
Expand description

Represents a matrix with constant M rows and constant N columns.

The underlying data is represented as an array and is always stored in column-major order.

See the crate root for usage examples.

Implementations§

Views the underlying data as a contiguous slice.

Views the underlying data as a contiguous mutable slice.

Returns a reference to the i-th row of this matrix.

Returns a mutable reference to the i-th row of this matrix.

Returns a reference to the i-th column of this matrix.

Returns a mutable reference to the i-th column of this matrix.

Returns a reference to an element in the matrix or None if out of bounds.

Returns a mutable reference to an element in the matrix or None if out of bounds.

Returns a reference to an element in the matrix without doing any bounds checking.

Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

Returns a mutable reference to an element in the matrix without doing any bounds checking.

Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

Returns an iterator over the underlying data.

Returns a mutable iterator over the underlying data.

Swap the two given rows of this matrix

Swap the two given columns of this matrix

Transpose of the current matrix.

Transpose of the current matrix.

Compute the Frobenius norm

Compute the Frobenius norm

Compute the sum of diagonal elements

Trait Implementations§

Used for specifying relative comparisons.
The default tolerance to use when testing values that are close together. Read more
A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
The inverse of AbsDiffEq::abs_diff_eq.
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Performs the /= operation. Read more
Performs the /= operation. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Create a new matrix from an iterator.

Elements will be filled in column-major order.

Panics

If the iterator doesn’t yield enough elements to fill the matrix.

Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more
The output type returned by methods.
Returns a shared reference to the output at this location, if in bounds.
Returns a mutable reference to the output at this location, if in bounds.
Returns a shared reference to the output at this location, without performing any bounds checking. Read more
Returns a mutable reference to the output at this location, without performing any bounds checking. Read more
Returns a shared reference to the output at this location, panicking if out of bounds.
Returns a mutable reference to the output at this location, panicking if out of bounds.
The output type returned by methods.
Returns a shared reference to the output at this location, if in bounds.
Returns a mutable reference to the output at this location, if in bounds.
Returns a shared reference to the output at this location, without performing any bounds checking. Read more
Returns a mutable reference to the output at this location, without performing any bounds checking. Read more
Returns a shared reference to the output at this location, panicking if out of bounds.
Returns a mutable reference to the output at this location, panicking if out of bounds.
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
The resulting type after applying the ! operator.
Performs the unary ! operation. Read more
The resulting type after applying the ! operator.
Performs the unary ! operation. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
The default relative tolerance for testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
The inverse of RelativeEq::relative_eq.
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
Performs the %= operation. Read more
Performs the %= operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
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.