Matrix

Struct Matrix 

Source
pub struct Matrix<T, R, C, S> {
    pub data: S,
    /* private fields */
}
Expand description

The most generic column-major matrix (and vector) type.

ยงMethods summary

Because Matrix is the most generic types used as a common representation of all matrices and vectors of nalgebra this documentation page contains every single matrix/vector-related method. In order to make browsing this page simpler, the next subsections contain direct links to groups of methods related to a specific topic.

ยงVector and matrix construction
ยงComputer graphics utilities for transformations
ยงCommon math operations
ยงStatistics
ยงIteration, map, and fold
ยงVector and matrix views
ยงIn-place modification of a single matrix or vector
ยงVector and matrix size modification
ยงMatrix decomposition
ยงVector basis computation

ยงType parameters

The generic Matrix type has four type parameters:

  • T: for the matrix components scalar type.
  • R: for the matrix number of rows.
  • C: for the matrix number of columns.
  • S: for the matrix data storage, i.e., the buffer that actually contains the matrix components.

The matrix dimensions parameters R and C can either be:

  • type-level unsigned integer constants (e.g. U1, U124) from the nalgebra:: root module. All numbers from 0 to 127ย are defined that way.
  • type-level unsigned integer constants (e.g. U1024, U10000) from the typenum:: crate. Using those, you will not get error messages as nice as for numbers smaller than 128 defined on the nalgebra:: module.
  • the special value Dyn from the nalgebra:: root module. This indicates that the specified dimension is not known at compile-time. Note that this will generally imply that the matrix data storage S performs a dynamic allocation and contains extra metadata for the matrix shape.

Note that mixing Dyn with type-level unsigned integers is allowed. Actually, a dynamically-sized column vector should be represented as a Matrix<T, Dyn, U1, S> (given some concrete types for T and a compatible data storage type S).

Fieldsยง

ยงdata: S

The data storage that contains all the matrix components. Disappointed?

Well, if you came here to see how you can access the matrix components, you may be in luck: you can access the individual components of all vectors with compile-time dimensions <= 6 using field notation like this: vec.x, vec.y, vec.z, vec.w, vec.a, vec.b. Reference and assignation work too:

let mut vec = Vector3::new(1.0, 2.0, 3.0);
vec.x = 10.0;
vec.y += 30.0;
assert_eq!(vec.x, 10.0);
assert_eq!(vec.y + 100.0, 132.0);

Similarly, for matrices with compile-time dimensions <= 6, you can use field notation like this: mat.m11, mat.m42, etc. The first digit identifies the row to address and the second digit identifies the column to address. So mat.m13 identifies the component at the first row and third column (note that the count of rows and columns start at 1 instead of 0 here. This is so we match the mathematical notation).

For all matrices and vectors, independently from their size, individual components can be accessed and modified using indexing: vec[20], mat[(20, 19)]. Here the indexing starts at 0 as you would expect.

Implementationsยง

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงDot/scalar product

Source

pub fn dot<R2: Dim, C2: Dim, SB>(&self, rhs: &Matrix<T, R2, C2, SB>) -> T
where SB: RawStorage<T, R2, C2>, ShapeConstraint: DimEq<R, R2> + DimEq<C, C2>,

The dot product between two vectors or matrices (seen as vectors).

This is equal to self.transpose() * rhs. For the sesquilinear complex dot product, use self.dotc(rhs).

Note that this is not the matrix multiplication as in, e.g., numpy. For matrix multiplication, use one of: .gemm, .mul_to, .mul, the * operator.

ยงExample
let vec1 = Vector3::new(1.0, 2.0, 3.0);
let vec2 = Vector3::new(0.1, 0.2, 0.3);
assert_eq!(vec1.dot(&vec2), 1.4);

let mat1 = Matrix2x3::new(1.0, 2.0, 3.0,
                          4.0, 5.0, 6.0);
let mat2 = Matrix2x3::new(0.1, 0.2, 0.3,
                          0.4, 0.5, 0.6);
assert_eq!(mat1.dot(&mat2), 9.1);
Source

pub fn dotc<R2: Dim, C2: Dim, SB>(&self, rhs: &Matrix<T, R2, C2, SB>) -> T
where T: SimdComplexField, SB: RawStorage<T, R2, C2>, ShapeConstraint: DimEq<R, R2> + DimEq<C, C2>,

The conjugate-linear dot product between two vectors or matrices (seen as vectors).

This is equal to self.adjoint() * rhs. For real vectors, this is identical to self.dot(&rhs). Note that this is not the matrix multiplication as in, e.g., numpy. For matrix multiplication, use one of: .gemm, .mul_to, .mul, the * operator.

ยงExample
let vec1 = Vector2::new(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0));
let vec2 = Vector2::new(Complex::new(0.4, 0.3), Complex::new(0.2, 0.1));
assert_eq!(vec1.dotc(&vec2), Complex::new(2.0, -1.0));

// Note that for complex vectors, we generally have:
// vec1.dotc(&vec2) != vec2.dot(&vec2)
assert_ne!(vec1.dotc(&vec2), vec1.dot(&vec2));
Source

pub fn tr_dot<R2: Dim, C2: Dim, SB>(&self, rhs: &Matrix<T, R2, C2, SB>) -> T
where SB: RawStorage<T, R2, C2>, ShapeConstraint: DimEq<C, R2> + DimEq<R, C2>,

The dot product between the transpose of self and rhs.

ยงExample
let vec1 = Vector3::new(1.0, 2.0, 3.0);
let vec2 = RowVector3::new(0.1, 0.2, 0.3);
assert_eq!(vec1.tr_dot(&vec2), 1.4);

let mat1 = Matrix2x3::new(1.0, 2.0, 3.0,
                          4.0, 5.0, 6.0);
let mat2 = Matrix3x2::new(0.1, 0.4,
                          0.2, 0.5,
                          0.3, 0.6);
assert_eq!(mat1.tr_dot(&mat2), 9.1);
Sourceยง

impl<T, D: Dim, S> Matrix<T, D, Const<1>, S>

ยงBLAS functions

Source

pub fn axcpy<D2: Dim, SB>(&mut self, a: T, x: &Vector<T, D2, SB>, c: T, b: T)
where SB: Storage<T, D2>, ShapeConstraint: DimEq<D, D2>,

Computes self = a * x * c + b * self.

If b is zero, self is never read from.

ยงExample
let mut vec1 = Vector3::new(1.0, 2.0, 3.0);
let vec2 = Vector3::new(0.1, 0.2, 0.3);
vec1.axcpy(5.0, &vec2, 2.0, 5.0);
assert_eq!(vec1, Vector3::new(6.0, 12.0, 18.0));
Source

pub fn axpy<D2: Dim, SB>(&mut self, a: T, x: &Vector<T, D2, SB>, b: T)
where T: One, SB: Storage<T, D2>, ShapeConstraint: DimEq<D, D2>,

Computes self = a * x + b * self.

If b is zero, self is never read from.

ยงExample
let mut vec1 = Vector3::new(1.0, 2.0, 3.0);
let vec2 = Vector3::new(0.1, 0.2, 0.3);
vec1.axpy(10.0, &vec2, 5.0);
assert_eq!(vec1, Vector3::new(6.0, 12.0, 18.0));
Source

pub fn gemv<R2: Dim, C2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, x: &Vector<T, D3, SC>, beta: T, )
where T: One, SB: Storage<T, R2, C2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<D, R2> + AreMultipliable<R2, C2, D3, U1>,

Computes self = alpha * a * x + beta * self, where a is a matrix, x a vector, and alpha, beta two scalars.

If beta is zero, self is never read.

ยงExample
let mut vec1 = Vector2::new(1.0, 2.0);
let vec2 = Vector2::new(0.1, 0.2);
let mat = Matrix2::new(1.0, 2.0,
                       3.0, 4.0);
vec1.gemv(10.0, &mat, &vec2, 5.0);
assert_eq!(vec1, Vector2::new(10.0, 21.0));
Source

pub fn sygemv<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, a: &SquareMatrix<T, D2, SB>, x: &Vector<T, D3, SC>, beta: T, )
where T: One, SB: Storage<T, D2, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<D, D2> + AreMultipliable<D2, D2, D3, U1>,

Computes self = alpha * a * x + beta * self, where a is a symmetric matrix, x a vector, and alpha, beta two scalars.

For hermitian matrices, use .hegemv instead. If beta is zero, self is never read. If self is read, only its lower-triangular part (including the diagonal) is actually read.

ยงExamples
let mat = Matrix2::new(1.0, 2.0,
                       2.0, 4.0);
let mut vec1 = Vector2::new(1.0, 2.0);
let vec2 = Vector2::new(0.1, 0.2);
vec1.sygemv(10.0, &mat, &vec2, 5.0);
assert_eq!(vec1, Vector2::new(10.0, 20.0));


// The matrix upper-triangular elements can be garbage because it is never
// read by this method. Therefore, it is not necessary for the caller to
// fill the matrix struct upper-triangle.
let mat = Matrix2::new(1.0, 9999999.9999999,
                       2.0, 4.0);
let mut vec1 = Vector2::new(1.0, 2.0);
vec1.sygemv(10.0, &mat, &vec2, 5.0);
assert_eq!(vec1, Vector2::new(10.0, 20.0));
Source

pub fn hegemv<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, a: &SquareMatrix<T, D2, SB>, x: &Vector<T, D3, SC>, beta: T, )
where T: SimdComplexField, SB: Storage<T, D2, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<D, D2> + AreMultipliable<D2, D2, D3, U1>,

Computes self = alpha * a * x + beta * self, where a is an hermitian matrix, x a vector, and alpha, beta two scalars.

If beta is zero, self is never read. If self is read, only its lower-triangular part (including the diagonal) is actually read.

ยงExamples
let mat = Matrix2::new(Complex::new(1.0, 0.0), Complex::new(2.0, -0.1),
                       Complex::new(2.0, 1.0), Complex::new(4.0, 0.0));
let mut vec1 = Vector2::new(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0));
let vec2 = Vector2::new(Complex::new(0.1, 0.2), Complex::new(0.3, 0.4));
vec1.sygemv(Complex::new(10.0, 20.0), &mat, &vec2, Complex::new(5.0, 15.0));
assert_eq!(vec1, Vector2::new(Complex::new(-48.0, 44.0), Complex::new(-75.0, 110.0)));


// The matrix upper-triangular elements can be garbage because it is never
// read by this method. Therefore, it is not necessary for the caller to
// fill the matrix struct upper-triangle.

let mat = Matrix2::new(Complex::new(1.0, 0.0), Complex::new(99999999.9, 999999999.9),
                       Complex::new(2.0, 1.0), Complex::new(4.0, 0.0));
let mut vec1 = Vector2::new(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0));
let vec2 = Vector2::new(Complex::new(0.1, 0.2), Complex::new(0.3, 0.4));
vec1.sygemv(Complex::new(10.0, 20.0), &mat, &vec2, Complex::new(5.0, 15.0));
assert_eq!(vec1, Vector2::new(Complex::new(-48.0, 44.0), Complex::new(-75.0, 110.0)));
Source

pub fn gemv_tr<R2: Dim, C2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, x: &Vector<T, D3, SC>, beta: T, )
where T: One, SB: Storage<T, R2, C2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<D, C2> + AreMultipliable<C2, R2, D3, U1>,

Computes self = alpha * a.transpose() * x + beta * self, where a is a matrix, x a vector, and alpha, beta two scalars.

If beta is zero, self is never read.

ยงExample
let mat = Matrix2::new(1.0, 3.0,
                       2.0, 4.0);
let mut vec1 = Vector2::new(1.0, 2.0);
let vec2 = Vector2::new(0.1, 0.2);
let expected = mat.transpose() * vec2 * 10.0 + vec1 * 5.0;

vec1.gemv_tr(10.0, &mat, &vec2, 5.0);
assert_eq!(vec1, expected);
Source

pub fn gemv_ad<R2: Dim, C2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, x: &Vector<T, D3, SC>, beta: T, )
where T: SimdComplexField, SB: Storage<T, R2, C2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<D, C2> + AreMultipliable<C2, R2, D3, U1>,

Computes self = alpha * a.adjoint() * x + beta * self, where a is a matrix, x a vector, and alpha, beta two scalars.

For real matrices, this is the same as .gemv_tr. If beta is zero, self is never read.

ยงExample
let mat = Matrix2::new(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0),
                       Complex::new(5.0, 6.0), Complex::new(7.0, 8.0));
let mut vec1 = Vector2::new(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0));
let vec2 = Vector2::new(Complex::new(0.1, 0.2), Complex::new(0.3, 0.4));
let expected = mat.adjoint() * vec2 * Complex::new(10.0, 20.0) + vec1 * Complex::new(5.0, 15.0);

vec1.gemv_ad(Complex::new(10.0, 20.0), &mat, &vec2, Complex::new(5.0, 15.0));
assert_eq!(vec1, expected);
Sourceยง

impl<T, R1: Dim, C1: Dim, S: StorageMut<T, R1, C1>> Matrix<T, R1, C1, S>

Source

pub fn ger<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, x: &Vector<T, D2, SB>, y: &Vector<T, D3, SC>, beta: T, )
where T: One, SB: Storage<T, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<R1, D2> + DimEq<C1, D3>,

Computes self = alpha * x * y.transpose() + beta * self.

If beta is zero, self is never read.

ยงExample
let mut mat = Matrix2x3::repeat(4.0);
let vec1 = Vector2::new(1.0, 2.0);
let vec2 = Vector3::new(0.1, 0.2, 0.3);
let expected = vec1 * vec2.transpose() * 10.0 + mat * 5.0;

mat.ger(10.0, &vec1, &vec2, 5.0);
assert_eq!(mat, expected);
Source

pub fn gerc<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, x: &Vector<T, D2, SB>, y: &Vector<T, D3, SC>, beta: T, )
where T: SimdComplexField, SB: Storage<T, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<R1, D2> + DimEq<C1, D3>,

Computes self = alpha * x * y.adjoint() + beta * self.

If beta is zero, self is never read.

ยงExample
let mut mat = Matrix2x3::repeat(Complex::new(4.0, 5.0));
let vec1 = Vector2::new(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0));
let vec2 = Vector3::new(Complex::new(0.6, 0.5), Complex::new(0.4, 0.5), Complex::new(0.2, 0.1));
let expected = vec1 * vec2.adjoint() * Complex::new(10.0, 20.0) + mat * Complex::new(5.0, 15.0);

mat.gerc(Complex::new(10.0, 20.0), &vec1, &vec2, Complex::new(5.0, 15.0));
assert_eq!(mat, expected);
Source

pub fn gemm<R2: Dim, C2: Dim, R3: Dim, C3: Dim, SB, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, b: &Matrix<T, R3, C3, SC>, beta: T, )
where T: One, SB: Storage<T, R2, C2>, SC: Storage<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C3> + AreMultipliable<R2, C2, R3, C3>,

Computes self = alpha * a * b + beta * self, where a, b, self are matrices. alpha and beta are scalar.

If beta is zero, self is never read.

ยงExample
let mut mat1 = Matrix2x4::identity();
let mat2 = Matrix2x3::new(1.0, 2.0, 3.0,
                          4.0, 5.0, 6.0);
let mat3 = Matrix3x4::new(0.1, 0.2, 0.3, 0.4,
                          0.5, 0.6, 0.7, 0.8,
                          0.9, 1.0, 1.1, 1.2);
let expected = mat2 * mat3 * 10.0 + mat1 * 5.0;

mat1.gemm(10.0, &mat2, &mat3, 5.0);
assert_relative_eq!(mat1, expected);
Source

pub fn gemm_tr<R2: Dim, C2: Dim, R3: Dim, C3: Dim, SB, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, b: &Matrix<T, R3, C3, SC>, beta: T, )
where T: One, SB: Storage<T, R2, C2>, SC: Storage<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, C2> + SameNumberOfColumns<C1, C3> + AreMultipliable<C2, R2, R3, C3>,

Computes self = alpha * a.transpose() * b + beta * self, where a, b, self are matrices. alpha and beta are scalar.

If beta is zero, self is never read.

ยงExample
let mut mat1 = Matrix2x4::identity();
let mat2 = Matrix3x2::new(1.0, 4.0,
                          2.0, 5.0,
                          3.0, 6.0);
let mat3 = Matrix3x4::new(0.1, 0.2, 0.3, 0.4,
                          0.5, 0.6, 0.7, 0.8,
                          0.9, 1.0, 1.1, 1.2);
let expected = mat2.transpose() * mat3 * 10.0 + mat1 * 5.0;

mat1.gemm_tr(10.0, &mat2, &mat3, 5.0);
assert_eq!(mat1, expected);
Source

pub fn gemm_ad<R2: Dim, C2: Dim, R3: Dim, C3: Dim, SB, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, b: &Matrix<T, R3, C3, SC>, beta: T, )
where T: SimdComplexField, SB: Storage<T, R2, C2>, SC: Storage<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, C2> + SameNumberOfColumns<C1, C3> + AreMultipliable<C2, R2, R3, C3>,

Computes self = alpha * a.adjoint() * b + beta * self, where a, b, self are matrices. alpha and beta are scalar.

If beta is zero, self is never read.

ยงExample
let mut mat1 = Matrix2x4::identity();
let mat2 = Matrix3x2::new(Complex::new(1.0, 4.0), Complex::new(7.0, 8.0),
                          Complex::new(2.0, 5.0), Complex::new(9.0, 10.0),
                          Complex::new(3.0, 6.0), Complex::new(11.0, 12.0));
let mat3 = Matrix3x4::new(Complex::new(0.1, 1.3), Complex::new(0.2, 1.4), Complex::new(0.3, 1.5), Complex::new(0.4, 1.6),
                          Complex::new(0.5, 1.7), Complex::new(0.6, 1.8), Complex::new(0.7, 1.9), Complex::new(0.8, 2.0),
                          Complex::new(0.9, 2.1), Complex::new(1.0, 2.2), Complex::new(1.1, 2.3), Complex::new(1.2, 2.4));
let expected = mat2.adjoint() * mat3 * Complex::new(10.0, 20.0) + mat1 * Complex::new(5.0, 15.0);

mat1.gemm_ad(Complex::new(10.0, 20.0), &mat2, &mat3, Complex::new(5.0, 15.0));
assert_eq!(mat1, expected);
Sourceยง

impl<T, R1: Dim, C1: Dim, S: StorageMut<T, R1, C1>> Matrix<T, R1, C1, S>

Source

pub fn ger_symm<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, x: &Vector<T, D2, SB>, y: &Vector<T, D3, SC>, beta: T, )
where T: One, SB: Storage<T, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<R1, D2> + DimEq<C1, D3>,

๐Ÿ‘ŽDeprecated: This is renamed syger to match the original BLAS terminology.

Computes self = alpha * x * y.transpose() + beta * self, where self is a symmetric matrix.

If beta is zero, self is never read. The result is symmetric. Only the lower-triangular (including the diagonal) part of self is read/written.

ยงExample
let mut mat = Matrix2::identity();
let vec1 = Vector2::new(1.0, 2.0);
let vec2 = Vector2::new(0.1, 0.2);
let expected = vec1 * vec2.transpose() * 10.0 + mat * 5.0;
mat.m12 = 99999.99999; // This component is on the upper-triangular part and will not be read/written.

mat.ger_symm(10.0, &vec1, &vec2, 5.0);
assert_eq!(mat.lower_triangle(), expected.lower_triangle());
assert_eq!(mat.m12, 99999.99999); // This was untouched.
Source

pub fn syger<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, x: &Vector<T, D2, SB>, y: &Vector<T, D3, SC>, beta: T, )
where T: One, SB: Storage<T, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<R1, D2> + DimEq<C1, D3>,

Computes self = alpha * x * y.transpose() + beta * self, where self is a symmetric matrix.

For hermitian complex matrices, use .hegerc instead. If beta is zero, self is never read. The result is symmetric. Only the lower-triangular (including the diagonal) part of self is read/written.

ยงExample
let mut mat = Matrix2::identity();
let vec1 = Vector2::new(1.0, 2.0);
let vec2 = Vector2::new(0.1, 0.2);
let expected = vec1 * vec2.transpose() * 10.0 + mat * 5.0;
mat.m12 = 99999.99999; // This component is on the upper-triangular part and will not be read/written.

mat.syger(10.0, &vec1, &vec2, 5.0);
assert_eq!(mat.lower_triangle(), expected.lower_triangle());
assert_eq!(mat.m12, 99999.99999); // This was untouched.
Source

pub fn hegerc<D2: Dim, D3: Dim, SB, SC>( &mut self, alpha: T, x: &Vector<T, D2, SB>, y: &Vector<T, D3, SC>, beta: T, )
where T: SimdComplexField, SB: Storage<T, D2>, SC: Storage<T, D3>, ShapeConstraint: DimEq<R1, D2> + DimEq<C1, D3>,

Computes self = alpha * x * y.adjoint() + beta * self, where self is an hermitian matrix.

If beta is zero, self is never read. The result is symmetric. Only the lower-triangular (including the diagonal) part of self is read/written.

ยงExample
let mut mat = Matrix2::identity();
let vec1 = Vector2::new(Complex::new(1.0, 3.0), Complex::new(2.0, 4.0));
let vec2 = Vector2::new(Complex::new(0.2, 0.4), Complex::new(0.1, 0.3));
let expected = vec1 * vec2.adjoint() * Complex::new(10.0, 20.0) + mat * Complex::new(5.0, 15.0);
mat.m12 = Complex::new(99999.99999, 88888.88888); // This component is on the upper-triangular part and will not be read/written.

mat.hegerc(Complex::new(10.0, 20.0), &vec1, &vec2, Complex::new(5.0, 15.0));
assert_eq!(mat.lower_triangle(), expected.lower_triangle());
assert_eq!(mat.m12, Complex::new(99999.99999, 88888.88888)); // This was untouched.
Sourceยง

impl<T, D1: Dim, S: StorageMut<T, D1, D1>> Matrix<T, D1, D1, S>

Source

pub fn quadform_tr_with_workspace<D2, S2, R3, C3, S3, D4, S4>( &mut self, work: &mut Vector<T, D2, S2>, alpha: T, lhs: &Matrix<T, R3, C3, S3>, mid: &SquareMatrix<T, D4, S4>, beta: T, )
where D2: Dim, R3: Dim, C3: Dim, D4: Dim, S2: StorageMut<T, D2>, S3: Storage<T, R3, C3>, S4: Storage<T, D4, D4>, ShapeConstraint: DimEq<D1, D2> + DimEq<D1, R3> + DimEq<D2, R3> + DimEq<C3, D4>,

Computes the quadratic form self = alpha * lhs * mid * lhs.transpose() + beta * self.

This uses the provided workspace work to avoid allocations for intermediate results.

ยงExample
// Note that all those would also work with statically-sized matrices.
// We use DMatrix/DVector since that's the only case where pre-allocating the
// workspace is actually useful (assuming the same workspace is re-used for
// several computations) because it avoids repeated dynamic allocations.
let mut mat = DMatrix::identity(2, 2);
let lhs = DMatrix::from_row_slice(2, 3, &[1.0, 2.0, 3.0,
                                          4.0, 5.0, 6.0]);
let mid = DMatrix::from_row_slice(3, 3, &[0.1, 0.2, 0.3,
                                          0.5, 0.6, 0.7,
                                          0.9, 1.0, 1.1]);
// The random shows that values on the workspace do not
// matter as they will be overwritten.
let mut workspace = DVector::new_random(2);
let expected = &lhs * &mid * lhs.transpose() * 10.0 + &mat * 5.0;

mat.quadform_tr_with_workspace(&mut workspace, 10.0, &lhs, &mid, 5.0);
assert_relative_eq!(mat, expected);
Source

pub fn quadform_tr<R3, C3, S3, D4, S4>( &mut self, alpha: T, lhs: &Matrix<T, R3, C3, S3>, mid: &SquareMatrix<T, D4, S4>, beta: T, )
where R3: Dim, C3: Dim, D4: Dim, S3: Storage<T, R3, C3>, S4: Storage<T, D4, D4>, ShapeConstraint: DimEq<D1, D1> + DimEq<D1, R3> + DimEq<C3, D4>, DefaultAllocator: Allocator<D1>,

Computes the quadratic form self = alpha * lhs * mid * lhs.transpose() + beta * self.

This allocates a workspace vector of dimension D1 for intermediate results. If D1 is a type-level integer, then the allocation is performed on the stack. Use .quadform_tr_with_workspace(...) instead to avoid allocations.

ยงExample
let mut mat = Matrix2::identity();
let lhs = Matrix2x3::new(1.0, 2.0, 3.0,
                         4.0, 5.0, 6.0);
let mid = Matrix3::new(0.1, 0.2, 0.3,
                       0.5, 0.6, 0.7,
                       0.9, 1.0, 1.1);
let expected = lhs * mid * lhs.transpose() * 10.0 + mat * 5.0;

mat.quadform_tr(10.0, &lhs, &mid, 5.0);
assert_relative_eq!(mat, expected);
Source

pub fn quadform_with_workspace<D2, S2, D3, S3, R4, C4, S4>( &mut self, work: &mut Vector<T, D2, S2>, alpha: T, mid: &SquareMatrix<T, D3, S3>, rhs: &Matrix<T, R4, C4, S4>, beta: T, )
where D2: Dim, D3: Dim, R4: Dim, C4: Dim, S2: StorageMut<T, D2>, S3: Storage<T, D3, D3>, S4: Storage<T, R4, C4>, ShapeConstraint: DimEq<D3, R4> + DimEq<D1, C4> + DimEq<D2, D3> + AreMultipliable<C4, R4, D2, U1>,

Computes the quadratic form self = alpha * rhs.transpose() * mid * rhs + beta * self.

This uses the provided workspace work to avoid allocations for intermediate results.

ยงExample
// Note that all those would also work with statically-sized matrices.
// We use DMatrix/DVector since that's the only case where pre-allocating the
// workspace is actually useful (assuming the same workspace is re-used for
// several computations) because it avoids repeated dynamic allocations.
let mut mat = DMatrix::identity(2, 2);
let rhs = DMatrix::from_row_slice(3, 2, &[1.0, 2.0,
                                          3.0, 4.0,
                                          5.0, 6.0]);
let mid = DMatrix::from_row_slice(3, 3, &[0.1, 0.2, 0.3,
                                          0.5, 0.6, 0.7,
                                          0.9, 1.0, 1.1]);
// The random shows that values on the workspace do not
// matter as they will be overwritten.
let mut workspace = DVector::new_random(3);
let expected = rhs.transpose() * &mid * &rhs * 10.0 + &mat * 5.0;

mat.quadform_with_workspace(&mut workspace, 10.0, &mid, &rhs, 5.0);
assert_relative_eq!(mat, expected);
Source

pub fn quadform<D2, S2, R3, C3, S3>( &mut self, alpha: T, mid: &SquareMatrix<T, D2, S2>, rhs: &Matrix<T, R3, C3, S3>, beta: T, )
where D2: Dim, R3: Dim, C3: Dim, S2: Storage<T, D2, D2>, S3: Storage<T, R3, C3>, ShapeConstraint: DimEq<D2, R3> + DimEq<D1, C3> + AreMultipliable<C3, R3, D2, U1>, DefaultAllocator: Allocator<D2>,

Computes the quadratic form self = alpha * rhs.transpose() * mid * rhs + beta * self.

This allocates a workspace vector of dimension D2 for intermediate results. If D2 is a type-level integer, then the allocation is performed on the stack. Use .quadform_with_workspace(...) instead to avoid allocations.

ยงExample
let mut mat = Matrix2::identity();
let rhs = Matrix3x2::new(1.0, 2.0,
                         3.0, 4.0,
                         5.0, 6.0);
let mid = Matrix3::new(0.1, 0.2, 0.3,
                       0.5, 0.6, 0.7,
                       0.9, 1.0, 1.1);
let expected = rhs.transpose() * mid * rhs * 10.0 + mat * 5.0;

mat.quadform(10.0, &mid, &rhs, 5.0);
assert_relative_eq!(mat, expected);
Sourceยง

impl<T, R: Dim, C: Dim, S> Matrix<T, R, C, S>
where T: Scalar + ClosedNeg, S: StorageMut<T, R, C>,

Source

pub fn neg_mut(&mut self)

Negates self in-place.

Sourceยง

impl<T, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>> Matrix<T, R1, C1, SA>

Source

pub fn add_to<R2: Dim, C2: Dim, SB, R3: Dim, C3: Dim, SC>( &self, rhs: &Matrix<T, R2, C2, SB>, out: &mut Matrix<T, R3, C3, SC>, )
where SB: Storage<T, R2, C2>, SC: StorageMut<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2> + SameNumberOfRows<R1, R3> + SameNumberOfColumns<C1, C3>,

Equivalent to self + rhs but stores the result into out to avoid allocations.

Sourceยง

impl<T, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>> Matrix<T, R1, C1, SA>

Source

pub fn sub_to<R2: Dim, C2: Dim, SB, R3: Dim, C3: Dim, SC>( &self, rhs: &Matrix<T, R2, C2, SB>, out: &mut Matrix<T, R3, C3, SC>, )
where SB: Storage<T, R2, C2>, SC: StorageMut<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2> + SameNumberOfRows<R1, R3> + SameNumberOfColumns<C1, C3>,

Equivalent to self + rhs but stores the result into out to avoid allocations.

Sourceยง

impl<T, R1: Dim, C1: Dim, SA> Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SA: Storage<T, R1, C1>,

ยงSpecial multiplications.

Source

pub fn tr_mul<R2: Dim, C2: Dim, SB>( &self, rhs: &Matrix<T, R2, C2, SB>, ) -> OMatrix<T, C1, C2>
where SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<C1, C2>, ShapeConstraint: SameNumberOfRows<R1, R2>,

Equivalent to self.transpose() * rhs.

Source

pub fn ad_mul<R2: Dim, C2: Dim, SB>( &self, rhs: &Matrix<T, R2, C2, SB>, ) -> OMatrix<T, C1, C2>

Equivalent to self.adjoint() * rhs.

Source

pub fn tr_mul_to<R2: Dim, C2: Dim, SB, R3: Dim, C3: Dim, SC>( &self, rhs: &Matrix<T, R2, C2, SB>, out: &mut Matrix<T, R3, C3, SC>, )
where SB: Storage<T, R2, C2>, SC: StorageMut<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + DimEq<C1, R3> + DimEq<C2, C3>,

Equivalent to self.transpose() * rhs but stores the result into out to avoid allocations.

Source

pub fn ad_mul_to<R2: Dim, C2: Dim, SB, R3: Dim, C3: Dim, SC>( &self, rhs: &Matrix<T, R2, C2, SB>, out: &mut Matrix<T, R3, C3, SC>, )
where T: SimdComplexField, SB: Storage<T, R2, C2>, SC: StorageMut<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + DimEq<C1, R3> + DimEq<C2, C3>,

Equivalent to self.adjoint() * rhs but stores the result into out to avoid allocations.

Source

pub fn mul_to<R2: Dim, C2: Dim, SB, R3: Dim, C3: Dim, SC>( &self, rhs: &Matrix<T, R2, C2, SB>, out: &mut Matrix<T, R3, C3, SC>, )
where SB: Storage<T, R2, C2>, SC: StorageMut<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R3, R1> + SameNumberOfColumns<C3, C2> + AreMultipliable<R1, C1, R2, C2>,

Equivalent to self * rhs but stores the result into out to avoid allocations.

Source

pub fn kronecker<R2: Dim, C2: Dim, SB>( &self, rhs: &Matrix<T, R2, C2, SB>, ) -> OMatrix<T, DimProd<R1, R2>, DimProd<C1, C2>>
where T: ClosedMulAssign, R1: DimMul<R2>, C1: DimMul<C2>, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<DimProd<R1, R2>, DimProd<C1, C2>>,

The kronecker product of two matrices (aka. tensor product of the corresponding linear maps).

Sourceยง

impl<T, D: DimName> Matrix<T, D, D, <DefaultAllocator as Allocator<D, D>>::Buffer<T>>
where T: Scalar + Zero + One, DefaultAllocator: Allocator<D, D>,

ยงTranslation and scaling in any dimension

Source

pub fn new_scaling(scaling: T) -> Self

Creates a new homogeneous matrix that applies the same scaling factor on each dimension.

Source

pub fn new_nonuniform_scaling<SB>( scaling: &Vector<T, DimNameDiff<D, U1>, SB>, ) -> Self
where D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>,

Creates a new homogeneous matrix that applies a distinct scaling factor for each dimension.

Source

pub fn new_translation<SB>( translation: &Vector<T, DimNameDiff<D, U1>, SB>, ) -> Self
where D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>,

Creates a new homogeneous matrix that applies a pure translation.

Sourceยง

impl<T: RealField> Matrix<T, Const<3>, Const<3>, ArrayStorage<T, 3, 3>>

ยง2D transformations as a Matrix3

Source

pub fn new_rotation(angle: T) -> Self

Builds a 2 dimensional homogeneous rotation matrix from an angle in radian.

Source

pub fn new_nonuniform_scaling_wrt_point( scaling: &Vector2<T>, pt: &Point2<T>, ) -> Self

Creates a new homogeneous matrix that applies a scaling factor for each dimension with respect to point.

Can be used to implement zoom_to functionality.

Sourceยง

impl<T: RealField> Matrix<T, Const<4>, Const<4>, ArrayStorage<T, 4, 4>>

ยง3D transformations as a Matrix4

Source

pub fn new_rotation(axisangle: Vector3<T>) -> Self

Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).

Returns the identity matrix if the given argument is zero.

Source

pub fn new_rotation_wrt_point(axisangle: Vector3<T>, pt: Point3<T>) -> Self

Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).

Returns the identity matrix if the given argument is zero.

Source

pub fn new_nonuniform_scaling_wrt_point( scaling: &Vector3<T>, pt: &Point3<T>, ) -> Self

Creates a new homogeneous matrix that applies a scaling factor for each dimension with respect to point.

Can be used to implement zoom_to functionality.

Source

pub fn from_scaled_axis(axisangle: Vector3<T>) -> Self

Builds a 3D homogeneous rotation matrix from an axis and an angle (multiplied together).

Returns the identity matrix if the given argument is zero. This is identical to Self::new_rotation.

Source

pub fn from_euler_angles(roll: T, pitch: T, yaw: T) -> Self

Creates a new rotation from Euler angles.

The primitive rotations are applied in order: 1 roll โˆ’ 2 pitch โˆ’ 3 yaw.

Source

pub fn from_axis_angle(axis: &Unit<Vector3<T>>, angle: T) -> Self

Builds a 3D homogeneous rotation matrix from an axis and a rotation angle.

Source

pub fn new_orthographic( left: T, right: T, bottom: T, top: T, znear: T, zfar: T, ) -> Self

Creates a new homogeneous matrix for an orthographic projection.

Source

pub fn new_perspective(aspect: T, fovy: T, znear: T, zfar: T) -> Self

Creates a new homogeneous matrix for a perspective projection.

Source

pub fn face_towards( eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>, ) -> Self

Creates an isometry that corresponds to the local frame of an observer standing at the point eye and looking toward target.

It maps the view direction target - eye to the positive z axis and the origin to the eye.

Source

pub fn new_observer_frame( eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>, ) -> Self

๐Ÿ‘ŽDeprecated: renamed to face_towards

Deprecated: Use Matrix4::face_towards instead.

Source

pub fn look_at_rh(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self

Builds a right-handed look-at view matrix.

Source

pub fn look_at_lh(eye: &Point3<T>, target: &Point3<T>, up: &Vector3<T>) -> Self

Builds a left-handed look-at view matrix.

Sourceยง

impl<T: Scalar + Zero + One + ClosedMulAssign + ClosedAddAssign, D: DimName, S: Storage<T, D, D>> Matrix<T, D, D, S>

ยงAppend/prepend translation and scaling

Source

pub fn append_scaling(&self, scaling: T) -> OMatrix<T, D, D>

Computes the transformation equal to self followed by an uniform scaling factor.

Source

pub fn prepend_scaling(&self, scaling: T) -> OMatrix<T, D, D>

Computes the transformation equal to an uniform scaling factor followed by self.

Source

pub fn append_nonuniform_scaling<SB>( &self, scaling: &Vector<T, DimNameDiff<D, U1>, SB>, ) -> OMatrix<T, D, D>
where D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>, DefaultAllocator: Allocator<D, D>,

Computes the transformation equal to self followed by a non-uniform scaling factor.

Source

pub fn prepend_nonuniform_scaling<SB>( &self, scaling: &Vector<T, DimNameDiff<D, U1>, SB>, ) -> OMatrix<T, D, D>
where D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>, DefaultAllocator: Allocator<D, D>,

Computes the transformation equal to a non-uniform scaling factor followed by self.

Source

pub fn append_translation<SB>( &self, shift: &Vector<T, DimNameDiff<D, U1>, SB>, ) -> OMatrix<T, D, D>
where D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>, DefaultAllocator: Allocator<D, D>,

Computes the transformation equal to self followed by a translation.

Source

pub fn prepend_translation<SB>( &self, shift: &Vector<T, DimNameDiff<D, U1>, SB>, ) -> OMatrix<T, D, D>

Computes the transformation equal to a translation followed by self.

Source

pub fn append_scaling_mut(&mut self, scaling: T)
where S: StorageMut<T, D, D>, D: DimNameSub<U1>,

Computes in-place the transformation equal to self followed by an uniform scaling factor.

Source

pub fn prepend_scaling_mut(&mut self, scaling: T)
where S: StorageMut<T, D, D>, D: DimNameSub<U1>,

Computes in-place the transformation equal to an uniform scaling factor followed by self.

Source

pub fn append_nonuniform_scaling_mut<SB>( &mut self, scaling: &Vector<T, DimNameDiff<D, U1>, SB>, )
where S: StorageMut<T, D, D>, D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>,

Computes in-place the transformation equal to self followed by a non-uniform scaling factor.

Source

pub fn prepend_nonuniform_scaling_mut<SB>( &mut self, scaling: &Vector<T, DimNameDiff<D, U1>, SB>, )
where S: StorageMut<T, D, D>, D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>,

Computes in-place the transformation equal to a non-uniform scaling factor followed by self.

Source

pub fn append_translation_mut<SB>( &mut self, shift: &Vector<T, DimNameDiff<D, U1>, SB>, )
where S: StorageMut<T, D, D>, D: DimNameSub<U1>, SB: Storage<T, DimNameDiff<D, U1>>,

Computes the transformation equal to self followed by a translation.

Source

pub fn prepend_translation_mut<SB>( &mut self, shift: &Vector<T, DimNameDiff<D, U1>, SB>, )

Computes the transformation equal to a translation followed by self.

Sourceยง

impl<T: RealField, D: DimNameSub<U1>, S: Storage<T, D, D>> Matrix<T, D, D, S>

ยงTransformation of vectors and points

Source

pub fn transform_vector( &self, v: &OVector<T, DimNameDiff<D, U1>>, ) -> OVector<T, DimNameDiff<D, U1>>

Transforms the given vector, assuming the matrix self uses homogeneous coordinates.

Sourceยง

impl<T: RealField, S: Storage<T, Const<3>, Const<3>>> Matrix<T, Const<3>, Const<3>, S>

Source

pub fn transform_point(&self, pt: &Point<T, 2>) -> Point<T, 2>

Transforms the given point, assuming the matrix self uses homogeneous coordinates.

Sourceยง

impl<T: RealField, S: Storage<T, Const<4>, Const<4>>> Matrix<T, Const<4>, Const<4>, S>

Source

pub fn transform_point(&self, pt: &Point<T, 3>) -> Point<T, 3>

Transforms the given point, assuming the matrix self uses homogeneous coordinates.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn abs(&self) -> OMatrix<T, R, C>

Computes the component-wise absolute value.

ยงExample
let a = Matrix2::new(0.0, 1.0,
                     -2.0, -3.0);
assert_eq!(a.abs(), Matrix2::new(0.0, 1.0, 2.0, 3.0))
Sourceยง

impl<T: Scalar, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>> Matrix<T, R1, C1, SA>

ยงComponentwise operations

Source

pub fn component_mul<R2, C2, SB>( &self, rhs: &Matrix<T, R2, C2, SB>, ) -> MatrixSum<T, R1, C1, R2, C2>
where T: ClosedMulAssign, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Componentwise matrix or vector multiplication.

ยงExample
let a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = Matrix2::new(0.0, 5.0, 12.0, 21.0);

assert_eq!(a.component_mul(&b), expected);
Source

pub fn cmpy<R2, C2, SB, R3, C3, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, b: &Matrix<T, R3, C3, SC>, beta: T, )
where T: ClosedMulAssign + Zero + Mul<T, Output = T> + Add<T, Output = T>, R2: Dim, C2: Dim, R3: Dim, C3: Dim, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, SC: Storage<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2> + SameNumberOfRows<R1, R3> + SameNumberOfColumns<C1, C3>,

Computes componentwise self[i] = alpha * a[i] * b[i] + beta * self[i].

ยงExample
let mut m = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = (a.component_mul(&b) * 5.0) + m * 10.0;

m.cmpy(5.0, &a, &b, 10.0);
assert_eq!(m, expected);
Source

pub fn component_mul_assign<R2, C2, SB>(&mut self, rhs: &Matrix<T, R2, C2, SB>)
where T: ClosedMulAssign, R2: Dim, C2: Dim, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Inplace componentwise matrix or vector multiplication.

ยงExample
let mut a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = Matrix2::new(0.0, 5.0, 12.0, 21.0);

a.component_mul_assign(&b);

assert_eq!(a, expected);
Source

pub fn component_mul_mut<R2, C2, SB>(&mut self, rhs: &Matrix<T, R2, C2, SB>)
where T: ClosedMulAssign, R2: Dim, C2: Dim, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

๐Ÿ‘ŽDeprecated: This is renamed using the _assign suffix instead of the _mut suffix.

Inplace componentwise matrix or vector multiplication.

ยงExample
let mut a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = Matrix2::new(0.0, 5.0, 12.0, 21.0);

a.component_mul_assign(&b);

assert_eq!(a, expected);
Source

pub fn component_div<R2, C2, SB>( &self, rhs: &Matrix<T, R2, C2, SB>, ) -> MatrixSum<T, R1, C1, R2, C2>
where T: ClosedDivAssign, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Componentwise matrix or vector division.

ยงExample
let a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = Matrix2::new(0.0, 1.0 / 5.0, 2.0 / 6.0, 3.0 / 7.0);

assert_eq!(a.component_div(&b), expected);
Source

pub fn cdpy<R2, C2, SB, R3, C3, SC>( &mut self, alpha: T, a: &Matrix<T, R2, C2, SB>, b: &Matrix<T, R3, C3, SC>, beta: T, )
where T: ClosedDivAssign + Zero + Mul<T, Output = T> + Add<T, Output = T>, R2: Dim, C2: Dim, R3: Dim, C3: Dim, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, SC: Storage<T, R3, C3>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2> + SameNumberOfRows<R1, R3> + SameNumberOfColumns<C1, C3>,

Computes componentwise self[i] = alpha * a[i] / b[i] + beta * self[i].

ยงExample
let mut m = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let a = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = (a.component_div(&b) * 5.0) + m * 10.0;

m.cdpy(5.0, &a, &b, 10.0);
assert_eq!(m, expected);
Source

pub fn component_div_assign<R2, C2, SB>(&mut self, rhs: &Matrix<T, R2, C2, SB>)
where T: ClosedDivAssign, R2: Dim, C2: Dim, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Inplace componentwise matrix or vector division.

ยงExample
let mut a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = Matrix2::new(0.0, 1.0 / 5.0, 2.0 / 6.0, 3.0 / 7.0);

a.component_div_assign(&b);

assert_eq!(a, expected);
Source

pub fn component_div_mut<R2, C2, SB>(&mut self, rhs: &Matrix<T, R2, C2, SB>)
where T: ClosedDivAssign, R2: Dim, C2: Dim, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

๐Ÿ‘ŽDeprecated: This is renamed using the _assign suffix instead of the _mut suffix.

Inplace componentwise matrix or vector division.

ยงExample
let mut a = Matrix2::new(0.0, 1.0, 2.0, 3.0);
let b = Matrix2::new(4.0, 5.0, 6.0, 7.0);
let expected = Matrix2::new(0.0, 1.0 / 5.0, 2.0 / 6.0, 3.0 / 7.0);

a.component_div_assign(&b);

assert_eq!(a, expected);
Source

pub fn inf(&self, other: &Self) -> OMatrix<T, R1, C1>

Computes the infimum (aka. componentwise min) of two matrices/vectors.

ยงExample
let u = Matrix2::new(4.0, 2.0, 1.0, -2.0);
let v = Matrix2::new(2.0, 4.0, -2.0, 1.0);
let expected = Matrix2::new(2.0, 2.0, -2.0, -2.0);
assert_eq!(u.inf(&v), expected)
Source

pub fn sup(&self, other: &Self) -> OMatrix<T, R1, C1>

Computes the supremum (aka. componentwise max) of two matrices/vectors.

ยงExample
let u = Matrix2::new(4.0, 2.0, 1.0, -2.0);
let v = Matrix2::new(2.0, 4.0, -2.0, 1.0);
let expected = Matrix2::new(4.0, 4.0, 1.0, 1.0);
assert_eq!(u.sup(&v), expected)
Source

pub fn inf_sup(&self, other: &Self) -> (OMatrix<T, R1, C1>, OMatrix<T, R1, C1>)

Computes the (infimum, supremum) of two matrices/vectors.

ยงExample
let u = Matrix2::new(4.0, 2.0, 1.0, -2.0);
let v = Matrix2::new(2.0, 4.0, -2.0, 1.0);
let expected = (Matrix2::new(2.0, 2.0, -2.0, -2.0), Matrix2::new(4.0, 4.0, 1.0, 1.0));
assert_eq!(u.inf_sup(&v), expected)
Source

pub fn add_scalar(&self, rhs: T) -> OMatrix<T, R1, C1>

Adds a scalar to self.

ยงExample
let u = Matrix2::new(1.0, 2.0, 3.0, 4.0);
let s = 10.0;
let expected = Matrix2::new(11.0, 12.0, 13.0, 14.0);
assert_eq!(u.add_scalar(s), expected)
Source

pub fn add_scalar_mut(&mut self, rhs: T)
where T: ClosedAddAssign, SA: StorageMut<T, R1, C1>,

Adds a scalar to self in-place.

ยงExample
let mut u = Matrix2::new(1.0, 2.0, 3.0, 4.0);
let s = 10.0;
u.add_scalar_mut(s);
let expected = Matrix2::new(11.0, 12.0, 13.0, 14.0);
assert_eq!(u, expected)
Sourceยง

impl<T: Scalar, R: Dim, C: Dim> Matrix<MaybeUninit<T>, R, C, <DefaultAllocator as Allocator<R, C>>::BufferUninit<T>>

Source

pub fn uninit(nrows: R, ncols: C) -> Self

Builds a matrix with uninitialized elements of type MaybeUninit<T>.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim> Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

ยงGeneric constructors

This set of matrix and vector construction functions are all generic with-regard to the matrix dimensions. They all expect to be given the dimension as inputs.

These functions should only be used when working on dimension-generic code.

Source

pub fn from_element_generic(nrows: R, ncols: C, elem: T) -> Self

Creates a matrix with all its elements set to elem.

Source

pub fn repeat_generic(nrows: R, ncols: C, elem: T) -> Self

Creates a matrix with all its elements set to elem.

Same as from_element_generic.

Source

pub fn zeros_generic(nrows: R, ncols: C) -> Self
where T: Zero,

Creates a matrix with all its elements set to 0.

Source

pub fn from_iterator_generic<I>(nrows: R, ncols: C, iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix with all its elements filled by an iterator.

Source

pub fn from_row_iterator_generic<I>(nrows: R, ncols: C, iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix with all its elements filled by an row-major order iterator.

Source

pub fn from_row_slice_generic(nrows: R, ncols: C, slice: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in row-major order.

The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.

Source

pub fn from_column_slice_generic(nrows: R, ncols: C, slice: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice. The components must have the same layout as the matrix data storage (i.e. column-major).

Source

pub fn from_fn_generic<F>(nrows: R, ncols: C, f: F) -> Self
where F: FnMut(usize, usize) -> T,

Creates a matrix filled with the results of a function applied to each of its component coordinates.

Source

pub fn identity_generic(nrows: R, ncols: C) -> Self
where T: Zero + One,

Creates a new identity matrix.

If the matrix is not square, the largest square submatrix starting at index (0, 0) is set to the identity matrix. All other entries are set to zero.

Source

pub fn from_diagonal_element_generic(nrows: R, ncols: C, elt: T) -> Self
where T: Zero + One,

Creates a new matrix with its diagonal filled with copies of elt.

If the matrix is not square, the largest square submatrix starting at index (0, 0) is set to the identity matrix. All other entries are set to zero.

Source

pub fn from_partial_diagonal_generic(nrows: R, ncols: C, elts: &[T]) -> Self
where T: Zero,

Creates a new matrix that may be rectangular. The first elts.len() diagonal elements are filled with the content of elts. Others are set to 0.

Panics if elts.len() is larger than the minimum among nrows and ncols.

Source

pub fn from_rows<SB>(rows: &[Matrix<T, Const<1>, C, SB>]) -> Self
where SB: RawStorage<T, Const<1>, C>,

Builds a new matrix from its rows.

Panics if not enough rows are provided (for statically-sized matrices), or if all rows do not have the same dimensions.

ยงExample

let m = Matrix3::from_rows(&[ RowVector3::new(1.0, 2.0, 3.0),  RowVector3::new(4.0, 5.0, 6.0),  RowVector3::new(7.0, 8.0, 9.0) ]);

assert!(m.m11 == 1.0 && m.m12 == 2.0 && m.m13 == 3.0 &&
        m.m21 == 4.0 && m.m22 == 5.0 && m.m23 == 6.0 &&
        m.m31 == 7.0 && m.m32 == 8.0 && m.m33 == 9.0);
Source

pub fn from_columns<SB>(columns: &[Vector<T, R, SB>]) -> Self
where SB: RawStorage<T, R>,

Builds a new matrix from its columns.

Panics if not enough columns are provided (for statically-sized matrices), or if all columns do not have the same dimensions.

ยงExample

let m = Matrix3::from_columns(&[ Vector3::new(1.0, 2.0, 3.0),  Vector3::new(4.0, 5.0, 6.0),  Vector3::new(7.0, 8.0, 9.0) ]);

assert!(m.m11 == 1.0 && m.m12 == 4.0 && m.m13 == 7.0 &&
        m.m21 == 2.0 && m.m22 == 5.0 && m.m23 == 8.0 &&
        m.m31 == 3.0 && m.m32 == 6.0 && m.m33 == 9.0);
Sourceยง

impl<T, D: Dim> Matrix<T, D, D, <DefaultAllocator as Allocator<D, D>>::Buffer<T>>

Source

pub fn from_diagonal<SB: RawStorage<T, D>>(diag: &Vector<T, D, SB>) -> Self
where T: Zero,

Creates a square matrix with its diagonal set to diag and all other entries set to 0.

ยงExample

let m = Matrix3::from_diagonal(&Vector3::new(1.0, 2.0, 3.0));
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_diagonal(&DVector::from_row_slice(&[1.0, 2.0, 3.0]));

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 &&
        m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 3.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 &&
        dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 3.0);
Sourceยง

impl<T: Scalar, R: DimName, C: DimName> Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

ยงConstructors of statically-sized vectors or statically-sized matrices

Source

pub fn from_element(elem: T) -> Self

Creates a matrix or vector with all its elements set to elem.

ยงExample

let v = Vector3::from_element(2.0);
// The additional argument represents the vector dimension.
let dv = DVector::from_element(3, 2.0);
let m = Matrix2x3::from_element(2.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_element(2, 3, 2.0);

assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0);
assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0);
assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 &&
        m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0);
assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 &&
        dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
Source

pub fn repeat(elem: T) -> Self

Creates a matrix or vector with all its elements set to elem.

Same as .from_element.

ยงExample

let v = Vector3::repeat(2.0);
// The additional argument represents the vector dimension.
let dv = DVector::repeat(3, 2.0);
let m = Matrix2x3::repeat(2.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::repeat(2, 3, 2.0);

assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0);
assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0);
assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 &&
        m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0);
assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 &&
        dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
Source

pub fn zeros() -> Self
where T: Zero,

Creates a matrix or vector with all its elements set to 0.

ยงExample

let v = Vector3::<f32>::zeros();
// The argument represents the vector dimension.
let dv = DVector::<f32>::zeros(3);
let m = Matrix2x3::<f32>::zeros();
// The two arguments represent the matrix dimensions.
let dm = DMatrix::<f32>::zeros(2, 3);

assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0);
assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0);
assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_iterator<I>(iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix or vector with all its elements filled by an iterator.

The output matrix is filled column-by-column.

ยงExample

let v = Vector3::from_iterator((0..3).into_iter());
// The additional argument represents the vector dimension.
let dv = DVector::from_iterator(3, (0..3).into_iter());
let m = Matrix2x3::from_iterator((0..6).into_iter());
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter());

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 &&
        m.m21 == 1 && m.m22 == 3 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 &&
        dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
Source

pub fn from_row_iterator<I>(iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix or vector with all its elements filled by a row-major iterator.

The output matrix is filled row-by-row.

ยงExample

let v = Vector3::from_row_iterator((0..3).into_iter());
// The additional argument represents the vector dimension.
let dv = DVector::from_row_iterator(3, (0..3).into_iter());
let m = Matrix2x3::from_row_iterator((0..6).into_iter());
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_row_iterator(2, 3, (0..6).into_iter());

// For Vectors from_row_iterator is identical to from_iterator
assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 &&
        m.m21 == 3 && m.m22 == 4 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 &&
        dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
Source

pub fn from_fn<F>(f: F) -> Self
where F: FnMut(usize, usize) -> T,

Creates a matrix or vector filled with the results of a function applied to each of its elementโ€™s indices.

The from_fn syntax changes depending if the typeโ€™s rows or columns are dynamically or statically sized. The dimension must only be supplied iff it is dynamically sized, e.g.

  • from_fn(f) when both dimensions are statically sized
  • from_fn(nrows, f) when only row dimension is dynamically sized
  • from_fn(ncols, f) when only column dimension is dynamically sized
  • from_fn(nrows, ncols, f) when both dimensions are dynamically sized

The function object f (i.e. the last argument to from_fn) receives the row and column indices as arguments (e.g. f(row, col)). For vectors, the column index is always zero (e.g. f(row, 0)).

ยงArguments
  • nrows: The number of rows. Must only be supplied for types with dynamic number of rows.

  • ncols: The number of columns. Must only be supplied for types with dynamic number of columns.

  • f: A function accepting the zero-based indices (row, col).

ยงExamples
use nalgebra::{DMatrix, DVector, Matrix2x3, Matrix2xX, MatrixXx3, Vector3};
use nalgebra_macros::{matrix, vector};

// statically sized dimensions -> both inferred
let v_3 = Vector3::from_fn(|i, _| i);
let m_2_3 = Matrix2x3::from_fn(|i, j| i * 3 + j);
assert_eq!(v_3, vector![0, 1, 2]);
assert_eq!(m_2_3, matrix![0, 1, 2; 3, 4, 5]);

// mixed sized dimensions -> static dimensions inferred, dynamic dimension must be given explicitly
let m_2_d = Matrix2xX::from_fn(3, |i, j| i * 3 + j); // explicit: ncols=3
let m_d_3 = MatrixXx3::from_fn(2, |i, j| i * 3 + j); // explicit: nrows=2
assert_eq!(m_2_d, matrix![0, 1, 2; 3, 4, 5]);
assert_eq!(m_d_3, matrix![0, 1, 2; 3, 4, 5]);

// dynamically sized dimensions -> both must be given explicitly
let v_d = DVector::from_fn(3, |i, _| i);
let m_d_d = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); // explicit: nrows=2, ncols=3
assert_eq!(v_d, vector![0, 1, 2]);
assert_eq!(m_d_d, matrix![0, 1, 2; 3, 4, 5]);
Source

pub fn identity() -> Self
where T: Zero + One,

Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.

ยงExample

let m = Matrix2x3::<f32>::identity();
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::<f32>::identity(2, 3);

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_diagonal_element(elt: T) -> Self
where T: Zero + One,

Creates a matrix filled with its diagonal filled with elt and all other components set to zero.

ยงExample

let m = Matrix2x3::from_diagonal_element(5.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_diagonal_element(2, 3, 5.0);

assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_partial_diagonal(elts: &[T]) -> Self
where T: Zero,

Creates a new matrix that may be rectangular. The first elts.len() diagonal elements are filled with the content of elts. Others are set to 0.

Panics if elts.len() is larger than the minimum among nrows and ncols.

ยงExample

let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]);

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 &&
        m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 &&
        dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
Sourceยง

impl<T: Scalar, R: DimName> Matrix<T, R, Dyn, <DefaultAllocator as Allocator<R, Dyn>>::Buffer<T>>

ยงConstructors of matrices with a dynamic number of columns

Source

pub fn from_element(ncols: usize, elem: T) -> Self

Creates a matrix or vector with all its elements set to elem.

ยงExample

let v = Vector3::from_element(2.0);
// The additional argument represents the vector dimension.
let dv = DVector::from_element(3, 2.0);
let m = Matrix2x3::from_element(2.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_element(2, 3, 2.0);

assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0);
assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0);
assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 &&
        m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0);
assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 &&
        dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
Source

pub fn repeat(ncols: usize, elem: T) -> Self

Creates a matrix or vector with all its elements set to elem.

Same as .from_element.

ยงExample

let v = Vector3::repeat(2.0);
// The additional argument represents the vector dimension.
let dv = DVector::repeat(3, 2.0);
let m = Matrix2x3::repeat(2.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::repeat(2, 3, 2.0);

assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0);
assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0);
assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 &&
        m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0);
assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 &&
        dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
Source

pub fn zeros(ncols: usize) -> Self
where T: Zero,

Creates a matrix or vector with all its elements set to 0.

ยงExample

let v = Vector3::<f32>::zeros();
// The argument represents the vector dimension.
let dv = DVector::<f32>::zeros(3);
let m = Matrix2x3::<f32>::zeros();
// The two arguments represent the matrix dimensions.
let dm = DMatrix::<f32>::zeros(2, 3);

assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0);
assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0);
assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_iterator<I>(ncols: usize, iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix or vector with all its elements filled by an iterator.

The output matrix is filled column-by-column.

ยงExample

let v = Vector3::from_iterator((0..3).into_iter());
// The additional argument represents the vector dimension.
let dv = DVector::from_iterator(3, (0..3).into_iter());
let m = Matrix2x3::from_iterator((0..6).into_iter());
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter());

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 &&
        m.m21 == 1 && m.m22 == 3 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 &&
        dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
Source

pub fn from_row_iterator<I>(ncols: usize, iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix or vector with all its elements filled by a row-major iterator.

The output matrix is filled row-by-row.

ยงExample

let v = Vector3::from_row_iterator((0..3).into_iter());
// The additional argument represents the vector dimension.
let dv = DVector::from_row_iterator(3, (0..3).into_iter());
let m = Matrix2x3::from_row_iterator((0..6).into_iter());
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_row_iterator(2, 3, (0..6).into_iter());

// For Vectors from_row_iterator is identical to from_iterator
assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 &&
        m.m21 == 3 && m.m22 == 4 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 &&
        dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
Source

pub fn from_fn<F>(ncols: usize, f: F) -> Self
where F: FnMut(usize, usize) -> T,

Creates a matrix or vector filled with the results of a function applied to each of its elementโ€™s indices.

The from_fn syntax changes depending if the typeโ€™s rows or columns are dynamically or statically sized. The dimension must only be supplied iff it is dynamically sized, e.g.

  • from_fn(f) when both dimensions are statically sized
  • from_fn(nrows, f) when only row dimension is dynamically sized
  • from_fn(ncols, f) when only column dimension is dynamically sized
  • from_fn(nrows, ncols, f) when both dimensions are dynamically sized

The function object f (i.e. the last argument to from_fn) receives the row and column indices as arguments (e.g. f(row, col)). For vectors, the column index is always zero (e.g. f(row, 0)).

ยงArguments
  • nrows: The number of rows. Must only be supplied for types with dynamic number of rows.

  • ncols: The number of columns. Must only be supplied for types with dynamic number of columns.

  • f: A function accepting the zero-based indices (row, col).

ยงExamples
use nalgebra::{DMatrix, DVector, Matrix2x3, Matrix2xX, MatrixXx3, Vector3};
use nalgebra_macros::{matrix, vector};

// statically sized dimensions -> both inferred
let v_3 = Vector3::from_fn(|i, _| i);
let m_2_3 = Matrix2x3::from_fn(|i, j| i * 3 + j);
assert_eq!(v_3, vector![0, 1, 2]);
assert_eq!(m_2_3, matrix![0, 1, 2; 3, 4, 5]);

// mixed sized dimensions -> static dimensions inferred, dynamic dimension must be given explicitly
let m_2_d = Matrix2xX::from_fn(3, |i, j| i * 3 + j); // explicit: ncols=3
let m_d_3 = MatrixXx3::from_fn(2, |i, j| i * 3 + j); // explicit: nrows=2
assert_eq!(m_2_d, matrix![0, 1, 2; 3, 4, 5]);
assert_eq!(m_d_3, matrix![0, 1, 2; 3, 4, 5]);

// dynamically sized dimensions -> both must be given explicitly
let v_d = DVector::from_fn(3, |i, _| i);
let m_d_d = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); // explicit: nrows=2, ncols=3
assert_eq!(v_d, vector![0, 1, 2]);
assert_eq!(m_d_d, matrix![0, 1, 2; 3, 4, 5]);
Source

pub fn identity(ncols: usize) -> Self
where T: Zero + One,

Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.

ยงExample

let m = Matrix2x3::<f32>::identity();
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::<f32>::identity(2, 3);

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_diagonal_element(ncols: usize, elt: T) -> Self
where T: Zero + One,

Creates a matrix filled with its diagonal filled with elt and all other components set to zero.

ยงExample

let m = Matrix2x3::from_diagonal_element(5.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_diagonal_element(2, 3, 5.0);

assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_partial_diagonal(ncols: usize, elts: &[T]) -> Self
where T: Zero,

Creates a new matrix that may be rectangular. The first elts.len() diagonal elements are filled with the content of elts. Others are set to 0.

Panics if elts.len() is larger than the minimum among nrows and ncols.

ยงExample

let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]);

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 &&
        m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 &&
        dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
Sourceยง

impl<T: Scalar, C: DimName> Matrix<T, Dyn, C, <DefaultAllocator as Allocator<Dyn, C>>::Buffer<T>>

ยงConstructors of dynamic vectors and matrices with a dynamic number of rows

Source

pub fn from_element(nrows: usize, elem: T) -> Self

Creates a matrix or vector with all its elements set to elem.

ยงExample

let v = Vector3::from_element(2.0);
// The additional argument represents the vector dimension.
let dv = DVector::from_element(3, 2.0);
let m = Matrix2x3::from_element(2.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_element(2, 3, 2.0);

assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0);
assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0);
assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 &&
        m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0);
assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 &&
        dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
Source

pub fn repeat(nrows: usize, elem: T) -> Self

Creates a matrix or vector with all its elements set to elem.

Same as .from_element.

ยงExample

let v = Vector3::repeat(2.0);
// The additional argument represents the vector dimension.
let dv = DVector::repeat(3, 2.0);
let m = Matrix2x3::repeat(2.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::repeat(2, 3, 2.0);

assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0);
assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0);
assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 &&
        m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0);
assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 &&
        dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
Source

pub fn zeros(nrows: usize) -> Self
where T: Zero,

Creates a matrix or vector with all its elements set to 0.

ยงExample

let v = Vector3::<f32>::zeros();
// The argument represents the vector dimension.
let dv = DVector::<f32>::zeros(3);
let m = Matrix2x3::<f32>::zeros();
// The two arguments represent the matrix dimensions.
let dm = DMatrix::<f32>::zeros(2, 3);

assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0);
assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0);
assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_iterator<I>(nrows: usize, iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix or vector with all its elements filled by an iterator.

The output matrix is filled column-by-column.

ยงExample

let v = Vector3::from_iterator((0..3).into_iter());
// The additional argument represents the vector dimension.
let dv = DVector::from_iterator(3, (0..3).into_iter());
let m = Matrix2x3::from_iterator((0..6).into_iter());
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter());

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 &&
        m.m21 == 1 && m.m22 == 3 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 &&
        dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
Source

pub fn from_row_iterator<I>(nrows: usize, iter: I) -> Self
where I: IntoIterator<Item = T>,

Creates a matrix or vector with all its elements filled by a row-major iterator.

The output matrix is filled row-by-row.

ยงExample

let v = Vector3::from_row_iterator((0..3).into_iter());
// The additional argument represents the vector dimension.
let dv = DVector::from_row_iterator(3, (0..3).into_iter());
let m = Matrix2x3::from_row_iterator((0..6).into_iter());
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_row_iterator(2, 3, (0..6).into_iter());

// For Vectors from_row_iterator is identical to from_iterator
assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 &&
        m.m21 == 3 && m.m22 == 4 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 &&
        dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
Source

pub fn from_fn<F>(nrows: usize, f: F) -> Self
where F: FnMut(usize, usize) -> T,

Creates a matrix or vector filled with the results of a function applied to each of its elementโ€™s indices.

The from_fn syntax changes depending if the typeโ€™s rows or columns are dynamically or statically sized. The dimension must only be supplied iff it is dynamically sized, e.g.

  • from_fn(f) when both dimensions are statically sized
  • from_fn(nrows, f) when only row dimension is dynamically sized
  • from_fn(ncols, f) when only column dimension is dynamically sized
  • from_fn(nrows, ncols, f) when both dimensions are dynamically sized

The function object f (i.e. the last argument to from_fn) receives the row and column indices as arguments (e.g. f(row, col)). For vectors, the column index is always zero (e.g. f(row, 0)).

ยงArguments
  • nrows: The number of rows. Must only be supplied for types with dynamic number of rows.

  • ncols: The number of columns. Must only be supplied for types with dynamic number of columns.

  • f: A function accepting the zero-based indices (row, col).

ยงExamples
use nalgebra::{DMatrix, DVector, Matrix2x3, Matrix2xX, MatrixXx3, Vector3};
use nalgebra_macros::{matrix, vector};

// statically sized dimensions -> both inferred
let v_3 = Vector3::from_fn(|i, _| i);
let m_2_3 = Matrix2x3::from_fn(|i, j| i * 3 + j);
assert_eq!(v_3, vector![0, 1, 2]);
assert_eq!(m_2_3, matrix![0, 1, 2; 3, 4, 5]);

// mixed sized dimensions -> static dimensions inferred, dynamic dimension must be given explicitly
let m_2_d = Matrix2xX::from_fn(3, |i, j| i * 3 + j); // explicit: ncols=3
let m_d_3 = MatrixXx3::from_fn(2, |i, j| i * 3 + j); // explicit: nrows=2
assert_eq!(m_2_d, matrix![0, 1, 2; 3, 4, 5]);
assert_eq!(m_d_3, matrix![0, 1, 2; 3, 4, 5]);

// dynamically sized dimensions -> both must be given explicitly
let v_d = DVector::from_fn(3, |i, _| i);
let m_d_d = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); // explicit: nrows=2, ncols=3
assert_eq!(v_d, vector![0, 1, 2]);
assert_eq!(m_d_d, matrix![0, 1, 2; 3, 4, 5]);
Source

pub fn identity(nrows: usize) -> Self
where T: Zero + One,

Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.

ยงExample

let m = Matrix2x3::<f32>::identity();
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::<f32>::identity(2, 3);

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_diagonal_element(nrows: usize, elt: T) -> Self
where T: Zero + One,

Creates a matrix filled with its diagonal filled with elt and all other components set to zero.

ยงExample

let m = Matrix2x3::from_diagonal_element(5.0);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_diagonal_element(2, 3, 5.0);

assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0);
assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
Source

pub fn from_partial_diagonal(nrows: usize, elts: &[T]) -> Self
where T: Zero,

Creates a new matrix that may be rectangular. The first elts.len() diagonal elements are filled with the content of elts. Others are set to 0.

Panics if elts.len() is larger than the minimum among nrows and ncols.

ยงExample

let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]);

assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 &&
        m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 &&
        m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0);
assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 &&
        dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 &&
        dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
Sourceยง

impl<T: Scalar, R: DimName, C: DimName> Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

Source

pub fn from_row_slice(data: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in row-major order.

The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.

ยงExample

let v = Vector3::from_row_slice(&[0, 1, 2]);
// The additional argument represents the vector dimension.
let dv = DVector::from_row_slice(&[0, 1, 2]);
let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]);

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 &&
        m.m21 == 3 && m.m22 == 4 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 &&
        dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
Source

pub fn from_column_slice(data: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in column-major order.

ยงExample

let v = Vector3::from_column_slice(&[0, 1, 2]);
// The additional argument represents the vector dimension.
let dv = DVector::from_column_slice(&[0, 1, 2]);
let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]);

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 &&
        m.m21 == 1 && m.m22 == 3 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 &&
        dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
Sourceยง

impl<T: Scalar, R: DimName> Matrix<T, R, Dyn, <DefaultAllocator as Allocator<R, Dyn>>::Buffer<T>>

Source

pub fn from_row_slice(data: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in row-major order.

The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.

ยงExample

let v = Vector3::from_row_slice(&[0, 1, 2]);
// The additional argument represents the vector dimension.
let dv = DVector::from_row_slice(&[0, 1, 2]);
let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]);

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 &&
        m.m21 == 3 && m.m22 == 4 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 &&
        dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
Source

pub fn from_column_slice(data: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in column-major order.

ยงExample

let v = Vector3::from_column_slice(&[0, 1, 2]);
// The additional argument represents the vector dimension.
let dv = DVector::from_column_slice(&[0, 1, 2]);
let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]);

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 &&
        m.m21 == 1 && m.m22 == 3 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 &&
        dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
Sourceยง

impl<T: Scalar, C: DimName> Matrix<T, Dyn, C, <DefaultAllocator as Allocator<Dyn, C>>::Buffer<T>>

Source

pub fn from_row_slice(data: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in row-major order.

The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.

ยงExample

let v = Vector3::from_row_slice(&[0, 1, 2]);
// The additional argument represents the vector dimension.
let dv = DVector::from_row_slice(&[0, 1, 2]);
let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]);

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 &&
        m.m21 == 3 && m.m22 == 4 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 &&
        dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
Source

pub fn from_column_slice(data: &[T]) -> Self

Creates a matrix with its elements filled with the components provided by a slice in column-major order.

ยงExample

let v = Vector3::from_column_slice(&[0, 1, 2]);
// The additional argument represents the vector dimension.
let dv = DVector::from_column_slice(&[0, 1, 2]);
let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]);
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]);

assert!(v.x == 0 && v.y == 1 && v.z == 2);
assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2);
assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 &&
        m.m21 == 1 && m.m22 == 3 && m.m23 == 5);
assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 &&
        dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
Sourceยง

impl<T> Matrix<T, Const<2>, Const<2>, ArrayStorage<T, 2, 2>>

Source

pub const fn new(m11: T, m12: T, m21: T, m22: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<3>, Const<3>, ArrayStorage<T, 3, 3>>

Source

pub const fn new( m11: T, m12: T, m13: T, m21: T, m22: T, m23: T, m31: T, m32: T, m33: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<4>, Const<4>, ArrayStorage<T, 4, 4>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m21: T, m22: T, m23: T, m24: T, m31: T, m32: T, m33: T, m34: T, m41: T, m42: T, m43: T, m44: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<5>, Const<5>, ArrayStorage<T, 5, 5>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m21: T, m22: T, m23: T, m24: T, m25: T, m31: T, m32: T, m33: T, m34: T, m35: T, m41: T, m42: T, m43: T, m44: T, m45: T, m51: T, m52: T, m53: T, m54: T, m55: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<6>, Const<6>, ArrayStorage<T, 6, 6>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m16: T, m21: T, m22: T, m23: T, m24: T, m25: T, m26: T, m31: T, m32: T, m33: T, m34: T, m35: T, m36: T, m41: T, m42: T, m43: T, m44: T, m45: T, m46: T, m51: T, m52: T, m53: T, m54: T, m55: T, m56: T, m61: T, m62: T, m63: T, m64: T, m65: T, m66: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<2>, Const<3>, ArrayStorage<T, 2, 3>>

Source

pub const fn new(m11: T, m12: T, m13: T, m21: T, m22: T, m23: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<2>, Const<4>, ArrayStorage<T, 2, 4>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m21: T, m22: T, m23: T, m24: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<2>, Const<5>, ArrayStorage<T, 2, 5>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m21: T, m22: T, m23: T, m24: T, m25: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<2>, Const<6>, ArrayStorage<T, 2, 6>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m16: T, m21: T, m22: T, m23: T, m24: T, m25: T, m26: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<3>, Const<2>, ArrayStorage<T, 3, 2>>

Source

pub const fn new(m11: T, m12: T, m21: T, m22: T, m31: T, m32: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<3>, Const<4>, ArrayStorage<T, 3, 4>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m21: T, m22: T, m23: T, m24: T, m31: T, m32: T, m33: T, m34: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<3>, Const<5>, ArrayStorage<T, 3, 5>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m21: T, m22: T, m23: T, m24: T, m25: T, m31: T, m32: T, m33: T, m34: T, m35: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<3>, Const<6>, ArrayStorage<T, 3, 6>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m16: T, m21: T, m22: T, m23: T, m24: T, m25: T, m26: T, m31: T, m32: T, m33: T, m34: T, m35: T, m36: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<4>, Const<2>, ArrayStorage<T, 4, 2>>

Source

pub const fn new( m11: T, m12: T, m21: T, m22: T, m31: T, m32: T, m41: T, m42: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<4>, Const<3>, ArrayStorage<T, 4, 3>>

Source

pub const fn new( m11: T, m12: T, m13: T, m21: T, m22: T, m23: T, m31: T, m32: T, m33: T, m41: T, m42: T, m43: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<4>, Const<5>, ArrayStorage<T, 4, 5>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m21: T, m22: T, m23: T, m24: T, m25: T, m31: T, m32: T, m33: T, m34: T, m35: T, m41: T, m42: T, m43: T, m44: T, m45: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<4>, Const<6>, ArrayStorage<T, 4, 6>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m16: T, m21: T, m22: T, m23: T, m24: T, m25: T, m26: T, m31: T, m32: T, m33: T, m34: T, m35: T, m36: T, m41: T, m42: T, m43: T, m44: T, m45: T, m46: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<5>, Const<2>, ArrayStorage<T, 5, 2>>

Source

pub const fn new( m11: T, m12: T, m21: T, m22: T, m31: T, m32: T, m41: T, m42: T, m51: T, m52: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<5>, Const<3>, ArrayStorage<T, 5, 3>>

Source

pub const fn new( m11: T, m12: T, m13: T, m21: T, m22: T, m23: T, m31: T, m32: T, m33: T, m41: T, m42: T, m43: T, m51: T, m52: T, m53: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<5>, Const<4>, ArrayStorage<T, 5, 4>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m21: T, m22: T, m23: T, m24: T, m31: T, m32: T, m33: T, m34: T, m41: T, m42: T, m43: T, m44: T, m51: T, m52: T, m53: T, m54: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<5>, Const<6>, ArrayStorage<T, 5, 6>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m16: T, m21: T, m22: T, m23: T, m24: T, m25: T, m26: T, m31: T, m32: T, m33: T, m34: T, m35: T, m36: T, m41: T, m42: T, m43: T, m44: T, m45: T, m46: T, m51: T, m52: T, m53: T, m54: T, m55: T, m56: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<6>, Const<2>, ArrayStorage<T, 6, 2>>

Source

pub const fn new( m11: T, m12: T, m21: T, m22: T, m31: T, m32: T, m41: T, m42: T, m51: T, m52: T, m61: T, m62: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<6>, Const<3>, ArrayStorage<T, 6, 3>>

Source

pub const fn new( m11: T, m12: T, m13: T, m21: T, m22: T, m23: T, m31: T, m32: T, m33: T, m41: T, m42: T, m43: T, m51: T, m52: T, m53: T, m61: T, m62: T, m63: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<6>, Const<4>, ArrayStorage<T, 6, 4>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m21: T, m22: T, m23: T, m24: T, m31: T, m32: T, m33: T, m34: T, m41: T, m42: T, m43: T, m44: T, m51: T, m52: T, m53: T, m54: T, m61: T, m62: T, m63: T, m64: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<6>, Const<5>, ArrayStorage<T, 6, 5>>

Source

pub const fn new( m11: T, m12: T, m13: T, m14: T, m15: T, m21: T, m22: T, m23: T, m24: T, m25: T, m31: T, m32: T, m33: T, m34: T, m35: T, m41: T, m42: T, m43: T, m44: T, m45: T, m51: T, m52: T, m53: T, m54: T, m55: T, m61: T, m62: T, m63: T, m64: T, m65: T, ) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<1>, Const<1>, ArrayStorage<T, 1, 1>>

Source

pub const fn new(x: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<1>, Const<2>, ArrayStorage<T, 1, 2>>

Source

pub const fn new(x: T, y: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<1>, Const<3>, ArrayStorage<T, 1, 3>>

Source

pub const fn new(x: T, y: T, z: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<1>, Const<4>, ArrayStorage<T, 1, 4>>

Source

pub const fn new(x: T, y: T, z: T, w: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<1>, Const<5>, ArrayStorage<T, 1, 5>>

Source

pub const fn new(x: T, y: T, z: T, w: T, a: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<1>, Const<6>, ArrayStorage<T, 1, 6>>

Source

pub const fn new(x: T, y: T, z: T, w: T, a: T, b: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<2>, Const<1>, ArrayStorage<T, 2, 1>>

Source

pub const fn new(x: T, y: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

Source

pub const fn new(x: T, y: T, z: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>

Source

pub const fn new(x: T, y: T, z: T, w: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<5>, Const<1>, ArrayStorage<T, 5, 1>>

Source

pub const fn new(x: T, y: T, z: T, w: T, a: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T> Matrix<T, Const<6>, Const<1>, ArrayStorage<T, 6, 1>>

Source

pub const fn new(x: T, y: T, z: T, w: T, a: T, b: T) -> Self

Initializes this matrix from its components.

Sourceยง

impl<T, R> Matrix<T, R, Const<1>, <DefaultAllocator as Allocator<R>>::Buffer<T>>

Source

pub fn ith(i: usize, val: T) -> Self

The column vector with val as its i-th component.

Source

pub fn ith_axis(i: usize) -> Unit<Self>

The column unit vector with T::one() as its i-th component.

Source

pub fn x() -> Self
where R::Typenum: Cmp<U0, Output = Greater>,

The column vector with a 1 as its first component, and zero elsewhere.

Source

pub fn y() -> Self
where R::Typenum: Cmp<U1, Output = Greater>,

The column vector with a 1 as its second component, and zero elsewhere.

Source

pub fn z() -> Self
where R::Typenum: Cmp<U2, Output = Greater>,

The column vector with a 1 as its third component, and zero elsewhere.

Source

pub fn w() -> Self
where R::Typenum: Cmp<U3, Output = Greater>,

The column vector with a 1 as its fourth component, and zero elsewhere.

Source

pub fn a() -> Self
where R::Typenum: Cmp<U4, Output = Greater>,

The column vector with a 1 as its fifth component, and zero elsewhere.

Source

pub fn b() -> Self
where R::Typenum: Cmp<U5, Output = Greater>,

The column vector with a 1 as its sixth component, and zero elsewhere.

Source

pub fn x_axis() -> Unit<Self>
where R::Typenum: Cmp<U0, Output = Greater>,

The unit column vector with a 1 as its first component, and zero elsewhere.

Source

pub fn y_axis() -> Unit<Self>
where R::Typenum: Cmp<U1, Output = Greater>,

The unit column vector with a 1 as its second component, and zero elsewhere.

Source

pub fn z_axis() -> Unit<Self>
where R::Typenum: Cmp<U2, Output = Greater>,

The unit column vector with a 1 as its third component, and zero elsewhere.

Source

pub fn w_axis() -> Unit<Self>
where R::Typenum: Cmp<U3, Output = Greater>,

The unit column vector with a 1 as its fourth component, and zero elsewhere.

Source

pub fn a_axis() -> Unit<Self>
where R::Typenum: Cmp<U4, Output = Greater>,

The unit column vector with a 1 as its fifth component, and zero elsewhere.

Source

pub fn b_axis() -> Unit<Self>
where R::Typenum: Cmp<U5, Output = Greater>,

The unit column vector with a 1 as its sixth component, and zero elsewhere.

Sourceยง

impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> Matrix<T, R, C, ViewStorage<'a, T, R, C, RStride, CStride>>

ยงCreating matrix views from &[T]

Source

pub const 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> Matrix<T, R, C, ViewStorage<'a, T, R, C, Const<1>, R>>

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> Matrix<T, R, C, ViewStorage<'a, T, R, C, Const<1>, R>>

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.

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar, R: DimName, C: DimName> Matrix<T, R, C, ViewStorage<'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.

ยงSafety

start, rstride, and cstride, with the given matrix size will not index outside of data.

Sourceยง

impl<'a, T: Scalar, R: DimName> Matrix<T, R, Dyn, ViewStorage<'a, T, R, Dyn, Const<1>, R>>

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.

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar, R: DimName> Matrix<T, R, Dyn, ViewStorage<'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.

ยงSafety

start, rstride, and cstride, with the given matrix size will not index outside of data.

Sourceยง

impl<'a, T: Scalar, C: DimName> Matrix<T, Dyn, C, ViewStorage<'a, T, Dyn, C, Const<1>, Dyn>>

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.

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar, C: DimName> Matrix<T, Dyn, C, ViewStorage<'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.

ยงSafety

start, rstride, and cstride, with the given matrix size will not index outside of data.

Sourceยง

impl<'a, T: Scalar> Matrix<T, Dyn, Dyn, ViewStorage<'a, T, Dyn, Dyn, Const<1>, 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.

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar> Matrix<T, Dyn, Dyn, ViewStorage<'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.

ยงSafety

start, rstride, and cstride, with the given matrix size will not index outside of data.

Sourceยง

impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> Matrix<T, R, C, ViewStorageMut<'a, T, R, C, RStride, CStride>>

ยงCreating mutable matrix views from &mut [T]

Source

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

Creates, without bound-checking, a mutable 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 mut [T], nrows: R, ncols: C, rstride: RStride, cstride: CStride, ) -> Self

Creates a mutable 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> Matrix<T, R, C, ViewStorageMut<'a, T, R, C, Const<1>, R>>

Source

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

Creates, without bound-checking, a mutable 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 mut [T], nrows: R, ncols: C) -> Self

Creates a mutable 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> Matrix<T, R, C, ViewStorageMut<'a, T, R, C, Const<1>, R>>

Source

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

Creates a new mutable matrix view from the given data array.

Panics if data does not contain enough elements.

Source

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

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

ยงSafety

data[start..start+(R * C)] must be within bounds.

Sourceยง

impl<'a, T: Scalar, R: DimName, C: DimName> Matrix<T, R, C, ViewStorageMut<'a, T, R, C, Dyn, Dyn>>

Source

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

Creates a new mutable 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 mut [T], start: usize, rstride: usize, cstride: usize, ) -> Self

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

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar, R: DimName> Matrix<T, R, Dyn, ViewStorageMut<'a, T, R, Dyn, Const<1>, R>>

Source

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

Creates a new mutable matrix view from the given data array.

Panics if data does not contain enough elements.

Source

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

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

ยงSafety

data[start..start+(R * C)] must be within bounds.

Sourceยง

impl<'a, T: Scalar, R: DimName> Matrix<T, R, Dyn, ViewStorageMut<'a, T, R, Dyn, Dyn, Dyn>>

Source

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

Creates a new mutable 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 mut [T], start: usize, ncols: usize, rstride: usize, cstride: usize, ) -> Self

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

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar, C: DimName> Matrix<T, Dyn, C, ViewStorageMut<'a, T, Dyn, C, Const<1>, Dyn>>

Source

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

Creates a new mutable matrix view from the given data array.

Panics if data does not contain enough elements.

Source

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

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

ยงSafety

data[start..start+(R * C)] must be within bounds.

Sourceยง

impl<'a, T: Scalar, C: DimName> Matrix<T, Dyn, C, ViewStorageMut<'a, T, Dyn, C, Dyn, Dyn>>

Source

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

Creates a new mutable 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 mut [T], start: usize, nrows: usize, rstride: usize, cstride: usize, ) -> Self

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

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<'a, T: Scalar> Matrix<T, Dyn, Dyn, ViewStorageMut<'a, T, Dyn, Dyn, Const<1>, Dyn>>

Source

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

Creates a new mutable matrix view from the given data array.

Panics if data does not contain enough elements.

Source

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

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

ยงSafety

data[start..start+(R * C)] must be within bounds.

Sourceยง

impl<'a, T: Scalar> Matrix<T, Dyn, Dyn, ViewStorageMut<'a, T, Dyn, Dyn, Dyn, Dyn>>

Source

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

Creates a new mutable 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 mut [T], start: usize, nrows: usize, ncols: usize, rstride: usize, cstride: usize, ) -> Self

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

ยงSafety

data[start..start+rstride * cstride] must be within bounds.

Sourceยง

impl<T: Scalar + Zero, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

ยงTriangular matrix extraction

Source

pub fn upper_triangle(&self) -> OMatrix<T, R, C>

Extracts the upper triangular part of this matrix (including the diagonal).

Source

pub fn lower_triangle(&self) -> OMatrix<T, R, C>

Extracts the lower triangular part of this matrix (including the diagonal).

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

This impl block contains no items.

ยงRows and columns extraction

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

ยงSet rows, columns, and diagonal

Source

pub fn set_diagonal<R2: Dim, S2>(&mut self, diag: &Vector<T, R2, S2>)
where R: DimMin<C>, S2: RawStorage<T, R2>, ShapeConstraint: DimEq<DimMinimum<R, C>, R2>,

Fills the diagonal of this matrix with the content of the given vector.

Source

pub fn set_partial_diagonal(&mut self, diag: impl Iterator<Item = T>)

Fills the diagonal of this matrix with the content of the given iterator.

This will fill as many diagonal elements as the iterator yields, up to the minimum of the number of rows and columns of self, and starting with the diagonal element at index (0, 0).

Source

pub fn set_row<C2: Dim, S2>(&mut self, i: usize, row: &RowVector<T, C2, S2>)
where S2: RawStorage<T, U1, C2>, ShapeConstraint: SameNumberOfColumns<C, C2>,

Fills the selected row of this matrix with the content of the given vector.

Source

pub fn set_column<R2: Dim, S2>(&mut self, i: usize, column: &Vector<T, R2, S2>)
where S2: RawStorage<T, R2, U1>, ShapeConstraint: SameNumberOfRows<R, R2>,

Fills the selected column of this matrix with the content of the given vector.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

ยงIn-place filling

Source

pub fn fill_with(&mut self, val: impl Fn() -> T)

Sets all the elements of this matrix to the value returned by the closure.

Source

pub fn fill(&mut self, val: T)
where T: Scalar,

Sets all the elements of this matrix to val.

Source

pub fn fill_with_identity(&mut self)
where T: Scalar + Zero + One,

Fills self with the identity matrix.

Source

pub fn fill_diagonal(&mut self, val: T)
where T: Scalar,

Sets all the diagonal elements of this matrix to val.

Source

pub fn fill_row(&mut self, i: usize, val: T)
where T: Scalar,

Sets all the elements of the selected row to val.

Source

pub fn fill_column(&mut self, j: usize, val: T)
where T: Scalar,

Sets all the elements of the selected column to val.

Source

pub fn fill_lower_triangle(&mut self, val: T, shift: usize)
where T: Scalar,

Sets all the elements of the lower-triangular part of this matrix to val.

The parameter shift allows some subdiagonals to be left untouched:

  • If shift = 0 then the diagonal is overwritten as well.
  • If shift = 1 then the diagonal is left untouched.
  • If shift > 1, then the diagonal and the first shift - 1 subdiagonals are left untouched.
Source

pub fn fill_upper_triangle(&mut self, val: T, shift: usize)
where T: Scalar,

Sets all the elements of the upper-triangular part of this matrix to val.

The parameter shift allows some superdiagonals to be left untouched:

  • If shift = 0 then the diagonal is overwritten as well.
  • If shift = 1 then the diagonal is left untouched.
  • If shift > 1, then the diagonal and the first shift - 1 superdiagonals are left untouched.
Sourceยง

impl<T: Scalar, D: Dim, S: RawStorageMut<T, D, D>> Matrix<T, D, D, S>

Source

pub fn fill_lower_triangle_with_upper_triangle(&mut self)

Copies the upper-triangle of this matrix to its lower-triangular part.

This makes the matrix symmetric. Panics if the matrix is not square.

Source

pub fn fill_upper_triangle_with_lower_triangle(&mut self)

Copies the upper-triangle of this matrix to its upper-triangular part.

This makes the matrix symmetric. Panics if the matrix is not square.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

ยงIn-place swapping

Source

pub fn swap_rows(&mut self, irow1: usize, irow2: usize)

Swaps two rows in-place.

Source

pub fn swap_columns(&mut self, icol1: usize, icol2: usize)

Swaps two columns in-place.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

ยงRows and columns removal

Source

pub fn remove_column(self, i: usize) -> OMatrix<T, R, DimDiff<C, U1>>
where C: DimSub<U1>, DefaultAllocator: Reallocator<T, R, C, R, DimDiff<C, U1>>,

Removes the i-th column from this matrix.

Source

pub fn remove_fixed_columns<const D: usize>( self, i: usize, ) -> OMatrix<T, R, DimDiff<C, Const<D>>>
where C: DimSub<Const<D>>, DefaultAllocator: Reallocator<T, R, C, R, DimDiff<C, Const<D>>>,

Removes D::dim() consecutive columns from this matrix, starting with the i-th (included).

Source

pub fn remove_columns_generic<D>( self, i: usize, nremove: D, ) -> OMatrix<T, R, DimDiff<C, D>>
where D: Dim, C: DimSub<D>, DefaultAllocator: Reallocator<T, R, C, R, DimDiff<C, D>>,

Removes nremove.value() columns from this matrix, starting with the i-th (included).

This is the generic implementation of .remove_columns(...) and .remove_fixed_columns(...) which have nicer API interfaces.

Source

pub fn remove_row(self, i: usize) -> OMatrix<T, DimDiff<R, U1>, C>
where R: DimSub<U1>, DefaultAllocator: Reallocator<T, R, C, DimDiff<R, U1>, C>,

Removes the i-th row from this matrix.

Source

pub fn remove_fixed_rows<const D: usize>( self, i: usize, ) -> OMatrix<T, DimDiff<R, Const<D>>, C>
where R: DimSub<Const<D>>, DefaultAllocator: Reallocator<T, R, C, DimDiff<R, Const<D>>, C>,

Removes D::dim() consecutive rows from this matrix, starting with the i-th (included).

Source

pub fn remove_rows_generic<D>( self, i: usize, nremove: D, ) -> OMatrix<T, DimDiff<R, D>, C>
where D: Dim, R: DimSub<D>, DefaultAllocator: Reallocator<T, R, C, DimDiff<R, D>, C>,

Removes nremove.value() rows from this matrix, starting with the i-th (included).

This is the generic implementation of .remove_rows(...) and .remove_fixed_rows(...) which have nicer API interfaces.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

ยงRows and columns insertion

Source

pub fn insert_column(self, i: usize, val: T) -> OMatrix<T, R, DimSum<C, U1>>
where C: DimAdd<U1>, DefaultAllocator: Reallocator<T, R, C, R, DimSum<C, U1>>,

Inserts a column filled with val at the i-th position.

Source

pub fn insert_fixed_columns<const D: usize>( self, i: usize, val: T, ) -> OMatrix<T, R, DimSum<C, Const<D>>>
where C: DimAdd<Const<D>>, DefaultAllocator: Reallocator<T, R, C, R, DimSum<C, Const<D>>>,

Inserts D columns filled with val starting at the i-th position.

Source

pub unsafe fn insert_columns_generic_uninitialized<D>( self, i: usize, ninsert: D, ) -> UninitMatrix<T, R, DimSum<C, D>>
where D: Dim, C: DimAdd<D>, DefaultAllocator: Reallocator<T, R, C, R, DimSum<C, D>>,

Inserts ninsert.value() columns starting at the i-th place of this matrix.

ยงSafety

The output matrix has all its elements initialized except for the the components of the added columns.

Source

pub fn insert_row(self, i: usize, val: T) -> OMatrix<T, DimSum<R, U1>, C>
where R: DimAdd<U1>, DefaultAllocator: Reallocator<T, R, C, DimSum<R, U1>, C>,

Inserts a row filled with val at the i-th position.

Source

pub fn insert_fixed_rows<const D: usize>( self, i: usize, val: T, ) -> OMatrix<T, DimSum<R, Const<D>>, C>
where R: DimAdd<Const<D>>, DefaultAllocator: Reallocator<T, R, C, DimSum<R, Const<D>>, C>,

Inserts D::dim() rows filled with val starting at the i-th position.

Source

pub unsafe fn insert_rows_generic_uninitialized<D>( self, i: usize, ninsert: D, ) -> UninitMatrix<T, DimSum<R, D>, C>
where D: Dim, R: DimAdd<D>, DefaultAllocator: Reallocator<T, R, C, DimSum<R, D>, C>,

Inserts ninsert.value() rows at the i-th place of this matrix.

ยงSafety

The added rows values are not initialized. This is the generic implementation of .insert_rows(...) and .insert_fixed_rows(...) which have nicer API interfaces.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

ยงResizing and reshaping

Source

pub fn fixed_resize<const R2: usize, const C2: usize>( self, val: T, ) -> OMatrix<T, Const<R2>, Const<C2>>
where DefaultAllocator: Reallocator<T, R, C, Const<R2>, Const<C2>>,

Resizes this matrix so that it contains R2::value() rows and C2::value() columns.

The values are copied such that self[(i, j)] == result[(i, j)]. If the result has more rows and/or columns than self, then the extra rows or columns are filled with val.

Source

pub fn resize_generic<R2: Dim, C2: Dim>( self, new_nrows: R2, new_ncols: C2, val: T, ) -> OMatrix<T, R2, C2>
where DefaultAllocator: Reallocator<T, R, C, R2, C2>,

Resizes self such that it has dimensions new_nrows ร— new_ncols.

The values are copied such that self[(i, j)] == result[(i, j)]. If the result has more rows and/or columns than self, then the extra rows or columns are filled with val.

Source

pub fn reshape_generic<R2, C2>( self, new_nrows: R2, new_ncols: C2, ) -> Matrix<T, R2, C2, S::Output>
where R2: Dim, C2: Dim, S: ReshapableStorage<T, R, C, R2, C2>,

Reshapes self such that it has dimensions new_nrows ร— new_ncols.

This will reinterpret self as if it is a matrix with new_nrows rows and new_ncols columns. The arrangements of the component in the output matrix are the same as what would be obtained by Matrix::from_slice_generic(self.as_slice(), new_nrows, new_ncols).

If self is a dynamically-sized matrix, then its components are neither copied nor moved. If self is staticyll-sized, then a copy may happen in some situations. This function will panic if the given dimensions are such that the number of elements of the input matrix are not equal to the number of elements of the output matrix.

ยงExamples

let m1 = Matrix2x3::new(
    1.1, 1.2, 1.3,
    2.1, 2.2, 2.3
);
let m2 = Matrix3x2::new(
    1.1, 2.2,
    2.1, 1.3,
    1.2, 2.3
);
let reshaped = m1.reshape_generic(Const::<3>, Const::<2>);
assert_eq!(reshaped, m2);

let dm1 = DMatrix::from_row_slice(
    4,
    3,
    &[
        1.0, 0.0, 0.0,
        0.0, 0.0, 1.0,
        0.0, 0.0, 0.0,
        0.0, 1.0, 0.0
    ],
);
let dm2 = DMatrix::from_row_slice(
    6,
    2,
    &[
        1.0, 0.0,
        0.0, 1.0,
        0.0, 0.0,
        0.0, 1.0,
        0.0, 0.0,
        0.0, 0.0,
    ],
);
let reshaped = dm1.reshape_generic(Dyn(6), Dyn(2));
assert_eq!(reshaped, dm2);
Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงViews based on ranges

ยงIndices to Individual Elements
ยงTwo-Dimensional Indices
let matrix = Matrix2::new(0, 2,
                          1, 3);

assert_eq!(matrix.index((0, 0)), &0);
assert_eq!(matrix.index((1, 0)), &1);
assert_eq!(matrix.index((0, 1)), &2);
assert_eq!(matrix.index((1, 1)), &3);
ยงLinear Address Indexing
let matrix = Matrix2::new(0, 2,
                          1, 3);

assert_eq!(matrix.get(0), Some(&0));
assert_eq!(matrix.get(1), Some(&1));
assert_eq!(matrix.get(2), Some(&2));
assert_eq!(matrix.get(3), Some(&3));
ยงIndices to Individual Rows and Columns
ยงIndex to a Row
let matrix = Matrix2::new(0, 2,
                          1, 3);

assert!(matrix.index((0, ..))
    .eq(&Matrix1x2::new(0, 2)));
ยงIndex to a Column
let matrix = Matrix2::new(0, 2,
                          1, 3);

assert!(matrix.index((.., 0))
    .eq(&Matrix2x1::new(0,
                        1)));
ยงIndices to Parts of Individual Rows and Columns
ยงIndex to a Partial Row
let matrix = Matrix3::new(0, 3, 6,
                          1, 4, 7,
                          2, 5, 8);

assert!(matrix.index((0, ..2))
    .eq(&Matrix1x2::new(0, 3)));
ยงIndex to a Partial Column
let matrix = Matrix3::new(0, 3, 6,
                          1, 4, 7,
                          2, 5, 8);

assert!(matrix.index((..2, 0))
    .eq(&Matrix2x1::new(0,
                        1)));

assert!(matrix.index((Const::<1>.., 0))
    .eq(&Matrix2x1::new(1,
                        2)));
ยงIndices to Ranges of Rows and Columns
ยงIndex to a Range of Rows
let matrix = Matrix3::new(0, 3, 6,
                          1, 4, 7,
                          2, 5, 8);

assert!(matrix.index((1..3, ..))
    .eq(&Matrix2x3::new(1, 4, 7,
                        2, 5, 8)));
ยงIndex to a Range of Columns
let matrix = Matrix3::new(0, 3, 6,
                          1, 4, 7,
                          2, 5, 8);

assert!(matrix.index((.., 1..3))
    .eq(&Matrix3x2::new(3, 6,
                        4, 7,
                        5, 8)));
Source

pub fn get<'a, I>(&'a self, index: I) -> Option<I::Output>
where I: MatrixIndex<'a, T, R, C, S>,

Produces a view of the data at the given index, or None if the index is out of bounds.

Source

pub fn get_mut<'a, I>(&'a mut self, index: I) -> Option<I::OutputMut>
where S: RawStorageMut<T, R, C>, I: MatrixIndexMut<'a, T, R, C, S>,

Produces a mutable view of the data at the given index, or None if the index is out of bounds.

Source

pub fn index<'a, I>(&'a self, index: I) -> I::Output
where I: MatrixIndex<'a, T, R, C, S>,

Produces a view of the data at the given index, or panics if the index is out of bounds.

Source

pub fn index_mut<'a, I>(&'a mut self, index: I) -> I::OutputMut
where S: RawStorageMut<T, R, C>, I: MatrixIndexMut<'a, T, R, C, S>,

Produces a mutable view of the data at the given index, or panics if the index is out of bounds.

Source

pub unsafe fn get_unchecked<'a, I>(&'a self, index: I) -> I::Output
where I: MatrixIndex<'a, T, R, C, S>,

Produces a view of the data at the given index, without doing any bounds checking.

ยงSafety

index must within bounds of the array.

Source

pub unsafe fn get_unchecked_mut<'a, I>(&'a mut self, index: I) -> I::OutputMut
where S: RawStorageMut<T, R, C>, I: MatrixIndexMut<'a, T, R, C, S>,

Returns a mutable view of the data at the given index, without doing any bounds checking.

ยงSafety

index must within bounds of the array.

Sourceยง

impl<T, R, C, S> Matrix<T, R, C, S>

Source

pub const unsafe fn from_data_statically_unchecked( data: S, ) -> Matrix<T, R, C, S>

Creates a new matrix with the given data without statically checking that the matrix dimension matches the storage dimension.

ยงSafety

The storage dimension must match the given dimensions.

Sourceยง

impl<T, const R: usize, const C: usize> Matrix<T, Const<R>, Const<C>, ArrayStorage<T, R, C>>

Source

pub const fn from_array_storage(storage: ArrayStorage<T, R, C>) -> Self

Creates a new statically-allocated matrix from the given ArrayStorage.

This method exists primarily as a workaround for the fact that from_data can not work in const fn contexts.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim> Matrix<MaybeUninit<T>, R, C, <DefaultAllocator as Allocator<R, C>>::BufferUninit<T>>

Source

pub unsafe fn assume_init(self) -> OMatrix<T, R, C>

Assumes a matrixโ€™s entries to be initialized. This operation should be near zero-cost.

ยงSafety

The user must make sure that every single entry of the buffer has been initialized, or Undefined Behavior will immediately occur.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

Source

pub const fn from_data(data: S) -> Self

Creates a new matrix with the given data.

Source

pub fn shape(&self) -> (usize, usize)

The shape of this matrix returned as the tuple (number of rows, number of columns).

ยงExample
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.shape(), (3, 4));
Source

pub fn shape_generic(&self) -> (R, C)

The shape of this matrix wrapped into their representative types (Const or Dyn).

Source

pub fn nrows(&self) -> usize

The number of rows of this matrix.

ยงExample
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.nrows(), 3);
Source

pub fn ncols(&self) -> usize

The number of columns of this matrix.

ยงExample
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.ncols(), 4);
Source

pub fn strides(&self) -> (usize, usize)

The strides (row stride, column stride) of this matrix.

ยงExample
let mat = DMatrix::<f32>::zeros(10, 10);
let view = mat.view_with_steps((0, 0), (5, 3), (1, 2));
// The column strides is the number of steps (here 2) multiplied by the corresponding dimension.
assert_eq!(mat.strides(), (1, 10));
Source

pub fn vector_to_matrix_index(&self, i: usize) -> (usize, usize)

Computes the row and column coordinates of the i-th element of this matrix seen as a vector.

ยงExample
let m = Matrix2::new(1, 2,
                     3, 4);
let i = m.vector_to_matrix_index(3);
assert_eq!(i, (1, 1));
assert_eq!(m[i], m[3]);
Source

pub fn as_ptr(&self) -> *const T

Returns a pointer to the start of the matrix.

If the matrix is not empty, this pointer is guaranteed to be aligned and non-null.

ยงExample
let m = Matrix2::new(1, 2,
                     3, 4);
let ptr = m.as_ptr();
assert_eq!(unsafe { *ptr }, m[0]);
Source

pub fn relative_eq<R2, C2, SB>( &self, other: &Matrix<T, R2, C2, SB>, eps: T::Epsilon, max_relative: T::Epsilon, ) -> bool
where T: RelativeEq + Scalar, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, T::Epsilon: Clone, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Tests whether self and rhs are equal up to a given epsilon.

See relative_eq from the RelativeEq trait for more details.

Source

pub fn eq<R2, C2, SB>(&self, other: &Matrix<T, R2, C2, SB>) -> bool
where T: PartialEq, R2: Dim, C2: Dim, SB: RawStorage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Tests whether self and rhs are exactly equal.

Source

pub fn into_owned(self) -> OMatrix<T, R, C>
where T: Scalar, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Moves this matrix into one that owns its data.

Source

pub fn into_owned_sum<R2, C2>(self) -> MatrixSum<T, R, C, R2, C2>
where T: Scalar, S: Storage<T, R, C>, R2: Dim, C2: Dim, DefaultAllocator: SameShapeAllocator<R, C, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Moves this matrix into one that owns its data. The actual type of the result depends on matrix storage combination rules for addition.

Source

pub fn clone_owned(&self) -> OMatrix<T, R, C>
where T: Scalar, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Clones this matrix to one that owns its data.

Source

pub fn clone_owned_sum<R2, C2>(&self) -> MatrixSum<T, R, C, R2, C2>
where T: Scalar, S: Storage<T, R, C>, R2: Dim, C2: Dim, DefaultAllocator: SameShapeAllocator<R, C, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Clones this matrix into one that owns its data. The actual type of the result depends on matrix storage combination rules for addition.

Source

pub fn transpose_to<R2, C2, SB>(&self, out: &mut Matrix<T, R2, C2, SB>)
where T: Scalar, R2: Dim, C2: Dim, SB: RawStorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,

Transposes self and store the result into out.

Source

pub fn transpose(&self) -> OMatrix<T, C, R>

Transposes self.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงElementwise mapping and folding

Source

pub fn map<T2: Scalar, F: FnMut(T) -> T2>(&self, f: F) -> OMatrix<T2, R, C>

Returns a matrix containing the result of f applied to each of its entries.

Source

pub fn cast<T2: Scalar>(self) -> OMatrix<T2, R, C>
where T: Scalar, OMatrix<T2, R, C>: SupersetOf<Self>, DefaultAllocator: Allocator<R, C>,

Cast the components of self to another type.

ยงExample
let q = Vector3::new(1.0f64, 2.0, 3.0);
let q2 = q.cast::<f32>();
assert_eq!(q2, Vector3::new(1.0f32, 2.0, 3.0));
Source

pub fn try_cast<T2: Scalar>(self) -> Option<OMatrix<T2, R, C>>
where T: Scalar, Self: SupersetOf<OMatrix<T2, R, C>>, DefaultAllocator: Allocator<R, C>,

Attempts to cast the components of self to another type.

ยงExample
let q = Vector3::new(1.0f64, 2.0, 3.0);
let q2 = q.try_cast::<i32>();
assert_eq!(q2, Some(Vector3::new(1, 2, 3)));
Source

pub fn fold_with<T2>( &self, init_f: impl FnOnce(Option<&T>) -> T2, f: impl FnMut(T2, &T) -> T2, ) -> T2
where T: Scalar,

Similar to self.iter().fold(init, f) except that init is replaced by a closure.

The initialization closure is given the first component of this matrix:

  • If the matrix has no component (0 rows or 0 columns) then init_f is called with None and its return value is the value returned by this method.
  • If the matrix has has least one component, then init_f is called with the first component to compute the initial value. Folding then continues on all the remaining components of the matrix.
Source

pub fn map_with_location<T2: Scalar, F: FnMut(usize, usize, T) -> T2>( &self, f: F, ) -> OMatrix<T2, R, C>

Returns a matrix containing the result of f applied to each of its entries. Unlike map, f also gets passed the row and column index, i.e. f(row, col, value).

Source

pub fn zip_map<T2, N3, S2, F>( &self, rhs: &Matrix<T2, R, C, S2>, f: F, ) -> OMatrix<N3, R, C>
where T: Scalar, T2: Scalar, N3: Scalar, S2: RawStorage<T2, R, C>, F: FnMut(T, T2) -> N3, DefaultAllocator: Allocator<R, C>,

Returns a matrix containing the result of f applied to each entries of self and rhs.

Source

pub fn zip_zip_map<T2, N3, N4, S2, S3, F>( &self, b: &Matrix<T2, R, C, S2>, c: &Matrix<N3, R, C, S3>, f: F, ) -> OMatrix<N4, R, C>
where T: Scalar, T2: Scalar, N3: Scalar, N4: Scalar, S2: RawStorage<T2, R, C>, S3: RawStorage<N3, R, C>, F: FnMut(T, T2, N3) -> N4, DefaultAllocator: Allocator<R, C>,

Returns a matrix containing the result of f applied to each entries of self and b, and c.

Source

pub fn fold<Acc>(&self, init: Acc, f: impl FnMut(Acc, T) -> Acc) -> Acc
where T: Scalar,

Folds a function f on each entry of self.

Source

pub fn zip_fold<T2, R2, C2, S2, Acc>( &self, rhs: &Matrix<T2, R2, C2, S2>, init: Acc, f: impl FnMut(Acc, T, T2) -> Acc, ) -> Acc
where T: Scalar, T2: Scalar, R2: Dim, C2: Dim, S2: RawStorage<T2, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Folds a function f on each pairs of entries from self and rhs.

Source

pub fn apply<F: FnMut(&mut T)>(&mut self, f: F)
where S: RawStorageMut<T, R, C>,

Applies a closure f to modify each component of self.

Source

pub fn zip_apply<T2, R2, C2, S2>( &mut self, rhs: &Matrix<T2, R2, C2, S2>, f: impl FnMut(&mut T, T2), )
where S: RawStorageMut<T, R, C>, T2: Scalar, R2: Dim, C2: Dim, S2: RawStorage<T2, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Replaces each component of self by the result of a closure f applied on its components joined with the components from rhs.

Source

pub fn zip_zip_apply<T2, R2, C2, S2, N3, R3, C3, S3>( &mut self, b: &Matrix<T2, R2, C2, S2>, c: &Matrix<N3, R3, C3, S3>, f: impl FnMut(&mut T, T2, N3), )
where S: RawStorageMut<T, R, C>, T2: Scalar, R2: Dim, C2: Dim, S2: RawStorage<T2, R2, C2>, N3: Scalar, R3: Dim, C3: Dim, S3: RawStorage<N3, R3, C3>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Replaces each component of self by the result of a closure f applied on its components joined with the components from b and c.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงIteration on components, rows, and columns

Source

pub fn iter(&self) -> MatrixIter<'_, T, R, C, S> โ“˜

Iterates through this matrix coordinates in column-major order.

ยงExample
let mat = Matrix2x3::new(11, 12, 13,
                         21, 22, 23);
let mut it = mat.iter();
assert_eq!(*it.next().unwrap(), 11);
assert_eq!(*it.next().unwrap(), 21);
assert_eq!(*it.next().unwrap(), 12);
assert_eq!(*it.next().unwrap(), 22);
assert_eq!(*it.next().unwrap(), 13);
assert_eq!(*it.next().unwrap(), 23);
assert!(it.next().is_none());
Source

pub const fn row_iter(&self) -> RowIter<'_, T, R, C, S> โ“˜

Iterate through the rows of this matrix.

ยงExample
let mut a = Matrix2x3::new(1, 2, 3,
                           4, 5, 6);
for (i, row) in a.row_iter().enumerate() {
    assert_eq!(row, a.row(i))
}
Source

pub fn column_iter(&self) -> ColumnIter<'_, T, R, C, S> โ“˜

Iterate through the columns of this matrix.

ยงExample
let mut a = Matrix2x3::new(1, 2, 3,
                           4, 5, 6);
for (i, column) in a.column_iter().enumerate() {
    assert_eq!(column, a.column(i))
}
Source

pub fn iter_mut(&mut self) -> MatrixIterMut<'_, T, R, C, S> โ“˜
where S: RawStorageMut<T, R, C>,

Mutably iterates through this matrix coordinates.

Source

pub const fn row_iter_mut(&mut self) -> RowIterMut<'_, T, R, C, S> โ“˜
where S: RawStorageMut<T, R, C>,

Mutably iterates through this matrix rows.

ยงExample
let mut a = Matrix2x3::new(1, 2, 3,
                           4, 5, 6);
for (i, mut row) in a.row_iter_mut().enumerate() {
    row *= (i + 1) * 10;
}

let expected = Matrix2x3::new(10, 20, 30,
                              80, 100, 120);
assert_eq!(a, expected);
Source

pub fn column_iter_mut(&mut self) -> ColumnIterMut<'_, T, R, C, S> โ“˜
where S: RawStorageMut<T, R, C>,

Mutably iterates through this matrix columns.

ยงExample
let mut a = Matrix2x3::new(1, 2, 3,
                           4, 5, 6);
for (i, mut col) in a.column_iter_mut().enumerate() {
    col *= (i + 1) * 10;
}

let expected = Matrix2x3::new(10, 40, 90,
                              40, 100, 180);
assert_eq!(a, expected);
Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns a mutable pointer to the start of the matrix.

If the matrix is not empty, this pointer is guaranteed to be aligned and non-null.

Source

pub unsafe fn swap_unchecked( &mut self, row_cols1: (usize, usize), row_cols2: (usize, usize), )

Swaps two entries without bound-checking.

ยงSafety

Both (r, c) must have r < nrows(), c < ncols().

Source

pub fn swap(&mut self, row_cols1: (usize, usize), row_cols2: (usize, usize))

Swaps two entries.

Source

pub fn copy_from_slice(&mut self, slice: &[T])
where T: Scalar,

Fills this matrix with the content of a slice. Both must hold the same number of elements.

The components of the slice are assumed to be ordered in column-major order.

Source

pub fn copy_from<R2, C2, SB>(&mut self, other: &Matrix<T, R2, C2, SB>)
where T: Scalar, R2: Dim, C2: Dim, SB: RawStorage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Fills this matrix with the content of another one. Both must have the same shape.

Source

pub fn tr_copy_from<R2, C2, SB>(&mut self, other: &Matrix<T, R2, C2, SB>)
where T: Scalar, R2: Dim, C2: Dim, SB: RawStorage<T, R2, C2>, ShapeConstraint: DimEq<R, C2> + SameNumberOfColumns<C, R2>,

Fills this matrix with the content of the transpose another one.

Source

pub fn apply_into<F: FnMut(&mut T)>(self, f: F) -> Self

Returns self with each of its components replaced by the result of a closure f applied on it.

Sourceยง

impl<T, D: Dim, S: RawStorage<T, D>> Matrix<T, D, Const<1>, S>

Source

pub unsafe fn vget_unchecked(&self, i: usize) -> &T

Gets a reference to the i-th element of this column vector without bound checking.

ยงSafety

i must be less than D.

Sourceยง

impl<T, D: Dim, S: RawStorageMut<T, D>> Matrix<T, D, Const<1>, S>

Source

pub unsafe fn vget_unchecked_mut(&mut self, i: usize) -> &mut T

Gets a mutable reference to the i-th element of this column vector without bound checking.

ยงSafety

i must be less than D.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C> + IsContiguous> Matrix<T, R, C, S>

Source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire matrix entries ordered column-by-columns.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C> + IsContiguous> Matrix<T, R, C, S>

Source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice containing the entire matrix entries ordered column-by-columns.

Sourceยง

impl<T: Scalar, D: Dim, S: RawStorageMut<T, D, D>> Matrix<T, D, D, S>

Source

pub fn transpose_mut(&mut self)

Transposes the square matrix self in-place.

Sourceยง

impl<T: SimdComplexField, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn adjoint_to<R2, C2, SB>(&self, out: &mut Matrix<T, R2, C2, SB>)
where R2: Dim, C2: Dim, SB: RawStorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,

Takes the adjoint (aka. conjugate-transpose) of self and store the result into out.

Source

pub fn adjoint(&self) -> OMatrix<T, C, R>

The adjoint (aka. conjugate-transpose) of self.

Source

pub fn conjugate_transpose_to<R2, C2, SB>( &self, out: &mut Matrix<T, R2, C2, SB>, )
where R2: Dim, C2: Dim, SB: RawStorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,

๐Ÿ‘ŽDeprecated: Renamed self.adjoint_to(out).

Takes the conjugate and transposes self and store the result into out.

Source

pub fn conjugate_transpose(&self) -> OMatrix<T, C, R>

๐Ÿ‘ŽDeprecated: Renamed self.adjoint().

The conjugate transposition of self.

Source

pub fn conjugate(&self) -> OMatrix<T, R, C>

The conjugate of self.

Source

pub fn unscale(&self, real: T::SimdRealField) -> OMatrix<T, R, C>

Divides each component of the complex matrix self by the given real.

Source

pub fn scale(&self, real: T::SimdRealField) -> OMatrix<T, R, C>

Multiplies each component of the complex matrix self by the given real.

Sourceยง

impl<T: SimdComplexField, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

Source

pub fn conjugate_mut(&mut self)

The conjugate of the complex matrix self computed in-place.

Source

pub fn unscale_mut(&mut self, real: T::SimdRealField)

Divides each component of the complex matrix self by the given real.

Source

pub fn scale_mut(&mut self, real: T::SimdRealField)

Multiplies each component of the complex matrix self by the given real.

Sourceยง

impl<T: SimdComplexField, D: Dim, S: RawStorageMut<T, D, D>> Matrix<T, D, D, S>

Source

pub fn conjugate_transform_mut(&mut self)

๐Ÿ‘ŽDeprecated: Renamed to self.adjoint_mut().

Sets self to its adjoint.

Source

pub fn adjoint_mut(&mut self)

Sets self to its adjoint (aka. conjugate-transpose).

Sourceยง

impl<T: Scalar, D: Dim, S: RawStorage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn diagonal(&self) -> OVector<T, D>

The diagonal of this matrix.

Source

pub fn map_diagonal<T2: Scalar>(&self, f: impl FnMut(T) -> T2) -> OVector<T2, D>

Apply the given function to this matrixโ€™s diagonal and returns it.

This is a more efficient version of self.diagonal().map(f) since this allocates only once.

Source

pub fn trace(&self) -> T

Computes a trace of a square matrix, i.e., the sum of its diagonal elements.

Sourceยง

impl<T: SimdComplexField, D: Dim, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn symmetric_part(&self) -> OMatrix<T, D, D>

The symmetric part of self, i.e., 0.5 * (self + self.transpose()).

Source

pub fn hermitian_part(&self) -> OMatrix<T, D, D>

The hermitian part of self, i.e., 0.5 * (self + self.adjoint()).

Sourceยง

impl<T: Scalar + Zero + One, D: DimAdd<U1> + IsNotStaticOne, S: RawStorage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn to_homogeneous(&self) -> OMatrix<T, DimSum<D, U1>, DimSum<D, U1>>

Yields the homogeneous matrix for this matrix, i.e., appending an additional dimension and and setting the diagonal element to 1.

Sourceยง

impl<T: Scalar + Zero, D: DimAdd<U1>, S: RawStorage<T, D>> Matrix<T, D, Const<1>, S>

Source

pub fn to_homogeneous(&self) -> OVector<T, DimSum<D, U1>>

Computes the coordinates in projective space of this vector, i.e., appends a 0 to its coordinates.

Source

pub fn from_homogeneous<SB>( v: Vector<T, DimSum<D, U1>, SB>, ) -> Option<OVector<T, D>>

Constructs a vector from coordinates in projective space, i.e., removes a 0 at the end of self. Returns None if this last component is not zero.

Sourceยง

impl<T: Scalar, D: DimAdd<U1>, S: RawStorage<T, D>> Matrix<T, D, Const<1>, S>

Source

pub fn push(&self, element: T) -> OVector<T, DimSum<D, U1>>

Constructs a new vector of higher dimension by appending element to the end of self.

Sourceยง

impl<T: Scalar + ClosedAddAssign + ClosedSubAssign + ClosedMulAssign, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงCross product

Source

pub fn perp<R2, C2, SB>(&self, b: &Matrix<T, R2, C2, SB>) -> T

The perpendicular product between two 2D column vectors, i.e. a.x * b.y - a.y * b.x.

Source

pub fn cross<R2, C2, SB>( &self, b: &Matrix<T, R2, C2, SB>, ) -> MatrixCross<T, R, C, R2, C2>
where R2: Dim, C2: Dim, SB: RawStorage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R, C, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

The 3D cross product between two vectors.

Panics if the shape is not 3D vector. In the future, this will be implemented only for dynamically-sized matrices and statically-sized 3D matrices.

Sourceยง

impl<T: Scalar + Field, S: RawStorage<T, U3>> Matrix<T, Const<3>, Const<1>, S>

Source

pub fn cross_matrix(&self) -> OMatrix<T, U3, U3>

Computes the matrix M such that for all vector v we have M * v == self.cross(&v).

Sourceยง

impl<T: SimdComplexField, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn angle<R2: Dim, C2: Dim, SB>( &self, other: &Matrix<T, R2, C2, SB>, ) -> T::SimdRealField
where SB: Storage<T, R2, C2>, ShapeConstraint: DimEq<R, R2> + DimEq<C, C2>,

The smallest angle between two vectors.

Sourceยง

impl<T, S> Matrix<T, U1, U1, S>
where S: RawStorage<T, U1, U1>,

Source

pub fn as_scalar(&self) -> &T

Returns a reference to the single element in this matrix.

As opposed to indexing, using this provides type-safety when flattening dimensions.

ยงExample
let v = Vector3::new(0., 0., 1.);
let inner_product: f32 = *(v.transpose() * v).as_scalar();
โ“˜
 let v = Vector3::new(0., 0., 1.);
 let inner_product = (v * v.transpose()).item(); // Typo, does not compile.
Source

pub fn as_scalar_mut(&mut self) -> &mut T
where S: RawStorageMut<T, U1>,

Get a mutable reference to the single element in this matrix

As opposed to indexing, using this provides type-safety when flattening dimensions.

ยงExample
let v = Vector3::new(0., 0., 1.);
let mut inner_product = (v.transpose() * v);
*inner_product.as_scalar_mut() = 3.;
โ“˜
 let v = Vector3::new(0., 0., 1.);
 let mut inner_product = (v * v.transpose());
 *inner_product.as_scalar_mut() = 3.;
Source

pub fn to_scalar(&self) -> T
where T: Clone,

Convert this 1x1 matrix by reference into a scalar.

As opposed to indexing, using this provides type-safety when flattening dimensions.

ยงExample
let v = Vector3::new(0., 0., 1.);
let mut inner_product: f32 = (v.transpose() * v).to_scalar();
โ“˜
 let v = Vector3::new(0., 0., 1.);
 let mut inner_product: f32 = (v * v.transpose()).to_scalar();
Sourceยง

impl<T> Matrix<T, Const<1>, Const<1>, ArrayStorage<T, 1, 1>>

Source

pub fn into_scalar(self) -> T

Convert this 1x1 matrix into a scalar.

As opposed to indexing, using this provides type-safety when flattening dimensions.

ยงExample
let v = Vector3::new(0., 0., 1.);
let inner_product: f32 = (v.transpose() * v).into_scalar();
assert_eq!(inner_product, 1.);
โ“˜
 let v = Vector3::new(0., 0., 1.);
 let mut inner_product: f32 = (v * v.transpose()).into_scalar();
Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงViews based on index and length

Source

pub fn row(&self, i: usize) -> MatrixView<'_, T, U1, C, S::RStride, S::CStride>

Returns a view containing the i-th row of this matrix.

Source

pub fn row_part( &self, i: usize, n: usize, ) -> MatrixView<'_, T, U1, Dyn, S::RStride, S::CStride>

Returns a view containing the n first elements of the i-th row of this matrix.

Source

pub fn rows( &self, first_row: usize, nrows: usize, ) -> MatrixView<'_, T, Dyn, C, S::RStride, S::CStride>

Extracts from this matrix a set of consecutive rows.

Source

pub fn rows_with_step( &self, first_row: usize, nrows: usize, step: usize, ) -> MatrixView<'_, T, Dyn, C, Dyn, S::CStride>

Extracts from this matrix a set of consecutive rows regularly skipping step rows.

Source

pub fn fixed_rows<const RVIEW: usize>( &self, first_row: usize, ) -> MatrixView<'_, T, Const<RVIEW>, C, S::RStride, S::CStride>

Extracts a compile-time number of consecutive rows from this matrix.

Source

pub fn fixed_rows_with_step<const RVIEW: usize>( &self, first_row: usize, step: usize, ) -> MatrixView<'_, T, Const<RVIEW>, C, Dyn, S::CStride>

Extracts from this matrix a compile-time number of rows regularly skipping step rows.

Source

pub fn rows_generic<RView: Dim>( &self, row_start: usize, nrows: RView, ) -> MatrixView<'_, T, RView, C, S::RStride, S::CStride>

Extracts from this matrix nrows rows regularly skipping step rows. Both argument may or may not be values known at compile-time.

Source

pub fn rows_generic_with_step<RView>( &self, row_start: usize, nrows: RView, step: usize, ) -> MatrixView<'_, T, RView, C, Dyn, S::CStride>
where RView: Dim,

Extracts from this matrix nrows rows regularly skipping step rows. Both argument may or may not be values known at compile-time.

Source

pub fn column( &self, i: usize, ) -> MatrixView<'_, T, R, U1, S::RStride, S::CStride>

Returns a view containing the i-th column of this matrix.

Source

pub fn column_part( &self, i: usize, n: usize, ) -> MatrixView<'_, T, Dyn, U1, S::RStride, S::CStride>

Returns a view containing the n first elements of the i-th column of this matrix.

Source

pub fn columns( &self, first_col: usize, ncols: usize, ) -> MatrixView<'_, T, R, Dyn, S::RStride, S::CStride>

Extracts from this matrix a set of consecutive columns.

Source

pub fn columns_with_step( &self, first_col: usize, ncols: usize, step: usize, ) -> MatrixView<'_, T, R, Dyn, S::RStride, Dyn>

Extracts from this matrix a set of consecutive columns regularly skipping step columns.

Source

pub fn fixed_columns<const CVIEW: usize>( &self, first_col: usize, ) -> MatrixView<'_, T, R, Const<CVIEW>, S::RStride, S::CStride>

Extracts a compile-time number of consecutive columns from this matrix.

Source

pub fn fixed_columns_with_step<const CVIEW: usize>( &self, first_col: usize, step: usize, ) -> MatrixView<'_, T, R, Const<CVIEW>, S::RStride, Dyn>

Extracts from this matrix a compile-time number of columns regularly skipping step columns.

Source

pub fn columns_generic<CView: Dim>( &self, first_col: usize, ncols: CView, ) -> MatrixView<'_, T, R, CView, S::RStride, S::CStride>

Extracts from this matrix ncols columns. The number of columns may or may not be known at compile-time.

Source

pub fn columns_generic_with_step<CView: Dim>( &self, first_col: usize, ncols: CView, step: usize, ) -> MatrixView<'_, T, R, CView, S::RStride, Dyn>

Extracts from this matrix ncols columns skipping step columns. Both argument may or may not be values known at compile-time.

Source

pub fn slice( &self, start: (usize, usize), shape: (usize, usize), ) -> MatrixView<'_, T, Dyn, Dyn, S::RStride, S::CStride>

๐Ÿ‘ŽDeprecated: Use view instead. See issue #1076 for more information.

Slices this matrix starting at its component (irow, icol) and with (nrows, ncols) consecutive elements.

Source

pub fn view( &self, start: (usize, usize), shape: (usize, usize), ) -> MatrixView<'_, T, Dyn, Dyn, S::RStride, S::CStride>

Return a view of this matrix starting at its component (irow, icol) and with (nrows, ncols) consecutive elements.

Source

pub fn slice_with_steps( &self, start: (usize, usize), shape: (usize, usize), steps: (usize, usize), ) -> MatrixView<'_, T, Dyn, Dyn, Dyn, Dyn>

๐Ÿ‘ŽDeprecated: Use view_with_steps instead. See issue #1076 for more information.

Slices this matrix starting at its component (start.0, start.1) and with (shape.0, shape.1) components. Each row (resp. column) of the sliced matrix is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn view_with_steps( &self, start: (usize, usize), shape: (usize, usize), steps: (usize, usize), ) -> MatrixView<'_, T, Dyn, Dyn, Dyn, Dyn>

Return a view of this matrix starting at its component (start.0, start.1) and with (shape.0, shape.1) components. Each row (resp. column) of the matrix view is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn fixed_slice<const RVIEW: usize, const CVIEW: usize>( &self, irow: usize, icol: usize, ) -> MatrixView<'_, T, Const<RVIEW>, Const<CVIEW>, S::RStride, S::CStride>

๐Ÿ‘ŽDeprecated: Use fixed_view instead. See issue #1076 for more information.

Slices this matrix starting at its component (irow, icol) and with (RVIEW, CVIEW) consecutive components.

Source

pub fn fixed_view<const RVIEW: usize, const CVIEW: usize>( &self, irow: usize, icol: usize, ) -> MatrixView<'_, T, Const<RVIEW>, Const<CVIEW>, S::RStride, S::CStride>

Return a view of this matrix starting at its component (irow, icol) and with (RVIEW, CVIEW) consecutive components.

Source

pub fn fixed_slice_with_steps<const RVIEW: usize, const CVIEW: usize>( &self, start: (usize, usize), steps: (usize, usize), ) -> MatrixView<'_, T, Const<RVIEW>, Const<CVIEW>, Dyn, Dyn>

๐Ÿ‘ŽDeprecated: Use fixed_view_with_steps instead. See issue #1076 for more information.

Slices this matrix starting at its component (start.0, start.1) and with (RVIEW, CVIEW) components. Each row (resp. column) of the sliced matrix is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn fixed_view_with_steps<const RVIEW: usize, const CVIEW: usize>( &self, start: (usize, usize), steps: (usize, usize), ) -> MatrixView<'_, T, Const<RVIEW>, Const<CVIEW>, Dyn, Dyn>

Returns a view of this matrix starting at its component (start.0, start.1) and with (RVIEW, CVIEW) components. Each row (resp. column) of the matrix view is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn generic_slice<RView, CView>( &self, start: (usize, usize), shape: (RView, CView), ) -> MatrixView<'_, T, RView, CView, S::RStride, S::CStride>
where RView: Dim, CView: Dim,

๐Ÿ‘ŽDeprecated: Use generic_view instead. See issue #1076 for more information.

Creates a slice that may or may not have a fixed size and stride.

Source

pub fn generic_view<RView, CView>( &self, start: (usize, usize), shape: (RView, CView), ) -> MatrixView<'_, T, RView, CView, S::RStride, S::CStride>
where RView: Dim, CView: Dim,

Creates a matrix view that may or may not have a fixed size and stride.

Source

pub fn generic_slice_with_steps<RView, CView>( &self, start: (usize, usize), shape: (RView, CView), steps: (usize, usize), ) -> MatrixView<'_, T, RView, CView, Dyn, Dyn>
where RView: Dim, CView: Dim,

๐Ÿ‘ŽDeprecated: Use generic_view_with_steps instead. See issue #1076 for more information.

Creates a slice that may or may not have a fixed size and stride.

Source

pub fn generic_view_with_steps<RView, CView>( &self, start: (usize, usize), shape: (RView, CView), steps: (usize, usize), ) -> MatrixView<'_, T, RView, CView, Dyn, Dyn>
where RView: Dim, CView: Dim,

Creates a matrix view that may or may not have a fixed size and stride.

Source

pub fn rows_range_pair<Range1: DimRange<R>, Range2: DimRange<R>>( &self, r1: Range1, r2: Range2, ) -> (MatrixView<'_, T, Range1::Size, C, S::RStride, S::CStride>, MatrixView<'_, T, Range2::Size, C, S::RStride, S::CStride>)

Splits this NxM matrix into two parts delimited by two ranges.

Panics if the ranges overlap or if the first range is empty.

Source

pub fn columns_range_pair<Range1: DimRange<C>, Range2: DimRange<C>>( &self, r1: Range1, r2: Range2, ) -> (MatrixView<'_, T, R, Range1::Size, S::RStride, S::CStride>, MatrixView<'_, T, R, Range2::Size, S::RStride, S::CStride>)

Splits this NxM matrix into two parts delimited by two ranges.

Panics if the ranges overlap or if the first range is empty.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

ยงMutable views based on index and length

Source

pub fn row_mut( &mut self, i: usize, ) -> MatrixViewMut<'_, T, U1, C, S::RStride, S::CStride>

Returns a view containing the i-th row of this matrix.

Source

pub fn row_part_mut( &mut self, i: usize, n: usize, ) -> MatrixViewMut<'_, T, U1, Dyn, S::RStride, S::CStride>

Returns a view containing the n first elements of the i-th row of this matrix.

Source

pub fn rows_mut( &mut self, first_row: usize, nrows: usize, ) -> MatrixViewMut<'_, T, Dyn, C, S::RStride, S::CStride>

Extracts from this matrix a set of consecutive rows.

Source

pub fn rows_with_step_mut( &mut self, first_row: usize, nrows: usize, step: usize, ) -> MatrixViewMut<'_, T, Dyn, C, Dyn, S::CStride>

Extracts from this matrix a set of consecutive rows regularly skipping step rows.

Source

pub fn fixed_rows_mut<const RVIEW: usize>( &mut self, first_row: usize, ) -> MatrixViewMut<'_, T, Const<RVIEW>, C, S::RStride, S::CStride>

Extracts a compile-time number of consecutive rows from this matrix.

Source

pub fn fixed_rows_with_step_mut<const RVIEW: usize>( &mut self, first_row: usize, step: usize, ) -> MatrixViewMut<'_, T, Const<RVIEW>, C, Dyn, S::CStride>

Extracts from this matrix a compile-time number of rows regularly skipping step rows.

Source

pub fn rows_generic_mut<RView: Dim>( &mut self, row_start: usize, nrows: RView, ) -> MatrixViewMut<'_, T, RView, C, S::RStride, S::CStride>

Extracts from this matrix nrows rows regularly skipping step rows. Both argument may or may not be values known at compile-time.

Source

pub fn rows_generic_with_step_mut<RView>( &mut self, row_start: usize, nrows: RView, step: usize, ) -> MatrixViewMut<'_, T, RView, C, Dyn, S::CStride>
where RView: Dim,

Extracts from this matrix nrows rows regularly skipping step rows. Both argument may or may not be values known at compile-time.

Source

pub fn column_mut( &mut self, i: usize, ) -> MatrixViewMut<'_, T, R, U1, S::RStride, S::CStride>

Returns a view containing the i-th column of this matrix.

Source

pub fn column_part_mut( &mut self, i: usize, n: usize, ) -> MatrixViewMut<'_, T, Dyn, U1, S::RStride, S::CStride>

Returns a view containing the n first elements of the i-th column of this matrix.

Source

pub fn columns_mut( &mut self, first_col: usize, ncols: usize, ) -> MatrixViewMut<'_, T, R, Dyn, S::RStride, S::CStride>

Extracts from this matrix a set of consecutive columns.

Source

pub fn columns_with_step_mut( &mut self, first_col: usize, ncols: usize, step: usize, ) -> MatrixViewMut<'_, T, R, Dyn, S::RStride, Dyn>

Extracts from this matrix a set of consecutive columns regularly skipping step columns.

Source

pub fn fixed_columns_mut<const CVIEW: usize>( &mut self, first_col: usize, ) -> MatrixViewMut<'_, T, R, Const<CVIEW>, S::RStride, S::CStride>

Extracts a compile-time number of consecutive columns from this matrix.

Source

pub fn fixed_columns_with_step_mut<const CVIEW: usize>( &mut self, first_col: usize, step: usize, ) -> MatrixViewMut<'_, T, R, Const<CVIEW>, S::RStride, Dyn>

Extracts from this matrix a compile-time number of columns regularly skipping step columns.

Source

pub fn columns_generic_mut<CView: Dim>( &mut self, first_col: usize, ncols: CView, ) -> MatrixViewMut<'_, T, R, CView, S::RStride, S::CStride>

Extracts from this matrix ncols columns. The number of columns may or may not be known at compile-time.

Source

pub fn columns_generic_with_step_mut<CView: Dim>( &mut self, first_col: usize, ncols: CView, step: usize, ) -> MatrixViewMut<'_, T, R, CView, S::RStride, Dyn>

Extracts from this matrix ncols columns skipping step columns. Both argument may or may not be values known at compile-time.

Source

pub fn slice_mut( &mut self, start: (usize, usize), shape: (usize, usize), ) -> MatrixViewMut<'_, T, Dyn, Dyn, S::RStride, S::CStride>

๐Ÿ‘ŽDeprecated: Use view_mut instead. See issue #1076 for more information.

Slices this matrix starting at its component (irow, icol) and with (nrows, ncols) consecutive elements.

Source

pub fn view_mut( &mut self, start: (usize, usize), shape: (usize, usize), ) -> MatrixViewMut<'_, T, Dyn, Dyn, S::RStride, S::CStride>

Return a view of this matrix starting at its component (irow, icol) and with (nrows, ncols) consecutive elements.

Source

pub fn slice_with_steps_mut( &mut self, start: (usize, usize), shape: (usize, usize), steps: (usize, usize), ) -> MatrixViewMut<'_, T, Dyn, Dyn, Dyn, Dyn>

๐Ÿ‘ŽDeprecated: Use view_with_steps_mut instead. See issue #1076 for more information.

Slices this matrix starting at its component (start.0, start.1) and with (shape.0, shape.1) components. Each row (resp. column) of the sliced matrix is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn view_with_steps_mut( &mut self, start: (usize, usize), shape: (usize, usize), steps: (usize, usize), ) -> MatrixViewMut<'_, T, Dyn, Dyn, Dyn, Dyn>

Return a view of this matrix starting at its component (start.0, start.1) and with (shape.0, shape.1) components. Each row (resp. column) of the matrix view is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn fixed_slice_mut<const RVIEW: usize, const CVIEW: usize>( &mut self, irow: usize, icol: usize, ) -> MatrixViewMut<'_, T, Const<RVIEW>, Const<CVIEW>, S::RStride, S::CStride>

๐Ÿ‘ŽDeprecated: Use fixed_view_mut instead. See issue #1076 for more information.

Slices this matrix starting at its component (irow, icol) and with (RVIEW, CVIEW) consecutive components.

Source

pub fn fixed_view_mut<const RVIEW: usize, const CVIEW: usize>( &mut self, irow: usize, icol: usize, ) -> MatrixViewMut<'_, T, Const<RVIEW>, Const<CVIEW>, S::RStride, S::CStride>

Return a view of this matrix starting at its component (irow, icol) and with (RVIEW, CVIEW) consecutive components.

Source

pub fn fixed_slice_with_steps_mut<const RVIEW: usize, const CVIEW: usize>( &mut self, start: (usize, usize), steps: (usize, usize), ) -> MatrixViewMut<'_, T, Const<RVIEW>, Const<CVIEW>, Dyn, Dyn>

๐Ÿ‘ŽDeprecated: Use fixed_view_with_steps_mut instead. See issue #1076 for more information.

Slices this matrix starting at its component (start.0, start.1) and with (RVIEW, CVIEW) components. Each row (resp. column) of the sliced matrix is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn fixed_view_with_steps_mut<const RVIEW: usize, const CVIEW: usize>( &mut self, start: (usize, usize), steps: (usize, usize), ) -> MatrixViewMut<'_, T, Const<RVIEW>, Const<CVIEW>, Dyn, Dyn>

Returns a view of this matrix starting at its component (start.0, start.1) and with (RVIEW, CVIEW) components. Each row (resp. column) of the matrix view is separated by steps.0 (resp. steps.1) ignored rows (resp. columns) of the original matrix.

Source

pub fn generic_slice_mut<RView, CView>( &mut self, start: (usize, usize), shape: (RView, CView), ) -> MatrixViewMut<'_, T, RView, CView, S::RStride, S::CStride>
where RView: Dim, CView: Dim,

๐Ÿ‘ŽDeprecated: Use generic_view_mut instead. See issue #1076 for more information.

Creates a slice that may or may not have a fixed size and stride.

Source

pub fn generic_view_mut<RView, CView>( &mut self, start: (usize, usize), shape: (RView, CView), ) -> MatrixViewMut<'_, T, RView, CView, S::RStride, S::CStride>
where RView: Dim, CView: Dim,

Creates a matrix view that may or may not have a fixed size and stride.

Source

pub fn generic_slice_with_steps_mut<RView, CView>( &mut self, start: (usize, usize), shape: (RView, CView), steps: (usize, usize), ) -> MatrixViewMut<'_, T, RView, CView, Dyn, Dyn>
where RView: Dim, CView: Dim,

๐Ÿ‘ŽDeprecated: Use generic_view_with_steps_mut instead. See issue #1076 for more information.

Creates a slice that may or may not have a fixed size and stride.

Source

pub fn generic_view_with_steps_mut<RView, CView>( &mut self, start: (usize, usize), shape: (RView, CView), steps: (usize, usize), ) -> MatrixViewMut<'_, T, RView, CView, Dyn, Dyn>
where RView: Dim, CView: Dim,

Creates a matrix view that may or may not have a fixed size and stride.

Source

pub fn rows_range_pair_mut<Range1: DimRange<R>, Range2: DimRange<R>>( &mut self, r1: Range1, r2: Range2, ) -> (MatrixViewMut<'_, T, Range1::Size, C, S::RStride, S::CStride>, MatrixViewMut<'_, T, Range2::Size, C, S::RStride, S::CStride>)

Splits this NxM matrix into two parts delimited by two ranges.

Panics if the ranges overlap or if the first range is empty.

Source

pub fn columns_range_pair_mut<Range1: DimRange<C>, Range2: DimRange<C>>( &mut self, r1: Range1, r2: Range2, ) -> (MatrixViewMut<'_, T, R, Range1::Size, S::RStride, S::CStride>, MatrixViewMut<'_, T, R, Range2::Size, S::RStride, S::CStride>)

Splits this NxM matrix into two parts delimited by two ranges.

Panics if the ranges overlap or if the first range is empty.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn slice_range<RowRange, ColRange>( &self, rows: RowRange, cols: ColRange, ) -> MatrixView<'_, T, RowRange::Size, ColRange::Size, S::RStride, S::CStride>
where RowRange: DimRange<R>, ColRange: DimRange<C>,

๐Ÿ‘ŽDeprecated: Use view_range instead. See issue #1076 for more information.

Slices a sub-matrix containing the rows indexed by the range rows and the columns indexed by the range cols.

Source

pub fn view_range<RowRange, ColRange>( &self, rows: RowRange, cols: ColRange, ) -> MatrixView<'_, T, RowRange::Size, ColRange::Size, S::RStride, S::CStride>
where RowRange: DimRange<R>, ColRange: DimRange<C>,

Returns a view containing the rows indexed by the range rows and the columns indexed by the range cols.

Source

pub fn rows_range<RowRange: DimRange<R>>( &self, rows: RowRange, ) -> MatrixView<'_, T, RowRange::Size, C, S::RStride, S::CStride>

View containing all the rows indexed by the range rows.

Source

pub fn columns_range<ColRange: DimRange<C>>( &self, cols: ColRange, ) -> MatrixView<'_, T, R, ColRange::Size, S::RStride, S::CStride>

View containing all the columns indexed by the range rows.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> Matrix<T, R, C, S>

Source

pub fn slice_range_mut<RowRange, ColRange>( &mut self, rows: RowRange, cols: ColRange, ) -> MatrixViewMut<'_, T, RowRange::Size, ColRange::Size, S::RStride, S::CStride>
where RowRange: DimRange<R>, ColRange: DimRange<C>,

๐Ÿ‘ŽDeprecated: Use view_range_mut instead. See issue #1076 for more information.

Slices a mutable sub-matrix containing the rows indexed by the range rows and the columns indexed by the range cols.

Source

pub fn view_range_mut<RowRange, ColRange>( &mut self, rows: RowRange, cols: ColRange, ) -> MatrixViewMut<'_, T, RowRange::Size, ColRange::Size, S::RStride, S::CStride>
where RowRange: DimRange<R>, ColRange: DimRange<C>,

Return a mutable view containing the rows indexed by the range rows and the columns indexed by the range cols.

Source

pub fn rows_range_mut<RowRange: DimRange<R>>( &mut self, rows: RowRange, ) -> MatrixViewMut<'_, T, RowRange::Size, C, S::RStride, S::CStride>

Mutable view containing all the rows indexed by the range rows.

Source

pub fn columns_range_mut<ColRange: DimRange<C>>( &mut self, cols: ColRange, ) -> MatrixViewMut<'_, T, R, ColRange::Size, S::RStride, S::CStride>

Mutable view containing all the columns indexed by the range cols.

Sourceยง

impl<T, R, C, S> Matrix<T, R, C, S>
where R: Dim, C: Dim, S: RawStorage<T, R, C>,

Source

pub fn as_view<RView, CView, RViewStride, CViewStride>( &self, ) -> MatrixView<'_, T, RView, CView, RViewStride, CViewStride>
where RView: Dim, CView: Dim, RViewStride: Dim, CViewStride: Dim, ShapeConstraint: DimEq<R, RView> + DimEq<C, CView> + DimEq<RViewStride, S::RStride> + DimEq<CViewStride, S::CStride>,

Returns this matrix as a view.

The returned view type is generally ambiguous unless specified. This is particularly useful when working with functions or methods that take matrix views as input.

ยงPanics

Panics if the dimensions of the view and the matrix are not compatible and this cannot be proven at compile-time. This might happen, for example, when constructing a static view of size 3x3 from a dynamically sized matrix of dimension 5x5.

ยงExamples
use nalgebra::{DMatrixSlice, SMatrixView};

fn consume_view(_: DMatrixSlice<f64>) {}

let matrix = nalgebra::Matrix3::zeros();
consume_view(matrix.as_view());

let dynamic_view: DMatrixSlice<f64> = matrix.as_view();
let static_view_from_dyn: SMatrixView<f64, 3, 3> = dynamic_view.as_view();
Sourceยง

impl<T, R, C, S> Matrix<T, R, C, S>
where R: Dim, C: Dim, S: RawStorageMut<T, R, C>,

Source

pub fn as_view_mut<RView, CView, RViewStride, CViewStride>( &mut self, ) -> MatrixViewMut<'_, T, RView, CView, RViewStride, CViewStride>
where RView: Dim, CView: Dim, RViewStride: Dim, CViewStride: Dim, ShapeConstraint: DimEq<R, RView> + DimEq<C, CView> + DimEq<RViewStride, S::RStride> + DimEq<CViewStride, S::CStride>,

Returns this matrix as a mutable view.

The returned view type is generally ambiguous unless specified. This is particularly useful when working with functions or methods that take matrix views as input.

ยงPanics

Panics if the dimensions of the view and the matrix are not compatible and this cannot be proven at compile-time. This might happen, for example, when constructing a static view of size 3x3 from a dynamically sized matrix of dimension 5x5.

ยงExamples
use nalgebra::{DMatrixViewMut, SMatrixViewMut};

fn consume_view(_: DMatrixViewMut<f64>) {}

let mut matrix = nalgebra::Matrix3::zeros();
consume_view(matrix.as_view_mut());

let mut dynamic_view: DMatrixViewMut<f64> = matrix.as_view_mut();
let static_view_from_dyn: SMatrixViewMut<f64, 3, 3> = dynamic_view.as_view_mut();
Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

ยงMagnitude and norms

Source

pub fn norm_squared(&self) -> T::SimdRealField

The squared L2 norm of this vector.

Source

pub fn norm(&self) -> T::SimdRealField

The L2 norm of this matrix.

Use .apply_norm to apply a custom norm.

Source

pub fn metric_distance<R2, C2, S2>( &self, rhs: &Matrix<T, R2, C2, S2>, ) -> T::SimdRealField
where T: SimdComplexField, R2: Dim, C2: Dim, S2: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Compute the distance between self and rhs using the metric induced by the euclidean norm.

Use .apply_metric_distance to apply a custom norm.

Source

pub fn apply_norm(&self, norm: &impl Norm<T>) -> T::SimdRealField

Uses the given norm to compute the norm of self.

ยงExample

let v = Vector3::new(1.0, 2.0, 3.0);
assert_eq!(v.apply_norm(&UniformNorm), 3.0);
assert_eq!(v.apply_norm(&LpNorm(1)), 6.0);
assert_eq!(v.apply_norm(&EuclideanNorm), v.norm());
Source

pub fn apply_metric_distance<R2, C2, S2>( &self, rhs: &Matrix<T, R2, C2, S2>, norm: &impl Norm<T>, ) -> T::SimdRealField
where T: SimdComplexField, R2: Dim, C2: Dim, S2: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,

Uses the metric induced by the given norm to compute the metric distance between self and rhs.

ยงExample

let v1 = Vector3::new(1.0, 2.0, 3.0);
let v2 = Vector3::new(10.0, 20.0, 30.0);

assert_eq!(v1.apply_metric_distance(&v2, &UniformNorm), 27.0);
assert_eq!(v1.apply_metric_distance(&v2, &LpNorm(1)), 27.0 + 18.0 + 9.0);
assert_eq!(v1.apply_metric_distance(&v2, &EuclideanNorm), (v1 - v2).norm());
Source

pub fn magnitude(&self) -> T::SimdRealField

A synonym for the norm of this matrix.

Aka the length.

This function is simply implemented as a call to norm()

Source

pub fn magnitude_squared(&self) -> T::SimdRealField

A synonym for the squared norm of this matrix.

Aka the squared length.

This function is simply implemented as a call to norm_squared()

Source

pub fn set_magnitude(&mut self, magnitude: T::SimdRealField)
where T: SimdComplexField, S: StorageMut<T, R, C>,

Sets the magnitude of this vector.

Source

pub fn normalize(&self) -> OMatrix<T, R, C>

Returns a normalized version of this matrix.

Source

pub fn lp_norm(&self, p: i32) -> T::SimdRealField

The Lp norm of this matrix.

Source

pub fn simd_try_normalize( &self, min_norm: T::SimdRealField, ) -> SimdOption<OMatrix<T, R, C>>

Attempts to normalize self.

The components of this matrix can be SIMD types.

Source

pub fn try_set_magnitude( &mut self, magnitude: T::RealField, min_magnitude: T::RealField, )
where T: ComplexField, S: StorageMut<T, R, C>,

Sets the magnitude of this vector unless it is smaller than min_magnitude.

If self.magnitude() is smaller than min_magnitude, it will be left unchanged. Otherwise this is equivalent to: *self = self.normalize() * magnitude.

Source

pub fn cap_magnitude(&self, max: T::RealField) -> OMatrix<T, R, C>

Returns a new vector with the same magnitude as self clamped between 0.0 and max.

Source

pub fn simd_cap_magnitude(&self, max: T::SimdRealField) -> OMatrix<T, R, C>

Returns a new vector with the same magnitude as self clamped between 0.0 and max.

Source

pub fn try_normalize(&self, min_norm: T::RealField) -> Option<OMatrix<T, R, C>>

Returns a normalized version of this matrix unless its norm as smaller or equal to eps.

The components of this matrix cannot be SIMD types (see simd_try_normalize) instead.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: StorageMut<T, R, C>> Matrix<T, R, C, S>

ยงIn-place normalization

Source

pub fn normalize_mut(&mut self) -> T::SimdRealField

Normalizes this matrix in-place and returns its norm.

The components of the matrix cannot be SIMD types (see simd_try_normalize_mut instead).

Source

pub fn simd_try_normalize_mut( &mut self, min_norm: T::SimdRealField, ) -> SimdOption<T::SimdRealField>

Normalizes this matrix in-place and return its norm.

The components of the matrix can be SIMD types.

Source

pub fn try_normalize_mut( &mut self, min_norm: T::RealField, ) -> Option<T::RealField>
where T: ComplexField,

Normalizes this matrix in-place or does nothing if its norm is smaller or equal to eps.

If the normalization succeeded, returns the old norm of this matrix.

Sourceยง

impl<T: ComplexField, D: DimName> Matrix<T, D, Const<1>, <DefaultAllocator as Allocator<D>>::Buffer<T>>

ยงBasis and orthogonalization

Source

pub fn orthonormalize(vs: &mut [Self]) -> usize

Orthonormalizes the given family of vectors. The largest free family of vectors is moved at the beginning of the array and its size is returned. Vectors at an indices larger or equal to this length can be modified to an arbitrary value.

Source

pub fn orthonormal_subspace_basis<F>(vs: &[Self], f: F)
where F: FnMut(&Self) -> bool,

Applies the given closure to each element of the orthonormal basis of the subspace orthogonal to free family of vectors vs. If vs is not a free family, the result is unspecified.

Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn len(&self) -> usize

The total number of elements of this matrix.

ยงExamples:
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.len(), 12);
Source

pub fn is_empty(&self) -> bool

Returns true if the matrix contains no elements.

ยงExamples:
let mat = Matrix3x4::<f32>::zeros();
assert!(!mat.is_empty());
Source

pub fn is_square(&self) -> bool

Indicates if this is a square matrix.

Source

pub fn is_identity(&self, eps: T::Epsilon) -> bool
where T: Zero + One + RelativeEq, T::Epsilon: Clone,

Indicated if this is the identity matrix within a relative error of eps.

If the matrix is diagonal, this checks that diagonal elements (i.e. at coordinates (i, i) for i from 0 to min(R, C)) are equal one; and that all other elements are zero.

Sourceยง

impl<T: ComplexField, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn is_orthogonal(&self, eps: T::Epsilon) -> bool

Checks that Mแต€ ร— M = Id.

In this definition Id is approximately equal to the identity matrix with a relative error equal to eps.

Sourceยง

impl<T: RealField, D: Dim, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn is_special_orthogonal(&self, eps: T) -> bool
where D: DimMin<D, Output = D>, DefaultAllocator: Allocator<D>,

Checks that this matrix is orthogonal and has a determinant equal to 1.

Source

pub fn is_invertible(&self) -> bool

Returns true if this matrix is invertible.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงFolding on columns and rows

Source

pub fn compress_rows( &self, f: impl Fn(VectorView<'_, T, R, S::RStride, S::CStride>) -> T, ) -> RowOVector<T, C>

Returns a row vector where each element is the result of the application of f on the corresponding column of the original matrix.

Source

pub fn compress_rows_tr( &self, f: impl Fn(VectorView<'_, T, R, S::RStride, S::CStride>) -> T, ) -> OVector<T, C>

Returns a column vector where each element is the result of the application of f on the corresponding column of the original matrix.

This is the same as self.compress_rows(f).transpose().

Source

pub fn compress_columns( &self, init: OVector<T, R>, f: impl Fn(&mut OVector<T, R>, VectorView<'_, T, R, S::RStride, S::CStride>), ) -> OVector<T, R>

Returns a column vector resulting from the folding of f on each column of this matrix.

Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงCommon statistics operations

Source

pub fn sum(&self) -> T
where T: ClosedAddAssign + Zero,

The sum of all the elements of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.sum(), 21.0);
Source

pub fn row_sum(&self) -> RowOVector<T, C>

The sum of all the rows of this matrix.

Use .row_sum_tr if you need the result in a column vector instead.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_sum(), RowVector3::new(5.0, 7.0, 9.0));

let mint = Matrix3x2::new(1, 2,
                          3, 4,
                          5, 6);
assert_eq!(mint.row_sum(), RowVector2::new(9,12));
Source

pub fn row_sum_tr(&self) -> OVector<T, C>

The sum of all the rows of this matrix. The result is transposed and returned as a column vector.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_sum_tr(), Vector3::new(5.0, 7.0, 9.0));

let mint = Matrix3x2::new(1, 2,
                          3, 4,
                          5, 6);
assert_eq!(mint.row_sum_tr(), Vector2::new(9, 12));
Source

pub fn column_sum(&self) -> OVector<T, R>

The sum of all the columns of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.column_sum(), Vector2::new(6.0, 15.0));

let mint = Matrix3x2::new(1, 2,
                          3, 4,
                          5, 6);
assert_eq!(mint.column_sum(), Vector3::new(3, 7, 11));
Source

pub fn product(&self) -> T
where T: ClosedMulAssign + One,

The product of all the elements of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.product(), 720.0);
Source

pub fn row_product(&self) -> RowOVector<T, C>

The product of all the rows of this matrix.

Use .row_sum_tr if you need the result in a column vector instead.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_product(), RowVector3::new(4.0, 10.0, 18.0));

let mint = Matrix3x2::new(1, 2,
                          3, 4,
                          5, 6);
assert_eq!(mint.row_product(), RowVector2::new(15, 48));
Source

pub fn row_product_tr(&self) -> OVector<T, C>

The product of all the rows of this matrix. The result is transposed and returned as a column vector.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_product_tr(), Vector3::new(4.0, 10.0, 18.0));

let mint = Matrix3x2::new(1, 2,
                          3, 4,
                          5, 6);
assert_eq!(mint.row_product_tr(), Vector2::new(15, 48));
Source

pub fn column_product(&self) -> OVector<T, R>

The product of all the columns of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.column_product(), Vector2::new(6.0, 120.0));

let mint = Matrix3x2::new(1, 2,
                          3, 4,
                          5, 6);
assert_eq!(mint.column_product(), Vector3::new(2, 12, 30));
Source

pub fn variance(&self) -> T
where T: Field + SupersetOf<f64>,

The variance of all the elements of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_relative_eq!(m.variance(), 35.0 / 12.0, epsilon = 1.0e-8);
Source

pub fn row_variance(&self) -> RowOVector<T, C>

The variance of all the rows of this matrix.

Use .row_variance_tr if you need the result in a column vector instead.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_variance(), RowVector3::new(2.25, 2.25, 2.25));
Source

pub fn row_variance_tr(&self) -> OVector<T, C>

The variance of all the rows of this matrix. The result is transposed and returned as a column vector.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_variance_tr(), Vector3::new(2.25, 2.25, 2.25));
Source

pub fn column_variance(&self) -> OVector<T, R>

The variance of all the columns of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_relative_eq!(m.column_variance(), Vector2::new(2.0 / 3.0, 2.0 / 3.0), epsilon = 1.0e-8);
Source

pub fn mean(&self) -> T
where T: Field + SupersetOf<f64>,

The mean of all the elements of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.mean(), 3.5);
Source

pub fn row_mean(&self) -> RowOVector<T, C>

The mean of all the rows of this matrix.

Use .row_mean_tr if you need the result in a column vector instead.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_mean(), RowVector3::new(2.5, 3.5, 4.5));
Source

pub fn row_mean_tr(&self) -> OVector<T, C>

The mean of all the rows of this matrix. The result is transposed and returned as a column vector.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.row_mean_tr(), Vector3::new(2.5, 3.5, 4.5));
Source

pub fn column_mean(&self) -> OVector<T, R>

The mean of all the columns of this matrix.

ยงExample

let m = Matrix2x3::new(1.0, 2.0, 3.0,
                       4.0, 5.0, 6.0);
assert_eq!(m.column_mean(), Vector2::new(2.0, 5.0));
Sourceยง

impl<T: Scalar, D, S: RawStorage<T, D>> Matrix<T, D, Const<1>, S>
where D: DimName + ToTypenum,

ยงSwizzling

Source

pub fn xx(&self) -> Vector2<T>
where D::Typenum: Cmp<U0, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xxx(&self) -> Vector3<T>
where D::Typenum: Cmp<U0, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xy(&self) -> Vector2<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yx(&self) -> Vector2<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yy(&self) -> Vector2<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xxy(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xyx(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xyy(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yxx(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yxy(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yyx(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yyy(&self) -> Vector3<T>
where D::Typenum: Cmp<U1, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xz(&self) -> Vector2<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yz(&self) -> Vector2<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zx(&self) -> Vector2<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zy(&self) -> Vector2<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zz(&self) -> Vector2<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xxz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xyz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xzx(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xzy(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn xzz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yxz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yyz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yzx(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yzy(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn yzz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zxx(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zxy(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zxz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zyx(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zyy(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zyz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zzx(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zzy(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Source

pub fn zzz(&self) -> Vector3<T>
where D::Typenum: Cmp<U2, Output = Greater>,

Builds a new vector from components of self.

Sourceยง

impl<T: Scalar + Zero + One + ClosedAddAssign + ClosedSubAssign + ClosedMulAssign, D: Dim, S: Storage<T, D>> Matrix<T, D, Const<1>, S>

ยงInterpolation

Source

pub fn lerp<S2: Storage<T, D>>( &self, rhs: &Vector<T, D, S2>, t: T, ) -> OVector<T, D>

Returns self * (1.0 - t) + rhs * t, i.e., the linear blend of the vectors x and y using the scalar value a.

The value for a is not restricted to the range [0, 1].

ยงExamples:
let x = Vector3::new(1.0, 2.0, 3.0);
let y = Vector3::new(10.0, 20.0, 30.0);
assert_eq!(x.lerp(&y, 0.1), Vector3::new(1.9, 3.8, 5.7));
Source

pub fn slerp<S2: Storage<T, D>>( &self, rhs: &Vector<T, D, S2>, t: T, ) -> OVector<T, D>

Computes the spherical linear interpolation between two non-zero vectors.

The result is a unit vector.

ยงExamples:

let v1 =Vector2::new(1.0, 2.0);
let v2 = Vector2::new(2.0, -3.0);

let v = v1.slerp(&v2, 1.0);

assert_eq!(v, v2.normalize());
Sourceยง

impl<T: Scalar, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

ยงFind the min and max components

Source

pub fn amax(&self) -> T

Returns the absolute value of the component with the largest absolute value.

ยงExample
assert_eq!(Vector3::new(-1.0, 2.0, 3.0).amax(), 3.0);
assert_eq!(Vector3::new(-1.0, -2.0, -3.0).amax(), 3.0);
Source

pub fn camax(&self) -> T::SimdRealField

Returns the the 1-norm of the complex component with the largest 1-norm.

ยงExample
assert_eq!(Vector3::new(
    Complex::new(-3.0, -2.0),
    Complex::new(1.0, 2.0),
    Complex::new(1.0, 3.0)).camax(), 5.0);
Source

pub fn max(&self) -> T
where T: SimdPartialOrd + Zero,

Returns the component with the largest value.

ยงExample
assert_eq!(Vector3::new(-1.0, 2.0, 3.0).max(), 3.0);
assert_eq!(Vector3::new(-1.0, -2.0, -3.0).max(), -1.0);
assert_eq!(Vector3::new(5u32, 2, 3).max(), 5);
Source

pub fn amin(&self) -> T

Returns the absolute value of the component with the smallest absolute value.

ยงExample
assert_eq!(Vector3::new(-1.0, 2.0, -3.0).amin(), 1.0);
assert_eq!(Vector3::new(10.0, 2.0, 30.0).amin(), 2.0);
Source

pub fn camin(&self) -> T::SimdRealField

Returns the the 1-norm of the complex component with the smallest 1-norm.

ยงExample
assert_eq!(Vector3::new(
    Complex::new(-3.0, -2.0),
    Complex::new(1.0, 2.0),
    Complex::new(1.0, 3.0)).camin(), 3.0);
Source

pub fn min(&self) -> T
where T: SimdPartialOrd + Zero,

Returns the component with the smallest value.

ยงExample
assert_eq!(Vector3::new(-1.0, 2.0, 3.0).min(), -1.0);
assert_eq!(Vector3::new(1.0, 2.0, 3.0).min(), 1.0);
assert_eq!(Vector3::new(5u32, 2, 3).min(), 2);
Source

pub fn icamax_full(&self) -> (usize, usize)
where T: ComplexField,

Computes the index of the matrix component with the largest absolute value.

ยงExamples:
let mat = Matrix2x3::new(Complex::new(11.0, 1.0), Complex::new(-12.0, 2.0), Complex::new(13.0, 3.0),
                         Complex::new(21.0, 43.0), Complex::new(22.0, 5.0), Complex::new(-23.0, 0.0));
assert_eq!(mat.icamax_full(), (1, 0));
Sourceยง

impl<T: Scalar + PartialOrd + Signed, R: Dim, C: Dim, S: RawStorage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn iamax_full(&self) -> (usize, usize)

Computes the index of the matrix component with the largest absolute value.

ยงExamples:
let mat = Matrix2x3::new(11, -12, 13,
                         21, 22, -23);
assert_eq!(mat.iamax_full(), (1, 2));
Sourceยง

impl<T: Scalar, D: Dim, S: RawStorage<T, D>> Matrix<T, D, Const<1>, S>

ยงFind the min and max components (vector-specific methods)

Source

pub fn icamax(&self) -> usize
where T: ComplexField,

Computes the index of the vector component with the largest complex or real absolute value.

ยงExamples:
let vec = Vector3::new(Complex::new(11.0, 3.0), Complex::new(-15.0, 0.0), Complex::new(13.0, 5.0));
assert_eq!(vec.icamax(), 2);
Source

pub fn argmax(&self) -> (usize, T)
where T: PartialOrd,

Computes the index and value of the vector component with the largest value.

ยงExamples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.argmax(), (2, 13));
Source

pub fn imax(&self) -> usize
where T: PartialOrd,

Computes the index of the vector component with the largest value.

ยงExamples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.imax(), 2);
Source

pub fn iamax(&self) -> usize
where T: PartialOrd + Signed,

Computes the index of the vector component with the largest absolute value.

ยงExamples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.iamax(), 1);
Source

pub fn argmin(&self) -> (usize, T)
where T: PartialOrd,

Computes the index and value of the vector component with the smallest value.

ยงExamples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.argmin(), (1, -15));
Source

pub fn imin(&self) -> usize
where T: PartialOrd,

Computes the index of the vector component with the smallest value.

ยงExamples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.imin(), 1);
Source

pub fn iamin(&self) -> usize
where T: PartialOrd + Signed,

Computes the index of the vector component with the smallest absolute value.

ยงExamples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.iamin(), 0);
Sourceยง

impl<T: RealField, D1: Dim, S1: Storage<T, D1>> Matrix<T, D1, Const<1>, S1>

Source

pub fn convolve_full<D2, S2>( &self, kernel: Vector<T, D2, S2>, ) -> OVector<T, DimDiff<DimSum<D1, D2>, U1>>
where D1: DimAdd<D2>, D2: DimAdd<D1, Output = DimSum<D1, D2>>, DimSum<D1, D2>: DimSub<U1>, S2: Storage<T, D2>, DefaultAllocator: Allocator<DimDiff<DimSum<D1, D2>, U1>>,

Returns the convolution of the target vector and a kernel.

ยงArguments
  • kernel - A Vector with size > 0
ยงErrors

Inputs must satisfy vector.len() >= kernel.len() > 0.

Source

pub fn convolve_valid<D2, S2>( &self, kernel: Vector<T, D2, S2>, ) -> OVector<T, DimDiff<DimSum<D1, U1>, D2>>
where D1: DimAdd<U1>, D2: Dim, DimSum<D1, U1>: DimSub<D2>, S2: Storage<T, D2>, DefaultAllocator: Allocator<DimDiff<DimSum<D1, U1>, D2>>,

Returns the convolution of the target vector and a kernel.

The output convolution consists only of those elements that do not rely on the zero-padding.

ยงArguments
  • kernel - A Vector with size > 0
ยงErrors

Inputs must satisfy self.len() >= kernel.len() > 0.

Source

pub fn convolve_same<D2, S2>(&self, kernel: Vector<T, D2, S2>) -> OVector<T, D1>
where D2: Dim, S2: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Returns the convolution of the target vector and a kernel.

The output convolution is the same size as vector, centered with respect to the โ€˜fullโ€™ output.

ยงArguments
  • kernel - A Vector with size > 0
ยงErrors

Inputs must satisfy self.len() >= kernel.len() > 0.

Sourceยง

impl<T: ComplexField, D: DimMin<D, Output = D>, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn determinant(&self) -> T

Computes the matrix determinant.

If the matrix has a dimension larger than 3, an LU decomposition is used.

Sourceยง

impl<T: ComplexField, R: Dim, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

ยงRectangular matrix decomposition

This section contains the methods for computing some common decompositions of rectangular matrices with real or complex components. The following are currently supported:

DecompositionFactorsDetails
QRQ * RQ is an unitary matrix, and R is upper-triangular.
QR with column pivotingQ * R * PโปยนQ is an unitary matrix, and R is upper-triangular. P is a permutation matrix.
LU with partial pivotingPโปยน * L * UL is lower-triangular with a diagonal filled with 1 and U is upper-triangular. P is a permutation matrix.
LU with full pivotingPโปยน * L * U * QโปยนL is lower-triangular with a diagonal filled with 1 and U is upper-triangular. P and Q are permutation matrices.
SVDU * ฮฃ * Vแต€U and V are two orthogonal matrices and ฮฃ is a diagonal matrix containing the singular values.
Polar (Left Polar)P' * UU is semi-unitary/unitary and P' is a positive semi-definite Hermitian Matrix
Source

pub fn bidiagonalize(self) -> Bidiagonal<T, R, C>

Computes the bidiagonalization using householder reflections.

Source

pub fn full_piv_lu(self) -> FullPivLU<T, R, C>
where R: DimMin<C>, DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,

Computes the LU decomposition with full pivoting of matrix.

This effectively computes P, L, U, Q such that P * matrix * Q = LU.

Source

pub fn lu(self) -> LU<T, R, C>
where R: DimMin<C>, DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,

Computes the LU decomposition with partial (row) pivoting of matrix.

Source

pub fn qr(self) -> QR<T, R, C>
where R: DimMin<C>, DefaultAllocator: Allocator<R, C> + Allocator<R> + Allocator<DimMinimum<R, C>>,

Computes the QR decomposition of this matrix.

Source

pub fn col_piv_qr(self) -> ColPivQR<T, R, C>
where R: DimMin<C>, DefaultAllocator: Allocator<R, C> + Allocator<R> + Allocator<DimMinimum<R, C>>,

Computes the QR decomposition (with column pivoting) of this matrix.

Source

pub fn svd(self, compute_u: bool, compute_v: bool) -> SVD<T, R, C>

Computes the Singular Value Decomposition using implicit shift. The singular values are guaranteed to be sorted in descending order. If this order is not required consider using svd_unordered.

Source

pub fn svd_unordered(self, compute_u: bool, compute_v: bool) -> SVD<T, R, C>

Computes the Singular Value Decomposition using implicit shift. The singular values are not guaranteed to be sorted in any particular order. If a descending order is required, consider using svd instead.

Source

pub fn try_svd( self, compute_u: bool, compute_v: bool, eps: T::RealField, max_niter: usize, ) -> Option<SVD<T, R, C>>

Attempts to compute the Singular Value Decomposition of matrix using implicit shift. The singular values are guaranteed to be sorted in descending order. If this order is not required consider using try_svd_unordered.

ยงArguments
  • compute_u โˆ’ set this to true to enable the computation of left-singular vectors.
  • compute_v โˆ’ set this to true to enable the computation of right-singular vectors.
  • eps โˆ’ tolerance used to determine when a value converged to 0.
  • max_niter โˆ’ maximum total number of iterations performed by the algorithm. If this number of iteration is exceeded, None is returned. If niter == 0, then the algorithm continues indefinitely until convergence.
Source

pub fn try_svd_unordered( self, compute_u: bool, compute_v: bool, eps: T::RealField, max_niter: usize, ) -> Option<SVD<T, R, C>>

Attempts to compute the Singular Value Decomposition of matrix using implicit shift. The singular values are not guaranteed to be sorted in any particular order. If a descending order is required, consider using try_svd instead.

ยงArguments
  • compute_u โˆ’ set this to true to enable the computation of left-singular vectors.
  • compute_v โˆ’ set this to true to enable the computation of right-singular vectors.
  • eps โˆ’ tolerance used to determine when a value converged to 0.
  • max_niter โˆ’ maximum total number of iterations performed by the algorithm. If this number of iteration is exceeded, None is returned. If niter == 0, then the algorithm continues indefinitely until convergence.
Source

pub fn polar(self) -> (OMatrix<T, R, R>, OMatrix<T, R, C>)
where R: DimMin<C>, DimMinimum<R, C>: DimSub<U1>, DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>, R> + Allocator<DimMinimum<R, C>> + Allocator<R, R> + Allocator<DimMinimum<R, C>, DimMinimum<R, C>> + Allocator<C> + Allocator<R> + Allocator<DimDiff<DimMinimum<R, C>, U1>> + Allocator<DimMinimum<R, C>, C> + Allocator<R, DimMinimum<R, C>>,

Computes the Polar Decomposition of a matrix (indirectly uses SVD).

Source

pub fn try_polar( self, eps: T::RealField, max_niter: usize, ) -> Option<(OMatrix<T, R, R>, OMatrix<T, R, C>)>
where R: DimMin<C>, DimMinimum<R, C>: DimSub<U1>, DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>, R> + Allocator<DimMinimum<R, C>> + Allocator<R, R> + Allocator<DimMinimum<R, C>, DimMinimum<R, C>> + Allocator<C> + Allocator<R> + Allocator<DimDiff<DimMinimum<R, C>, U1>> + Allocator<DimMinimum<R, C>, C> + Allocator<R, DimMinimum<R, C>>,

Attempts to compute the Polar Decomposition of a matrix (indirectly uses SVD).

ยงArguments
  • eps โˆ’ tolerance used to determine when a value converged to 0 when computing the SVD.
  • max_niter โˆ’ maximum total number of iterations performed by the SVD computation algorithm.
Sourceยง

impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> Matrix<T, D, D, S>

ยงSquare matrix decomposition

This section contains the methods for computing some common decompositions of square matrices with real or complex components. The following are currently supported:

DecompositionFactorsDetails
HessenbergQ * H * Qแต€Q is a unitary matrix and H an upper-Hessenberg matrix.
CholeskyL * Lแต€L is a lower-triangular matrix.
UDUU * D * Uแต€U is a upper-triangular matrix, and D a diagonal matrix.
Schur decompositionQ * T * Qแต€Q is an unitary matrix and T a quasi-upper-triangular matrix.
Symmetric eigendecompositionQ ~ ฮ› ~ Qแต€Q is an unitary matrix, and ฮ› is a real diagonal matrix.
Symmetric tridiagonalizationQ ~ T ~ Qแต€Q is an unitary matrix, and T is a tridiagonal matrix.
Source

pub fn cholesky(self) -> Option<Cholesky<T, D>>

Attempts to compute the Cholesky decomposition of this matrix.

Returns None if the input matrix is not definite-positive. The input matrix is assumed to be symmetric and only the lower-triangular part is read.

Source

pub fn udu(self) -> Option<UDU<T, D>>

Attempts to compute the UDU decomposition of this matrix.

The input matrix self is assumed to be symmetric and this decomposition will only read the upper-triangular part of self.

Source

pub fn hessenberg(self) -> Hessenberg<T, D>

Computes the Hessenberg decomposition of this matrix using householder reflections.

Source

pub fn schur(self) -> Schur<T, D>

Computes the Schur decomposition of a square matrix.

Source

pub fn try_schur( self, eps: T::RealField, max_niter: usize, ) -> Option<Schur<T, D>>

Attempts to compute the Schur decomposition of a square matrix.

If only eigenvalues are needed, it is more efficient to call the matrix method .eigenvalues() instead.

ยงArguments
  • eps โˆ’ tolerance used to determine when a value converged to 0.
  • max_niter โˆ’ maximum total number of iterations performed by the algorithm. If this number of iteration is exceeded, None is returned. If niter == 0, then the algorithm continues indefinitely until convergence.
Source

pub fn symmetric_eigen(self) -> SymmetricEigen<T, D>

Computes the eigendecomposition of this symmetric matrix.

Only the lower-triangular part (including the diagonal) of m is read.

Source

pub fn try_symmetric_eigen( self, eps: T::RealField, max_niter: usize, ) -> Option<SymmetricEigen<T, D>>

Computes the eigendecomposition of the given symmetric matrix with user-specified convergence parameters.

Only the lower-triangular part (including the diagonal) of m is read.

ยงArguments
  • eps โˆ’ tolerance used to determine when a value converged to 0.
  • max_niter โˆ’ maximum total number of iterations performed by the algorithm. If this number of iteration is exceeded, None is returned. If niter == 0, then the algorithm continues indefinitely until convergence.
Source

pub fn symmetric_tridiagonalize(self) -> SymmetricTridiagonal<T, D>

Computes the tridiagonalization of this symmetric matrix.

Only the lower-triangular part (including the diagonal) of m is read.

Sourceยง

impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn try_inverse(self) -> Option<OMatrix<T, D, D>>

Attempts to invert this square matrix.

ยงPanics

Panics if self isnโ€™t a square matrix.

Sourceยง

impl<T: ComplexField, D: Dim, S: StorageMut<T, D, D>> Matrix<T, D, D, S>

Source

pub fn try_inverse_mut(&mut self) -> bool

Attempts to invert this square matrix in-place.

Returns true if the inversion succeeded, false otherwise.

ยงBehavior
  • For small dimensions (n < 5), the matrix is left unchanged if the inversion fails.
  • For dimensions n >= 5, the matrix may be partially modified even if the inversion fails, because LU decomposition is used and it modifies the matrix in-place.

If you need to preserve the original matrix regardless of success or failure, consider using Self::try_inverse instead.

ยงPanics

Panics if self isnโ€™t a square matrix.

Sourceยง

impl<T, D, S> Matrix<T, D, D, S>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, D: DimMin<D, Output = D>, S: StorageMut<T, D, D>, DefaultAllocator: Allocator<D, D> + Allocator<D>,

Source

pub fn pow_mut(&mut self, exp: u32)

Raises this matrix to an integral power exp in-place.

Sourceยง

impl<T, D, S> Matrix<T, D, D, S>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, D: DimMin<D, Output = D>, S: StorageMut<T, D, D> + Storage<T, D, D>, DefaultAllocator: Allocator<D, D> + Allocator<D>,

Source

pub fn pow(&self, exp: u32) -> OMatrix<T, D, D>

Raise this matrix to an integral power exp.

Sourceยง

impl<T: ComplexField, D, S: Storage<T, D, D>> Matrix<T, D, D, S>
where D: DimSub<U1> + Dim, DefaultAllocator: Allocator<D, DimDiff<D, U1>> + Allocator<DimDiff<D, U1>> + Allocator<D, D> + Allocator<D>,

Source

pub fn eigenvalues(&self) -> Option<OVector<T, D>>

Computes the eigenvalues of this matrix.

Source

pub fn complex_eigenvalues(&self) -> OVector<NumComplex<T>, D>

Computes the eigenvalues of this matrix.

Sourceยง

impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn solve_lower_triangular<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> Option<OMatrix<T, R2, C2>>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn solve_upper_triangular<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> Option<OMatrix<T, R2, C2>>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn solve_lower_triangular_with_diag_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, diag: T, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self . x = b where x is the unknown and only the lower-triangular part of self is considered not-zero. The diagonal is never read as it is assumed to be equal to diag. Returns false and does not modify its inputs if diag is zero.

Source

pub fn solve_upper_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_lower_triangular<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> Option<OMatrix<T, R2, C2>>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.transpose() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_upper_triangular<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> Option<OMatrix<T, R2, C2>>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.transpose() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.transpose() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_upper_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.transpose() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_lower_triangular<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> Option<OMatrix<T, R2, C2>>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.adjoint() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_upper_triangular<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> Option<OMatrix<T, R2, C2>>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.adjoint() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.adjoint() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_upper_triangular_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, ) -> bool
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.adjoint() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Sourceยง

impl<T: SimdComplexField, D: Dim, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn solve_lower_triangular_unchecked<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> OMatrix<T, R2, C2>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn solve_upper_triangular_unchecked<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> OMatrix<T, R2, C2>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn solve_lower_triangular_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn solve_lower_triangular_with_diag_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, diag: T, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self . x = b where x is the unknown and only the lower-triangular part of self is considered not-zero. The diagonal is never read as it is assumed to be equal to diag. Returns false and does not modify its inputs if diag is zero.

Source

pub fn solve_upper_triangular_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_lower_triangular_unchecked<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> OMatrix<T, R2, C2>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.transpose() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_upper_triangular_unchecked<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> OMatrix<T, R2, C2>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.transpose() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_lower_triangular_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.transpose() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn tr_solve_upper_triangular_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.transpose() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_lower_triangular_unchecked<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> OMatrix<T, R2, C2>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.adjoint() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_upper_triangular_unchecked<R2: Dim, C2: Dim, S2>( &self, b: &Matrix<T, R2, C2, S2>, ) -> OMatrix<T, R2, C2>
where S2: Storage<T, R2, C2>, DefaultAllocator: Allocator<R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Computes the solution of the linear system self.adjoint() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_lower_triangular_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.adjoint() . x = b where x is the unknown and only the lower-triangular part of self (including the diagonal) is considered not-zero.

Source

pub fn ad_solve_upper_triangular_unchecked_mut<R2: Dim, C2: Dim, S2>( &self, b: &mut Matrix<T, R2, C2, S2>, )
where S2: StorageMut<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R2, D>,

Solves the linear system self.adjoint() . x = b where x is the unknown and only the upper-triangular part of self (including the diagonal) is considered not-zero.

Sourceยง

impl<T: ComplexField, R: DimMin<C>, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn singular_values_unordered( &self, ) -> OVector<T::RealField, DimMinimum<R, C>>

Computes the singular values of this matrix. The singular values are not guaranteed to be sorted in any particular order. If a descending order is required, consider using singular_values instead.

Source

pub fn rank(&self, eps: T::RealField) -> usize

Computes the rank of this matrix.

All singular values below eps are considered equal to 0.

Source

pub fn pseudo_inverse( self, eps: T::RealField, ) -> Result<OMatrix<T, C, R>, &'static str>

Computes the pseudo-inverse of this matrix.

All singular values below eps are considered equal to 0.

Sourceยง

impl<T: ComplexField, R: DimMin<C>, C: Dim, S: Storage<T, R, C>> Matrix<T, R, C, S>

Source

pub fn singular_values(&self) -> OVector<T::RealField, DimMinimum<R, C>>

Computes the singular values of this matrix. The singular values are guaranteed to be sorted in descending order. If this order is not required consider using singular_values_unordered.

Sourceยง

impl<T: ComplexField, D: DimSub<U1>, S: Storage<T, D, D>> Matrix<T, D, D, S>

Source

pub fn symmetric_eigenvalues(&self) -> OVector<T::RealField, D>

Computes the eigenvalues of this symmetric matrix.

Only the lower-triangular part of the matrix is read.

Trait Implementationsยง

Sourceยง

impl<T, R: Dim, C: Dim, S> AbsDiffEq for Matrix<T, R, C, S>
where T: Scalar + AbsDiffEq, S: RawStorage<T, R, C>, T::Epsilon: Clone,

Sourceยง

type Epsilon = <T as AbsDiffEq>::Epsilon

Used for specifying relative comparisons.
Sourceยง

fn default_epsilon() -> Self::Epsilon

The default tolerance to use when testing values that are close together. Read more
Sourceยง

fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool

A test for equality that uses the absolute difference to compute the approximate equality of two numbers.
Sourceยง

fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool

The inverse of AbsDiffEq::abs_diff_eq.
Sourceยง

impl<'a, 'b, T, D1, D2, SB> Add<&'b Matrix<T, D2, Const<1>, SB>> for &'a OPoint<T, D1>
where T: Scalar + ClosedAddAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the + operator.
Sourceยง

fn add(self, right: &'b Vector<T, D2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<'b, T, D1, D2, SB> Add<&'b Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>
where T: Scalar + ClosedAddAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the + operator.
Sourceยง

fn add(self, right: &'b Vector<T, D2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<'a, 'b, T, R1, C1, R2, C2, SA, SB> Add<&'b Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedAddAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer<T>>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<'b, T, R1, C1, R2, C2, SA, SB> Add<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedAddAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer<T>>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<'a, T, D1, D2, SB> Add<Matrix<T, D2, Const<1>, SB>> for &'a OPoint<T, D1>
where T: Scalar + ClosedAddAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the + operator.
Sourceยง

fn add(self, right: Vector<T, D2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<T, D1, D2, SB> Add<Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>
where T: Scalar + ClosedAddAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the + operator.
Sourceยง

fn add(self, right: Vector<T, D2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<'a, T, R1, C1, R2, C2, SA, SB> Add<Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedAddAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R2, C2, R1, C1>, ShapeConstraint: SameNumberOfRows<R2, R1> + SameNumberOfColumns<C2, C1>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative>>::Buffer<T>>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<T, R1, C1, R2, C2, SA, SB> Add<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedAddAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer<T>>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<'b, T, D1: DimName, D2: Dim, SB> AddAssign<&'b Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>

Sourceยง

fn add_assign(&mut self, right: &'b Vector<T, D2, SB>)

Performs the += operation. Read more
Sourceยง

impl<'b, T, R1, C1, R2, C2, SA, SB> AddAssign<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedAddAssign, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

fn add_assign(&mut self, rhs: &'b Matrix<T, R2, C2, SB>)

Performs the += operation. Read more
Sourceยง

impl<T, D1: DimName, D2: Dim, SB> AddAssign<Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>

Sourceยง

fn add_assign(&mut self, right: Vector<T, D2, SB>)

Performs the += operation. Read more
Sourceยง

impl<T, R1, C1, R2, C2, SA, SB> AddAssign<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedAddAssign, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

fn add_assign(&mut self, rhs: Matrix<T, R2, C2, SB>)

Performs the += operation. Read more
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 2]; 2]> for Matrix<T, U2, U2, S>
where S: RawStorageMut<T, U2, U2> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 2]; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 2]; 3]> for Matrix<T, U2, U3, S>
where S: RawStorageMut<T, U2, U3> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 2]; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 2]; 4]> for Matrix<T, U2, U4, S>
where S: RawStorageMut<T, U2, U4> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 2]; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 2]; 5]> for Matrix<T, U2, U5, S>
where S: RawStorageMut<T, U2, U5> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 2]; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 2]; 6]> for Matrix<T, U2, U6, S>
where S: RawStorageMut<T, U2, U6> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 2]; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 3]; 2]> for Matrix<T, U3, U2, S>
where S: RawStorageMut<T, U3, U2> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 3]; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 3]; 3]> for Matrix<T, U3, U3, S>
where S: RawStorageMut<T, U3, U3> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 3]; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 3]; 4]> for Matrix<T, U3, U4, S>
where S: RawStorageMut<T, U3, U4> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 3]; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 3]; 5]> for Matrix<T, U3, U5, S>
where S: RawStorageMut<T, U3, U5> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 3]; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 3]; 6]> for Matrix<T, U3, U6, S>
where S: RawStorageMut<T, U3, U6> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 3]; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 4]; 2]> for Matrix<T, U4, U2, S>
where S: RawStorageMut<T, U4, U2> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 4]; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 4]; 3]> for Matrix<T, U4, U3, S>
where S: RawStorageMut<T, U4, U3> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 4]; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 4]; 4]> for Matrix<T, U4, U4, S>
where S: RawStorageMut<T, U4, U4> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 4]; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 4]; 5]> for Matrix<T, U4, U5, S>
where S: RawStorageMut<T, U4, U5> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 4]; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 4]; 6]> for Matrix<T, U4, U6, S>
where S: RawStorageMut<T, U4, U6> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 4]; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 5]; 2]> for Matrix<T, U5, U2, S>
where S: RawStorageMut<T, U5, U2> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 5]; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 5]; 3]> for Matrix<T, U5, U3, S>
where S: RawStorageMut<T, U5, U3> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 5]; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 5]; 4]> for Matrix<T, U5, U4, S>
where S: RawStorageMut<T, U5, U4> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 5]; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 5]; 5]> for Matrix<T, U5, U5, S>
where S: RawStorageMut<T, U5, U5> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 5]; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 5]; 6]> for Matrix<T, U5, U6, S>
where S: RawStorageMut<T, U5, U6> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 5]; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 6]; 2]> for Matrix<T, U6, U2, S>
where S: RawStorageMut<T, U6, U2> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 6]; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 6]; 3]> for Matrix<T, U6, U3, S>
where S: RawStorageMut<T, U6, U3> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 6]; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 6]; 4]> for Matrix<T, U6, U4, S>
where S: RawStorageMut<T, U6, U4> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 6]; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 6]; 5]> for Matrix<T, U6, U5, S>
where S: RawStorageMut<T, U6, U5> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 6]; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsMut<[[T; 6]; 6]> for Matrix<T, U6, U6, S>
where S: RawStorageMut<T, U6, U6> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [[T; 6]; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 1]> for Matrix<T, U1, U1, S>
where T: Scalar, S: RawStorageMut<T, U1, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 1]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 10]> for Matrix<T, U1, U10, S>
where T: Scalar, S: RawStorageMut<T, U1, U10> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 10]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 10]> for Matrix<T, U10, U1, S>
where T: Scalar, S: RawStorageMut<T, U10, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 10]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 11]> for Matrix<T, U1, U11, S>
where T: Scalar, S: RawStorageMut<T, U1, U11> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 11]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 11]> for Matrix<T, U11, U1, S>
where T: Scalar, S: RawStorageMut<T, U11, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 11]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 12]> for Matrix<T, U1, U12, S>
where T: Scalar, S: RawStorageMut<T, U1, U12> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 12]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 12]> for Matrix<T, U12, U1, S>
where T: Scalar, S: RawStorageMut<T, U12, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 12]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 13]> for Matrix<T, U1, U13, S>
where T: Scalar, S: RawStorageMut<T, U1, U13> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 13]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 13]> for Matrix<T, U13, U1, S>
where T: Scalar, S: RawStorageMut<T, U13, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 13]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 14]> for Matrix<T, U1, U14, S>
where T: Scalar, S: RawStorageMut<T, U1, U14> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 14]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 14]> for Matrix<T, U14, U1, S>
where T: Scalar, S: RawStorageMut<T, U14, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 14]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 15]> for Matrix<T, U1, U15, S>
where T: Scalar, S: RawStorageMut<T, U1, U15> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 15]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 15]> for Matrix<T, U15, U1, S>
where T: Scalar, S: RawStorageMut<T, U15, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 15]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 16]> for Matrix<T, U1, U16, S>
where T: Scalar, S: RawStorageMut<T, U1, U16> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 16]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 16]> for Matrix<T, U16, U1, S>
where T: Scalar, S: RawStorageMut<T, U16, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 16]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 2]> for Matrix<T, U1, U2, S>
where T: Scalar, S: RawStorageMut<T, U1, U2> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 2]> for Matrix<T, U2, U1, S>
where T: Scalar, S: RawStorageMut<T, U2, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 3]> for Matrix<T, U1, U3, S>
where T: Scalar, S: RawStorageMut<T, U1, U3> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 3]> for Matrix<T, U3, U1, S>
where T: Scalar, S: RawStorageMut<T, U3, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 3]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 4]> for Matrix<T, U1, U4, S>
where T: Scalar, S: RawStorageMut<T, U1, U4> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 4]> for Matrix<T, U4, U1, S>
where T: Scalar, S: RawStorageMut<T, U4, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 5]> for Matrix<T, U1, U5, S>
where T: Scalar, S: RawStorageMut<T, U1, U5> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 5]> for Matrix<T, U5, U1, S>
where T: Scalar, S: RawStorageMut<T, U5, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 5]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 6]> for Matrix<T, U1, U6, S>
where T: Scalar, S: RawStorageMut<T, U1, U6> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 6]> for Matrix<T, U6, U1, S>
where T: Scalar, S: RawStorageMut<T, U6, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 6]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 7]> for Matrix<T, U1, U7, S>
where T: Scalar, S: RawStorageMut<T, U1, U7> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 7]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 7]> for Matrix<T, U7, U1, S>
where T: Scalar, S: RawStorageMut<T, U7, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 7]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 8]> for Matrix<T, U1, U8, S>
where T: Scalar, S: RawStorageMut<T, U1, U8> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 8]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 8]> for Matrix<T, U8, U1, S>
where T: Scalar, S: RawStorageMut<T, U8, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 8]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 9]> for Matrix<T, U1, U9, S>
where T: Scalar, S: RawStorageMut<T, U1, U9> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 9]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsMut<[T; 9]> for Matrix<T, U9, U1, S>
where T: Scalar, S: RawStorageMut<T, U9, U1> + IsContiguous,

Sourceยง

fn as_mut(&mut self) -> &mut [T; 9]

Converts this type into a mutable reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 2]; 2]> for Matrix<T, U2, U2, S>
where S: RawStorage<T, U2, U2> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 2]; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 2]; 3]> for Matrix<T, U2, U3, S>
where S: RawStorage<T, U2, U3> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 2]; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 2]; 4]> for Matrix<T, U2, U4, S>
where S: RawStorage<T, U2, U4> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 2]; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 2]; 5]> for Matrix<T, U2, U5, S>
where S: RawStorage<T, U2, U5> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 2]; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 2]; 6]> for Matrix<T, U2, U6, S>
where S: RawStorage<T, U2, U6> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 2]; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 3]; 2]> for Matrix<T, U3, U2, S>
where S: RawStorage<T, U3, U2> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 3]; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 3]; 3]> for Matrix<T, U3, U3, S>
where S: RawStorage<T, U3, U3> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 3]; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 3]; 4]> for Matrix<T, U3, U4, S>
where S: RawStorage<T, U3, U4> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 3]; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 3]; 5]> for Matrix<T, U3, U5, S>
where S: RawStorage<T, U3, U5> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 3]; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 3]; 6]> for Matrix<T, U3, U6, S>
where S: RawStorage<T, U3, U6> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 3]; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 4]; 2]> for Matrix<T, U4, U2, S>
where S: RawStorage<T, U4, U2> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 4]; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 4]; 3]> for Matrix<T, U4, U3, S>
where S: RawStorage<T, U4, U3> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 4]; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 4]; 4]> for Matrix<T, U4, U4, S>
where S: RawStorage<T, U4, U4> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 4]; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 4]; 5]> for Matrix<T, U4, U5, S>
where S: RawStorage<T, U4, U5> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 4]; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 4]; 6]> for Matrix<T, U4, U6, S>
where S: RawStorage<T, U4, U6> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 4]; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 5]; 2]> for Matrix<T, U5, U2, S>
where S: RawStorage<T, U5, U2> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 5]; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 5]; 3]> for Matrix<T, U5, U3, S>
where S: RawStorage<T, U5, U3> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 5]; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 5]; 4]> for Matrix<T, U5, U4, S>
where S: RawStorage<T, U5, U4> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 5]; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 5]; 5]> for Matrix<T, U5, U5, S>
where S: RawStorage<T, U5, U5> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 5]; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 5]; 6]> for Matrix<T, U5, U6, S>
where S: RawStorage<T, U5, U6> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 5]; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 6]; 2]> for Matrix<T, U6, U2, S>
where S: RawStorage<T, U6, U2> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 6]; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 6]; 3]> for Matrix<T, U6, U3, S>
where S: RawStorage<T, U6, U3> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 6]; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 6]; 4]> for Matrix<T, U6, U4, S>
where S: RawStorage<T, U6, U4> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 6]; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 6]; 5]> for Matrix<T, U6, U5, S>
where S: RawStorage<T, U6, U5> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 6]; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T: Scalar, S> AsRef<[[T; 6]; 6]> for Matrix<T, U6, U6, S>
where S: RawStorage<T, U6, U6> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[[T; 6]; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C> + IsContiguous> AsRef<[T]> for Matrix<T, R, C, S>

Sourceยง

fn as_ref(&self) -> &[T]

Extracts a slice containing the entire matrix entries ordered column-by-columns.

Sourceยง

impl<T, S> AsRef<[T; 1]> for Matrix<T, U1, U1, S>
where T: Scalar, S: RawStorage<T, U1, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 1]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 10]> for Matrix<T, U1, U10, S>
where T: Scalar, S: RawStorage<T, U1, U10> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 10]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 10]> for Matrix<T, U10, U1, S>
where T: Scalar, S: RawStorage<T, U10, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 10]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 11]> for Matrix<T, U1, U11, S>
where T: Scalar, S: RawStorage<T, U1, U11> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 11]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 11]> for Matrix<T, U11, U1, S>
where T: Scalar, S: RawStorage<T, U11, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 11]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 12]> for Matrix<T, U1, U12, S>
where T: Scalar, S: RawStorage<T, U1, U12> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 12]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 12]> for Matrix<T, U12, U1, S>
where T: Scalar, S: RawStorage<T, U12, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 12]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 13]> for Matrix<T, U1, U13, S>
where T: Scalar, S: RawStorage<T, U1, U13> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 13]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 13]> for Matrix<T, U13, U1, S>
where T: Scalar, S: RawStorage<T, U13, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 13]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 14]> for Matrix<T, U1, U14, S>
where T: Scalar, S: RawStorage<T, U1, U14> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 14]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 14]> for Matrix<T, U14, U1, S>
where T: Scalar, S: RawStorage<T, U14, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 14]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 15]> for Matrix<T, U1, U15, S>
where T: Scalar, S: RawStorage<T, U1, U15> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 15]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 15]> for Matrix<T, U15, U1, S>
where T: Scalar, S: RawStorage<T, U15, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 15]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 16]> for Matrix<T, U1, U16, S>
where T: Scalar, S: RawStorage<T, U1, U16> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 16]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 16]> for Matrix<T, U16, U1, S>
where T: Scalar, S: RawStorage<T, U16, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 16]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 2]> for Matrix<T, U1, U2, S>
where T: Scalar, S: RawStorage<T, U1, U2> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 2]> for Matrix<T, U2, U1, S>
where T: Scalar, S: RawStorage<T, U2, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 2]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 3]> for Matrix<T, U1, U3, S>
where T: Scalar, S: RawStorage<T, U1, U3> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 3]> for Matrix<T, U3, U1, S>
where T: Scalar, S: RawStorage<T, U3, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 3]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 4]> for Matrix<T, U1, U4, S>
where T: Scalar, S: RawStorage<T, U1, U4> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 4]> for Matrix<T, U4, U1, S>
where T: Scalar, S: RawStorage<T, U4, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 5]> for Matrix<T, U1, U5, S>
where T: Scalar, S: RawStorage<T, U1, U5> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 5]> for Matrix<T, U5, U1, S>
where T: Scalar, S: RawStorage<T, U5, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 5]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 6]> for Matrix<T, U1, U6, S>
where T: Scalar, S: RawStorage<T, U1, U6> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 6]> for Matrix<T, U6, U1, S>
where T: Scalar, S: RawStorage<T, U6, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 6]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 7]> for Matrix<T, U1, U7, S>
where T: Scalar, S: RawStorage<T, U1, U7> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 7]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 7]> for Matrix<T, U7, U1, S>
where T: Scalar, S: RawStorage<T, U7, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 7]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 8]> for Matrix<T, U1, U8, S>
where T: Scalar, S: RawStorage<T, U1, U8> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 8]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 8]> for Matrix<T, U8, U1, S>
where T: Scalar, S: RawStorage<T, U8, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 8]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 9]> for Matrix<T, U1, U9, S>
where T: Scalar, S: RawStorage<T, U1, U9> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 9]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, S> AsRef<[T; 9]> for Matrix<T, U9, U1, S>
where T: Scalar, S: RawStorage<T, U9, U1> + IsContiguous,

Sourceยง

fn as_ref(&self) -> &[T; 9]

Converts this type into a shared reference of the (usually inferred) input type.
Sourceยง

impl<T, R: Dim, C: Dim, S> Binary for Matrix<T, R, C, S>
where T: Scalar + Binary, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 2]; 2]> for Matrix<T, U2, U2, S>
where S: RawStorage<T, U2, U2> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 2]; 2]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 2]; 3]> for Matrix<T, U2, U3, S>
where S: RawStorage<T, U2, U3> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 2]; 3]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 2]; 4]> for Matrix<T, U2, U4, S>
where S: RawStorage<T, U2, U4> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 2]; 4]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 2]; 5]> for Matrix<T, U2, U5, S>
where S: RawStorage<T, U2, U5> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 2]; 5]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 2]; 6]> for Matrix<T, U2, U6, S>
where S: RawStorage<T, U2, U6> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 2]; 6]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 3]; 2]> for Matrix<T, U3, U2, S>
where S: RawStorage<T, U3, U2> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 3]; 2]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 3]; 3]> for Matrix<T, U3, U3, S>
where S: RawStorage<T, U3, U3> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 3]; 3]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 3]; 4]> for Matrix<T, U3, U4, S>
where S: RawStorage<T, U3, U4> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 3]; 4]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 3]; 5]> for Matrix<T, U3, U5, S>
where S: RawStorage<T, U3, U5> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 3]; 5]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 3]; 6]> for Matrix<T, U3, U6, S>
where S: RawStorage<T, U3, U6> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 3]; 6]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 4]; 2]> for Matrix<T, U4, U2, S>
where S: RawStorage<T, U4, U2> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 4]; 2]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 4]; 3]> for Matrix<T, U4, U3, S>
where S: RawStorage<T, U4, U3> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 4]; 3]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 4]; 4]> for Matrix<T, U4, U4, S>
where S: RawStorage<T, U4, U4> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 4]; 4]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 4]; 5]> for Matrix<T, U4, U5, S>
where S: RawStorage<T, U4, U5> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 4]; 5]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 4]; 6]> for Matrix<T, U4, U6, S>
where S: RawStorage<T, U4, U6> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 4]; 6]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 5]; 2]> for Matrix<T, U5, U2, S>
where S: RawStorage<T, U5, U2> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 5]; 2]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 5]; 3]> for Matrix<T, U5, U3, S>
where S: RawStorage<T, U5, U3> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 5]; 3]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 5]; 4]> for Matrix<T, U5, U4, S>
where S: RawStorage<T, U5, U4> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 5]; 4]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 5]; 5]> for Matrix<T, U5, U5, S>
where S: RawStorage<T, U5, U5> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 5]; 5]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 5]; 6]> for Matrix<T, U5, U6, S>
where S: RawStorage<T, U5, U6> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 5]; 6]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 6]; 2]> for Matrix<T, U6, U2, S>
where S: RawStorage<T, U6, U2> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 6]; 2]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 6]; 3]> for Matrix<T, U6, U3, S>
where S: RawStorage<T, U6, U3> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 6]; 3]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 6]; 4]> for Matrix<T, U6, U4, S>
where S: RawStorage<T, U6, U4> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 6]; 4]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 6]; 5]> for Matrix<T, U6, U5, S>
where S: RawStorage<T, U6, U5> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 6]; 5]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> Borrow<[[T; 6]; 6]> for Matrix<T, U6, U6, S>
where S: RawStorage<T, U6, U6> + IsContiguous,

Sourceยง

fn borrow(&self) -> &[[T; 6]; 6]

Immutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 2]; 2]> for Matrix<T, U2, U2, S>
where S: RawStorageMut<T, U2, U2> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 2]; 2]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 2]; 3]> for Matrix<T, U2, U3, S>
where S: RawStorageMut<T, U2, U3> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 2]; 3]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 2]; 4]> for Matrix<T, U2, U4, S>
where S: RawStorageMut<T, U2, U4> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 2]; 4]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 2]; 5]> for Matrix<T, U2, U5, S>
where S: RawStorageMut<T, U2, U5> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 2]; 5]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 2]; 6]> for Matrix<T, U2, U6, S>
where S: RawStorageMut<T, U2, U6> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 2]; 6]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 3]; 2]> for Matrix<T, U3, U2, S>
where S: RawStorageMut<T, U3, U2> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 3]; 2]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 3]; 3]> for Matrix<T, U3, U3, S>
where S: RawStorageMut<T, U3, U3> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 3]; 3]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 3]; 4]> for Matrix<T, U3, U4, S>
where S: RawStorageMut<T, U3, U4> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 3]; 4]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 3]; 5]> for Matrix<T, U3, U5, S>
where S: RawStorageMut<T, U3, U5> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 3]; 5]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 3]; 6]> for Matrix<T, U3, U6, S>
where S: RawStorageMut<T, U3, U6> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 3]; 6]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 4]; 2]> for Matrix<T, U4, U2, S>
where S: RawStorageMut<T, U4, U2> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 4]; 2]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 4]; 3]> for Matrix<T, U4, U3, S>
where S: RawStorageMut<T, U4, U3> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 4]; 3]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 4]; 4]> for Matrix<T, U4, U4, S>
where S: RawStorageMut<T, U4, U4> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 4]; 4]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 4]; 5]> for Matrix<T, U4, U5, S>
where S: RawStorageMut<T, U4, U5> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 4]; 5]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 4]; 6]> for Matrix<T, U4, U6, S>
where S: RawStorageMut<T, U4, U6> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 4]; 6]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 5]; 2]> for Matrix<T, U5, U2, S>
where S: RawStorageMut<T, U5, U2> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 5]; 2]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 5]; 3]> for Matrix<T, U5, U3, S>
where S: RawStorageMut<T, U5, U3> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 5]; 3]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 5]; 4]> for Matrix<T, U5, U4, S>
where S: RawStorageMut<T, U5, U4> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 5]; 4]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 5]; 5]> for Matrix<T, U5, U5, S>
where S: RawStorageMut<T, U5, U5> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 5]; 5]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 5]; 6]> for Matrix<T, U5, U6, S>
where S: RawStorageMut<T, U5, U6> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 5]; 6]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 6]; 2]> for Matrix<T, U6, U2, S>
where S: RawStorageMut<T, U6, U2> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 6]; 2]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 6]; 3]> for Matrix<T, U6, U3, S>
where S: RawStorageMut<T, U6, U3> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 6]; 3]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 6]; 4]> for Matrix<T, U6, U4, S>
where S: RawStorageMut<T, U6, U4> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 6]; 4]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 6]; 5]> for Matrix<T, U6, U5, S>
where S: RawStorageMut<T, U6, U5> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 6]; 5]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Scalar, S> BorrowMut<[[T; 6]; 6]> for Matrix<T, U6, U6, S>
where S: RawStorageMut<T, U6, U6> + IsContiguous,

Sourceยง

fn borrow_mut(&mut self) -> &mut [[T; 6]; 6]

Mutably borrows from an owned value. Read more
Sourceยง

impl<T: Clone, R: Clone, C: Clone, S: Clone> Clone for Matrix<T, R, C, S>

Sourceยง

fn clone(&self) -> Matrix<T, R, C, S>

Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S: Debug> Debug for Matrix<T, R, C, S>

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T, R, C, S> Default for Matrix<T, R, C, S>
where T: Scalar, R: Dim, C: Dim, S: Default,

Sourceยง

fn default() -> Self

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U1, U1, S>
where S: RawStorage<T, U1, U1> + IsContiguous,

Sourceยง

type Target = X<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U1, U2, S>
where S: RawStorage<T, U1, U2> + IsContiguous,

Sourceยง

type Target = XY<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U1, U3, S>
where S: RawStorage<T, U1, U3> + IsContiguous,

Sourceยง

type Target = XYZ<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U1, U4, S>
where S: RawStorage<T, U1, U4> + IsContiguous,

Sourceยง

type Target = XYZW<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U1, U5, S>
where S: RawStorage<T, U1, U5> + IsContiguous,

Sourceยง

type Target = XYZWA<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U1, U6, S>
where S: RawStorage<T, U1, U6> + IsContiguous,

Sourceยง

type Target = XYZWAB<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U2, U1, S>
where S: RawStorage<T, U2, U1> + IsContiguous,

Sourceยง

type Target = XY<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U2, U2, S>
where S: RawStorage<T, U2, U2> + IsContiguous,

Sourceยง

type Target = M2x2<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U2, U3, S>
where S: RawStorage<T, U2, U3> + IsContiguous,

Sourceยง

type Target = M2x3<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U2, U4, S>
where S: RawStorage<T, U2, U4> + IsContiguous,

Sourceยง

type Target = M2x4<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U2, U5, S>
where S: RawStorage<T, U2, U5> + IsContiguous,

Sourceยง

type Target = M2x5<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U2, U6, S>
where S: RawStorage<T, U2, U6> + IsContiguous,

Sourceยง

type Target = M2x6<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U3, U1, S>
where S: RawStorage<T, U3, U1> + IsContiguous,

Sourceยง

type Target = XYZ<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U3, U2, S>
where S: RawStorage<T, U3, U2> + IsContiguous,

Sourceยง

type Target = M3x2<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U3, U3, S>
where S: RawStorage<T, U3, U3> + IsContiguous,

Sourceยง

type Target = M3x3<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U3, U4, S>
where S: RawStorage<T, U3, U4> + IsContiguous,

Sourceยง

type Target = M3x4<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U3, U5, S>
where S: RawStorage<T, U3, U5> + IsContiguous,

Sourceยง

type Target = M3x5<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U3, U6, S>
where S: RawStorage<T, U3, U6> + IsContiguous,

Sourceยง

type Target = M3x6<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U4, U1, S>
where S: RawStorage<T, U4, U1> + IsContiguous,

Sourceยง

type Target = XYZW<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U4, U2, S>
where S: RawStorage<T, U4, U2> + IsContiguous,

Sourceยง

type Target = M4x2<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U4, U3, S>
where S: RawStorage<T, U4, U3> + IsContiguous,

Sourceยง

type Target = M4x3<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U4, U4, S>
where S: RawStorage<T, U4, U4> + IsContiguous,

Sourceยง

type Target = M4x4<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U4, U5, S>
where S: RawStorage<T, U4, U5> + IsContiguous,

Sourceยง

type Target = M4x5<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U4, U6, S>
where S: RawStorage<T, U4, U6> + IsContiguous,

Sourceยง

type Target = M4x6<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U5, U1, S>
where S: RawStorage<T, U5, U1> + IsContiguous,

Sourceยง

type Target = XYZWA<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U5, U2, S>
where S: RawStorage<T, U5, U2> + IsContiguous,

Sourceยง

type Target = M5x2<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U5, U3, S>
where S: RawStorage<T, U5, U3> + IsContiguous,

Sourceยง

type Target = M5x3<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U5, U4, S>
where S: RawStorage<T, U5, U4> + IsContiguous,

Sourceยง

type Target = M5x4<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U5, U5, S>
where S: RawStorage<T, U5, U5> + IsContiguous,

Sourceยง

type Target = M5x5<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U5, U6, S>
where S: RawStorage<T, U5, U6> + IsContiguous,

Sourceยง

type Target = M5x6<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U6, U1, S>
where S: RawStorage<T, U6, U1> + IsContiguous,

Sourceยง

type Target = XYZWAB<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U6, U2, S>
where S: RawStorage<T, U6, U2> + IsContiguous,

Sourceยง

type Target = M6x2<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U6, U3, S>
where S: RawStorage<T, U6, U3> + IsContiguous,

Sourceยง

type Target = M6x3<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U6, U4, S>
where S: RawStorage<T, U6, U4> + IsContiguous,

Sourceยง

type Target = M6x4<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U6, U5, S>
where S: RawStorage<T, U6, U5> + IsContiguous,

Sourceยง

type Target = M6x5<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> Deref for Matrix<T, U6, U6, S>
where S: RawStorage<T, U6, U6> + IsContiguous,

Sourceยง

type Target = M6x6<T>

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &Self::Target

Dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U1, U1, S>
where S: RawStorageMut<T, U1, U1> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U1, U2, S>
where S: RawStorageMut<T, U1, U2> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U1, U3, S>
where S: RawStorageMut<T, U1, U3> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U1, U4, S>
where S: RawStorageMut<T, U1, U4> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U1, U5, S>
where S: RawStorageMut<T, U1, U5> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U1, U6, S>
where S: RawStorageMut<T, U1, U6> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U2, U1, S>
where S: RawStorageMut<T, U2, U1> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U2, U2, S>
where S: RawStorageMut<T, U2, U2> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U2, U3, S>
where S: RawStorageMut<T, U2, U3> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U2, U4, S>
where S: RawStorageMut<T, U2, U4> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U2, U5, S>
where S: RawStorageMut<T, U2, U5> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U2, U6, S>
where S: RawStorageMut<T, U2, U6> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U3, U1, S>
where S: RawStorageMut<T, U3, U1> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U3, U2, S>
where S: RawStorageMut<T, U3, U2> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U3, U3, S>
where S: RawStorageMut<T, U3, U3> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U3, U4, S>
where S: RawStorageMut<T, U3, U4> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U3, U5, S>
where S: RawStorageMut<T, U3, U5> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U3, U6, S>
where S: RawStorageMut<T, U3, U6> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U4, U1, S>
where S: RawStorageMut<T, U4, U1> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U4, U2, S>
where S: RawStorageMut<T, U4, U2> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U4, U3, S>
where S: RawStorageMut<T, U4, U3> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U4, U4, S>
where S: RawStorageMut<T, U4, U4> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U4, U5, S>
where S: RawStorageMut<T, U4, U5> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U4, U6, S>
where S: RawStorageMut<T, U4, U6> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U5, U1, S>
where S: RawStorageMut<T, U5, U1> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U5, U2, S>
where S: RawStorageMut<T, U5, U2> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U5, U3, S>
where S: RawStorageMut<T, U5, U3> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U5, U4, S>
where S: RawStorageMut<T, U5, U4> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U5, U5, S>
where S: RawStorageMut<T, U5, U5> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U5, U6, S>
where S: RawStorageMut<T, U5, U6> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U6, U1, S>
where S: RawStorageMut<T, U6, U1> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U6, U2, S>
where S: RawStorageMut<T, U6, U2> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U6, U3, S>
where S: RawStorageMut<T, U6, U3> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U6, U4, S>
where S: RawStorageMut<T, U6, U4> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U6, U5, S>
where S: RawStorageMut<T, U6, U5> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<T: Scalar, S> DerefMut for Matrix<T, U6, U6, S>
where S: RawStorageMut<T, U6, U6> + IsContiguous,

Sourceยง

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Sourceยง

impl<'de, T, R, C, S> Deserialize<'de> for Matrix<T, R, C, S>
where T: Scalar, R: Dim, C: Dim, S: Deserialize<'de>,

Available on crate feature serde-serialize-no-std only.
Sourceยง

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Display for Matrix<T, R, C, S>
where T: Scalar + Display, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<'a, 'b, T, R1, C1, SA, const D2: usize> Div<&'b Rotation<T, D2>> for &'a Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the / operator.
Sourceยง

fn div(self, right: &'b Rotation<T, D2>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<'b, T, R1, C1, SA, const D2: usize> Div<&'b Rotation<T, D2>> for Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the / operator.
Sourceยง

fn div(self, right: &'b Rotation<T, D2>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<'a, T, R1, C1, SA, const D2: usize> Div<Rotation<T, D2>> for &'a Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the / operator.
Sourceยง

fn div(self, right: Rotation<T, D2>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<T, R1, C1, SA, const D2: usize> Div<Rotation<T, D2>> for Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the / operator.
Sourceยง

fn div(self, right: Rotation<T, D2>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<'a, T, R: Dim, C: Dim, S> Div<T> for &'a Matrix<T, R, C, S>
where T: Scalar + ClosedDivAssign, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Sourceยง

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

The resulting type after applying the / operator.
Sourceยง

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Div<T> for Matrix<T, R, C, S>
where T: Scalar + ClosedDivAssign, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Sourceยง

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

The resulting type after applying the / operator.
Sourceยง

fn div(self, rhs: T) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> DivAssign<T> for Matrix<T, R, C, S>
where T: Scalar + ClosedDivAssign, S: StorageMut<T, R, C>,

Sourceยง

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Sourceยง

impl<'a, T: Scalar + Copy, R: Dim, C: Dim, S: RawStorage<T, R, C> + IsContiguous> From<&'a Matrix<T, R, C, S>> for &'a [T]

Sourceยง

fn from(matrix: &'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 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: Scalar + Copy, R: Dim, C: Dim, S: RawStorageMut<T, R, C> + IsContiguous> From<&'a mut Matrix<T, R, C, S>> for &'a mut [T]

Sourceยง

fn from(matrix: &'a mut 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, RView, CView, RStride, CStride, S> From<&'a mut Matrix<T, R, C, S>> for MatrixViewMut<'a, T, RView, CView, RStride, CStride>
where R: Dim, C: Dim, RView: Dim, CView: Dim, RStride: Dim, CStride: Dim, S: RawStorageMut<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<T: Scalar, const D: usize> From<Matrix<T, Const<1>, Const<D>, ArrayStorage<T, 1, D>>> for [T; D]

Sourceยง

fn from(vec: RowSVector<T, D>) -> [T; D]

Converts to this type from the input type.
Sourceยง

impl<T: Scalar> From<Matrix<T, Const<4>, Const<1>, ArrayStorage<T, 4, 1>>> for Quaternion<T>

Sourceยง

fn from(coords: Vector4<T>) -> Self

Converts to this type from the input type.
Sourceยง

impl<T: Scalar, const D: usize> From<Matrix<T, Const<D>, Const<1>, <DefaultAllocator as Allocator<Const<D>>>::Buffer<T>>> for Scale<T, D>

Sourceยง

fn from(vector: OVector<T, Const<D>>) -> Self

Converts to this type from the input type.
Sourceยง

impl<T: Scalar, const D: usize> From<Matrix<T, Const<D>, Const<1>, <DefaultAllocator as Allocator<Const<D>>>::Buffer<T>>> for Translation<T, D>

Sourceยง

fn from(vector: OVector<T, Const<D>>) -> Self

Converts to this type from the input type.
Sourceยง

impl<T: Scalar, const D: usize> From<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for [T; D]

Sourceยง

fn from(vec: SVector<T, D>) -> Self

Converts to this type from the input type.
Sourceยง

impl<T: SimdRealField, R, const D: usize> From<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Isometry<T, R, D>
where R: AbstractRotation<T, D>,

Sourceยง

fn from(coords: SVector<T, D>) -> Self

Converts to this type from the input type.
Sourceยง

impl<'a, T: Scalar, RStride: Dim, CStride: Dim, const D: usize> From<Matrix<T, Const<D>, Const<1>, ViewStorage<'a, T, Const<D>, Const<1>, RStride, CStride>>> for [T; D]

Sourceยง

fn from(vec: VectorView<'a, T, Const<D>, RStride, CStride>) -> Self

Converts to this type from the input type.
Sourceยง

impl<'a, T: Scalar, RStride: Dim, CStride: Dim, const D: usize> From<Matrix<T, Const<D>, Const<1>, ViewStorageMut<'a, T, Const<D>, Const<1>, RStride, CStride>>> for [T; D]

Sourceยง

fn from(vec: VectorViewMut<'a, T, Const<D>, RStride, CStride>) -> Self

Converts to this type from the input type.
Sourceยง

impl<T: Scalar, const R: usize, const C: usize> From<Matrix<T, Const<R>, Const<C>, ArrayStorage<T, R, C>>> for [[T; R]; C]

Sourceยง

fn from(mat: SMatrix<T, R, C>) -> Self

Converts to this type from the input type.
Sourceยง

impl<'a, T: Scalar, RStride: Dim, CStride: Dim, const R: usize, const C: usize> From<Matrix<T, Const<R>, Const<C>, ViewStorage<'a, T, Const<R>, Const<C>, RStride, CStride>>> for [[T; R]; C]

Sourceยง

fn from(mat: MatrixView<'a, T, Const<R>, Const<C>, RStride, CStride>) -> Self

Converts to this type from the input type.
Sourceยง

impl<'a, T, RStride, CStride, const R: usize, const C: usize> From<Matrix<T, Const<R>, Const<C>, ViewStorage<'a, T, Const<R>, Const<C>, RStride, CStride>>> for Matrix<T, Const<R>, Const<C>, ArrayStorage<T, R, C>>
where T: Scalar, RStride: Dim, CStride: Dim,

Sourceยง

fn from( matrix_view: MatrixView<'a, T, Const<R>, Const<C>, RStride, CStride>, ) -> Self

Converts to this type from the input type.
Sourceยง

impl<'a, T: Scalar, RStride: Dim, CStride: Dim, const R: usize, const C: usize> From<Matrix<T, Const<R>, Const<C>, ViewStorageMut<'a, T, Const<R>, Const<C>, RStride, CStride>>> for [[T; R]; C]

Sourceยง

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

Converts to this type from the input type.
Sourceยง

impl<'a, T, RStride, CStride, const R: usize, const C: usize> From<Matrix<T, Const<R>, Const<C>, ViewStorageMut<'a, T, Const<R>, Const<C>, RStride, CStride>>> for Matrix<T, Const<R>, Const<C>, ArrayStorage<T, R, C>>
where T: Scalar, RStride: Dim, CStride: Dim,

Sourceยง

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

Converts to this type from the input type.
Sourceยง

impl<T: Scalar, D: DimName> From<Matrix<T, D, Const<1>, <DefaultAllocator as Allocator<D>>::Buffer<T>>> for OPoint<T, D>

Sourceยง

fn from(coords: OVector<T, D>) -> Self

Converts to this type from the input type.
Sourceยง

impl<'a, T: Scalar> From<Matrix<T, Dyn, Const<1>, ViewStorage<'a, T, Dyn, Const<1>, Const<1>, Dyn>>> for &'a [T]

Sourceยง

fn from(vec: DVectorView<'a, T>) -> &'a [T]

Converts to this type from the input type.
Sourceยง

impl<'a, T: Scalar> From<Matrix<T, Dyn, Const<1>, ViewStorageMut<'a, T, Dyn, Const<1>, Const<1>, Dyn>>> for &'a mut [T]

Sourceยง

fn from(vec: DVectorViewMut<'a, T>) -> &'a mut [T]

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.
Sourceยง

impl<S> From<Matrix<bool, Const<2>, Const<1>, S>> for BVec2
where S: RawStorage<bool, U2>,

Sourceยง

fn from(e: Vector<bool, U2, S>) -> BVec2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<bool, Const<3>, Const<1>, S>> for BVec3
where S: RawStorage<bool, U3>,

Sourceยง

fn from(e: Vector<bool, U3, S>) -> BVec3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<bool, Const<4>, Const<1>, S>> for BVec4
where S: RawStorage<bool, U4>,

Sourceยง

fn from(e: Vector<bool, U4, S>) -> BVec4

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<2>, Const<1>, S>> for Vec2
where S: RawStorage<f32, U2>,

Sourceยง

fn from(e: Vector<f32, U2, S>) -> Vec2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<2>, Const<2>, S>> for Mat2
where S: RawStorage<f32, U2, U2>,

Sourceยง

fn from(e: Matrix<f32, U2, U2, S>) -> Mat2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<3>, Const<1>, S>> for Vec3
where S: RawStorage<f32, U3>,

Sourceยง

fn from(e: Vector<f32, U3, S>) -> Vec3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<3>, Const<1>, S>> for Vec3A
where S: RawStorage<f32, U3>,

Sourceยง

fn from(e: Vector<f32, U3, S>) -> Vec3A

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<3>, Const<3>, S>> for Mat3
where S: RawStorage<f32, U3, U3>,

Sourceยง

fn from(e: Matrix<f32, U3, U3, S>) -> Mat3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<4>, Const<1>, S>> for Vec4
where S: RawStorage<f32, U4>,

Sourceยง

fn from(e: Vector<f32, U4, S>) -> Vec4

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f32, Const<4>, Const<4>, S>> for Mat4
where S: RawStorage<f32, U4, U4>,

Sourceยง

fn from(e: Matrix<f32, U4, U4, S>) -> Mat4

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f64, Const<2>, Const<1>, S>> for DVec2
where S: RawStorage<f64, U2>,

Sourceยง

fn from(e: Vector<f64, U2, S>) -> DVec2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f64, Const<2>, Const<2>, S>> for DMat2
where S: RawStorage<f64, U2, U2>,

Sourceยง

fn from(e: Matrix<f64, U2, U2, S>) -> DMat2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f64, Const<3>, Const<1>, S>> for DVec3
where S: RawStorage<f64, U3>,

Sourceยง

fn from(e: Vector<f64, U3, S>) -> DVec3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f64, Const<3>, Const<3>, S>> for DMat3
where S: RawStorage<f64, U3, U3>,

Sourceยง

fn from(e: Matrix<f64, U3, U3, S>) -> DMat3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f64, Const<4>, Const<1>, S>> for DVec4
where S: RawStorage<f64, U4>,

Sourceยง

fn from(e: Vector<f64, U4, S>) -> DVec4

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<f64, Const<4>, Const<4>, S>> for DMat4
where S: RawStorage<f64, U4, U4>,

Sourceยง

fn from(e: Matrix<f64, U4, U4, S>) -> DMat4

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<i32, Const<2>, Const<1>, S>> for IVec2
where S: RawStorage<i32, U2>,

Sourceยง

fn from(e: Vector<i32, U2, S>) -> IVec2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<i32, Const<3>, Const<1>, S>> for IVec3
where S: RawStorage<i32, U3>,

Sourceยง

fn from(e: Vector<i32, U3, S>) -> IVec3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<i32, Const<4>, Const<1>, S>> for IVec4
where S: RawStorage<i32, U4>,

Sourceยง

fn from(e: Vector<i32, U4, S>) -> IVec4

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<u32, Const<2>, Const<1>, S>> for UVec2
where S: RawStorage<u32, U2>,

Sourceยง

fn from(e: Vector<u32, U2, S>) -> UVec2

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<u32, Const<3>, Const<1>, S>> for UVec3
where S: RawStorage<u32, U3>,

Sourceยง

fn from(e: Vector<u32, U3, S>) -> UVec3

Converts to this type from the input type.
Sourceยง

impl<S> From<Matrix<u32, Const<4>, Const<1>, S>> for UVec4
where S: RawStorage<u32, U4>,

Sourceยง

fn from(e: Vector<u32, U4, S>) -> UVec4

Converts to this type from the input type.
Sourceยง

impl<T, R, C, S> Hash for Matrix<T, R, C, S>
where T: Scalar + Hash, R: Dim, C: Dim, S: RawStorage<T, R, C>,

Sourceยง

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 ยท Sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Index<(usize, usize)> for Matrix<T, R, C, S>

Sourceยง

type Output = T

The returned type after indexing.
Sourceยง

fn index(&self, ij: (usize, usize)) -> &Self::Output

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

impl<T, R: Dim, C: Dim, S: RawStorage<T, R, C>> Index<usize> for Matrix<T, R, C, S>

Sourceยง

type Output = T

The returned type after indexing.
Sourceยง

fn index(&self, i: usize) -> &Self::Output

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

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> IndexMut<(usize, usize)> for Matrix<T, R, C, S>

Sourceยง

fn index_mut(&mut self, ij: (usize, usize)) -> &mut T

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

impl<T, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> IndexMut<usize> for Matrix<T, R, C, S>

Sourceยง

fn index_mut(&mut self, i: usize) -> &mut T

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

impl<'a, T: Scalar, R: Dim, C: Dim, S: RawStorage<T, R, C>> IntoIterator for &'a Matrix<T, R, C, S>

Sourceยง

type Item = &'a T

The type of the elements being iterated over.
Sourceยง

type IntoIter = MatrixIter<'a, T, R, C, S>

Which kind of iterator are we turning this into?
Sourceยง

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Sourceยง

impl<'a, T: Scalar, R: Dim, C: Dim, S: RawStorageMut<T, R, C>> IntoIterator for &'a mut Matrix<T, R, C, S>

Sourceยง

type Item = &'a mut T

The type of the elements being iterated over.
Sourceยง

type IntoIter = MatrixIterMut<'a, T, R, C, S>

Which kind of iterator are we turning this into?
Sourceยง

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Sourceยง

impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> IntoIterator for Matrix<T, R, C, ViewStorage<'a, T, R, C, RStride, CStride>>

Sourceยง

type Item = &'a T

The type of the elements being iterated over.
Sourceยง

type IntoIter = MatrixIter<'a, T, R, C, ViewStorage<'a, T, R, C, RStride, CStride>>

Which kind of iterator are we turning this into?
Sourceยง

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Sourceยง

impl<'a, T: Scalar, R: Dim, C: Dim, RStride: Dim, CStride: Dim> IntoIterator for Matrix<T, R, C, ViewStorageMut<'a, T, R, C, RStride, CStride>>

Sourceยง

type Item = &'a mut T

The type of the elements being iterated over.
Sourceยง

type IntoIter = MatrixIterMut<'a, T, R, C, ViewStorageMut<'a, T, R, C, RStride, CStride>>

Which kind of iterator are we turning this into?
Sourceยง

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> LowerExp for Matrix<T, R, C, S>
where T: Scalar + LowerExp, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> LowerHex for Matrix<T, R, C, S>
where T: Scalar + LowerHex, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<'a, 'b, T: SimdRealField, S: Storage<T, Const<2>>> Mul<&'b Matrix<T, Const<2>, Const<1>, S>> for &'a UnitComplex<T>

Sourceยง

type Output = Matrix<T, Const<2>, Const<1>, ArrayStorage<T, 2, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Vector<T, Const<2>, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T: SimdRealField, S: Storage<T, Const<2>>> Mul<&'b Matrix<T, Const<2>, Const<1>, S>> for UnitComplex<T>

Sourceยง

type Output = Matrix<T, Const<2>, Const<1>, ArrayStorage<T, 2, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Vector<T, Const<2>, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T: SimdRealField, SB: Storage<T, U3>> Mul<&'b Matrix<T, Const<3>, Const<1>, SB>> for &'a UnitDualQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T: SimdRealField, SB: Storage<T, Const<3>>> Mul<&'b Matrix<T, Const<3>, Const<1>, SB>> for &'a UnitQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Vector<T, Const<3>, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T: SimdRealField, SB: Storage<T, U3>> Mul<&'b Matrix<T, Const<3>, Const<1>, SB>> for UnitDualQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T: SimdRealField, SB: Storage<T, Const<3>>> Mul<&'b Matrix<T, Const<3>, Const<1>, SB>> for UnitQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T: SimdRealField, R, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Isometry<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Scale<T, D>
where T: Scalar + ClosedMulAssign, ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<U1, U1, Representative = U1>,

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T: SimdRealField, R, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Similarity<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T, C, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Transform<T, C, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T: SimdRealField, R, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Isometry<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Scale<T, D>
where T: Scalar + ClosedMulAssign, ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<U1, U1, Representative = U1>,

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T: SimdRealField, R, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Similarity<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, C, const D: usize> Mul<&'b Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Transform<T, C, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<&'b Matrix<T, R2, C2, SB>> for &Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<R1, C2>, ShapeConstraint: AreMultipliable<R1, C1, R2, C2>,

Sourceยง

type Output = Matrix<T, R1, C2, <DefaultAllocator as Allocator<R1, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T, R2, C2, SB, const D1: usize> Mul<&'b Matrix<T, R2, C2, SB>> for &'a Rotation<T, D1>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<Const<D1>, C2>, ShapeConstraint: AreMultipliable<Const<D1>, Const<D1>, R2, C2>,

Sourceยง

type Output = Matrix<T, Const<D1>, C2, <DefaultAllocator as Allocator<Const<D1>, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SB: Storage<T, R2, C2>, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, C2>, ShapeConstraint: AreMultipliable<R1, C1, R2, C2>,

Sourceยง

type Output = Matrix<T, R1, C2, <DefaultAllocator as Allocator<R1, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, R2, C2, SB, const D1: usize> Mul<&'b Matrix<T, R2, C2, SB>> for Rotation<T, D1>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<Const<D1>, C2>, ShapeConstraint: AreMultipliable<Const<D1>, Const<D1>, R2, C2>,

Sourceยง

type Output = Matrix<T, Const<D1>, C2, <DefaultAllocator as Allocator<Const<D1>, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<f32, R, C>> Mul<&'b Matrix<f32, R, C, S>> for f32

Sourceยง

type Output = Matrix<f32, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<f32>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<f32, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<f64, R, C>> Mul<&'b Matrix<f64, R, C, S>> for f64

Sourceยง

type Output = Matrix<f64, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<f64>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<f64, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<i16, R, C>> Mul<&'b Matrix<i16, R, C, S>> for i16

Sourceยง

type Output = Matrix<i16, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i16>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<i16, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<i32, R, C>> Mul<&'b Matrix<i32, R, C, S>> for i32

Sourceยง

type Output = Matrix<i32, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i32>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<i32, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<i64, R, C>> Mul<&'b Matrix<i64, R, C, S>> for i64

Sourceยง

type Output = Matrix<i64, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i64>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<i64, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<i8, R, C>> Mul<&'b Matrix<i8, R, C, S>> for i8

Sourceยง

type Output = Matrix<i8, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i8>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<i8, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<isize, R, C>> Mul<&'b Matrix<isize, R, C, S>> for isize

Sourceยง

type Output = Matrix<isize, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<isize>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<isize, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<u16, R, C>> Mul<&'b Matrix<u16, R, C, S>> for u16

Sourceยง

type Output = Matrix<u16, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u16>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<u16, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<u32, R, C>> Mul<&'b Matrix<u32, R, C, S>> for u32

Sourceยง

type Output = Matrix<u32, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u32>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<u32, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<u64, R, C>> Mul<&'b Matrix<u64, R, C, S>> for u64

Sourceยง

type Output = Matrix<u64, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u64>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<u64, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<u8, R, C>> Mul<&'b Matrix<u8, R, C, S>> for u8

Sourceยง

type Output = Matrix<u8, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u8>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<u8, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, R: Dim, C: Dim, S: Storage<usize, R, C>> Mul<&'b Matrix<usize, R, C, S>> for usize

Sourceยง

type Output = Matrix<usize, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<usize>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &'b Matrix<usize, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T, SA, const D2: usize, const R1: usize, const C1: usize> Mul<&'b OPoint<T, Const<D2>>> for &'a Matrix<T, Const<R1>, Const<C1>, SA>

Sourceยง

type Output = OPoint<T, Const<R1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b Point<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, SA, const D2: usize, const R1: usize, const C1: usize> Mul<&'b OPoint<T, Const<D2>>> for Matrix<T, Const<R1>, Const<C1>, SA>

Sourceยง

type Output = OPoint<T, Const<R1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b Point<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, 'b, T, R1, C1, SA, const D2: usize> Mul<&'b Rotation<T, D2>> for &'a Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b Rotation<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, R1, C1, SA, const D2: usize> Mul<&'b Rotation<T, D2>> for Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: &'b Rotation<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T: SimdRealField, S: Storage<T, Const<2>>> Mul<Matrix<T, Const<2>, Const<1>, S>> for &'a UnitComplex<T>

Sourceยง

type Output = Matrix<T, Const<2>, Const<1>, ArrayStorage<T, 2, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Vector<T, Const<2>, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T: SimdRealField, S: Storage<T, Const<2>>> Mul<Matrix<T, Const<2>, Const<1>, S>> for UnitComplex<T>

Sourceยง

type Output = Matrix<T, Const<2>, Const<1>, ArrayStorage<T, 2, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Vector<T, Const<2>, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T: SimdRealField, SB: Storage<T, U3>> Mul<Matrix<T, Const<3>, Const<1>, SB>> for &'a UnitDualQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T: SimdRealField, SB: Storage<T, Const<3>>> Mul<Matrix<T, Const<3>, Const<1>, SB>> for &'a UnitQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T: SimdRealField, SB: Storage<T, U3>> Mul<Matrix<T, Const<3>, Const<1>, SB>> for UnitDualQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T: SimdRealField, SB: Storage<T, Const<3>>> Mul<Matrix<T, Const<3>, Const<1>, SB>> for UnitQuaternion<T>

Sourceยง

type Output = Matrix<T, Const<3>, Const<1>, ArrayStorage<T, 3, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Vector<T, U3, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T: SimdRealField, R, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Isometry<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Scale<T, D>
where T: Scalar + ClosedMulAssign, ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<U1, U1, Representative = U1>,

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T: SimdRealField, R, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Similarity<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T, C, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for &'a Transform<T, C, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T: SimdRealField, R, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Isometry<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Scale<T, D>
where T: Scalar + ClosedMulAssign, ShapeConstraint: SameNumberOfRows<Const<D>, Const<D>, Representative = Const<D>> + SameNumberOfColumns<U1, U1, Representative = U1>,

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T: SimdRealField, R, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Similarity<T, R, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, C, const D: usize> Mul<Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>> for Transform<T, C, D>

Sourceยง

type Output = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: SVector<T, D>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<Matrix<T, R2, C2, SB>> for &Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SB: Storage<T, R2, C2>, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, C2>, ShapeConstraint: AreMultipliable<R1, C1, R2, C2>,

Sourceยง

type Output = Matrix<T, R1, C2, <DefaultAllocator as Allocator<R1, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T, R2, C2, SB, const D1: usize> Mul<Matrix<T, R2, C2, SB>> for &'a Rotation<T, D1>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<Const<D1>, C2>, ShapeConstraint: AreMultipliable<Const<D1>, Const<D1>, R2, C2>,

Sourceยง

type Output = Matrix<T, Const<D1>, C2, <DefaultAllocator as Allocator<Const<D1>, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, R1: Dim, C1: Dim, R2: Dim, C2: Dim, SA, SB> Mul<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SB: Storage<T, R2, C2>, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, C2>, ShapeConstraint: AreMultipliable<R1, C1, R2, C2>,

Sourceยง

type Output = Matrix<T, R1, C2, <DefaultAllocator as Allocator<R1, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, R2, C2, SB, const D1: usize> Mul<Matrix<T, R2, C2, SB>> for Rotation<T, D1>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R2: Dim, C2: Dim, SB: Storage<T, R2, C2>, DefaultAllocator: Allocator<Const<D1>, C2>, ShapeConstraint: AreMultipliable<Const<D1>, Const<D1>, R2, C2>,

Sourceยง

type Output = Matrix<T, Const<D1>, C2, <DefaultAllocator as Allocator<Const<D1>, C2>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<f32, R, C>> Mul<Matrix<f32, R, C, S>> for f32

Sourceยง

type Output = Matrix<f32, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<f32>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<f32, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<f64, R, C>> Mul<Matrix<f64, R, C, S>> for f64

Sourceยง

type Output = Matrix<f64, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<f64>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<f64, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<i16, R, C>> Mul<Matrix<i16, R, C, S>> for i16

Sourceยง

type Output = Matrix<i16, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i16>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<i16, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<i32, R, C>> Mul<Matrix<i32, R, C, S>> for i32

Sourceยง

type Output = Matrix<i32, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i32>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<i32, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<i64, R, C>> Mul<Matrix<i64, R, C, S>> for i64

Sourceยง

type Output = Matrix<i64, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i64>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<i64, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<i8, R, C>> Mul<Matrix<i8, R, C, S>> for i8

Sourceยง

type Output = Matrix<i8, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<i8>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<i8, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<isize, R, C>> Mul<Matrix<isize, R, C, S>> for isize

Sourceยง

type Output = Matrix<isize, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<isize>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<isize, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<u16, R, C>> Mul<Matrix<u16, R, C, S>> for u16

Sourceยง

type Output = Matrix<u16, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u16>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<u16, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<u32, R, C>> Mul<Matrix<u32, R, C, S>> for u32

Sourceยง

type Output = Matrix<u32, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u32>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<u32, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<u64, R, C>> Mul<Matrix<u64, R, C, S>> for u64

Sourceยง

type Output = Matrix<u64, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u64>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<u64, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<u8, R, C>> Mul<Matrix<u8, R, C, S>> for u8

Sourceยง

type Output = Matrix<u8, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<u8>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<u8, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<R: Dim, C: Dim, S: Storage<usize, R, C>> Mul<Matrix<usize, R, C, S>> for usize

Sourceยง

type Output = Matrix<usize, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<usize>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: Matrix<usize, R, C, S>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T, SA, const D2: usize, const R1: usize, const C1: usize> Mul<OPoint<T, Const<D2>>> for &'a Matrix<T, Const<R1>, Const<C1>, SA>

Sourceยง

type Output = OPoint<T, Const<R1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: Point<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, SA, const D2: usize, const R1: usize, const C1: usize> Mul<OPoint<T, Const<D2>>> for Matrix<T, Const<R1>, Const<C1>, SA>

Sourceยง

type Output = OPoint<T, Const<R1>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: Point<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T, R1, C1, SA, const D2: usize> Mul<Rotation<T, D2>> for &'a Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: Rotation<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, R1, C1, SA, const D2: usize> Mul<Rotation<T, D2>> for Matrix<T, R1, C1, SA>
where T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, R1: Dim, C1: Dim, SA: Storage<T, R1, C1>, DefaultAllocator: Allocator<R1, Const<D2>>, ShapeConstraint: AreMultipliable<R1, C1, Const<D2>, Const<D2>>,

Sourceยง

type Output = Matrix<T, R1, Const<D2>, <DefaultAllocator as Allocator<R1, Const<D2>>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, right: Rotation<T, D2>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'a, T, R: Dim, C: Dim, S> Mul<T> for &'a Matrix<T, R, C, S>
where T: Scalar + ClosedMulAssign, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Sourceยง

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Mul<T> for Matrix<T, R, C, S>
where T: Scalar + ClosedMulAssign, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Sourceยง

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<'b, T, R1, C1, R2, SA, SB> MulAssign<&'b Matrix<T, R2, C1, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SB: Storage<T, R2, C1>, SA: StorageMut<T, R1, C1> + IsContiguous + Clone, ShapeConstraint: AreMultipliable<R1, C1, R2, C1>, DefaultAllocator: Allocator<R1, C1, Buffer<T> = SA>,

Sourceยง

fn mul_assign(&mut self, rhs: &'b Matrix<T, R2, C1, SB>)

Performs the *= operation. Read more
Sourceยง

impl<T, R1, C1, R2, SA, SB> MulAssign<Matrix<T, R2, C1, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, T: Scalar + Zero + One + ClosedAddAssign + ClosedMulAssign, SB: Storage<T, R2, C1>, SA: StorageMut<T, R1, C1> + IsContiguous + Clone, ShapeConstraint: AreMultipliable<R1, C1, R2, C1>, DefaultAllocator: Allocator<R1, C1, Buffer<T> = SA>,

Sourceยง

fn mul_assign(&mut self, rhs: Matrix<T, R2, C1, SB>)

Performs the *= operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> MulAssign<T> for Matrix<T, R, C, S>
where T: Scalar + ClosedMulAssign, S: StorageMut<T, R, C>,

Sourceยง

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Neg for &Matrix<T, R, C, S>
where T: Scalar + ClosedNeg, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Sourceยง

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Neg for Matrix<T, R, C, S>
where T: Scalar + ClosedNeg, S: Storage<T, R, C>, DefaultAllocator: Allocator<R, C>,

Sourceยง

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Octal for Matrix<T, R, C, S>
where T: Scalar + Octal, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T, R, R2, C, C2, S, S2> PartialEq<Matrix<T, R2, C2, S2>> for Matrix<T, R, C, S>
where T: PartialEq, C: Dim, C2: Dim, R: Dim, R2: Dim, S: RawStorage<T, R, C>, S2: RawStorage<T, R2, C2>,

Sourceยง

fn eq(&self, right: &Matrix<T, R2, C2, S2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl<T, R: Dim, C: Dim, S> PartialOrd for Matrix<T, R, C, S>
where T: Scalar + PartialOrd, S: RawStorage<T, R, C>,

Sourceยง

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
Sourceยง

fn lt(&self, right: &Self) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
Sourceยง

fn le(&self, right: &Self) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
Sourceยง

fn gt(&self, right: &Self) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
Sourceยง

fn ge(&self, right: &Self) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> Pointer for Matrix<T, R, C, S>
where T: Scalar + Pointer, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<'a, T, D: DimName> Product<&'a Matrix<T, D, D, <DefaultAllocator as Allocator<D, D>>::Buffer<T>>> for OMatrix<T, D, D>

Sourceยง

fn product<I: Iterator<Item = &'a OMatrix<T, D, D>>>( iter: I, ) -> OMatrix<T, D, D>

Takes an iterator and generates Self from the elements by multiplying the items.
Sourceยง

impl<T, R: Dim, C: Dim, S> RelativeEq for Matrix<T, R, C, S>
where T: Scalar + RelativeEq, S: Storage<T, R, C>, T::Epsilon: Clone,

Sourceยง

fn default_max_relative() -> Self::Epsilon

The default relative tolerance for testing values that are far-apart. Read more
Sourceยง

fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

A test for equality that uses a relative comparison if the values are far apart.
Sourceยง

fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool

The inverse of RelativeEq::relative_eq.
Sourceยง

impl<T, R, C, S> Serialize for Matrix<T, R, C, S>
where T: Scalar, R: Dim, C: Dim, S: Serialize,

Available on crate feature serde-serialize-no-std only.
Sourceยง

fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where Ser: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl<'a, 'b, T, D1, D2, SB> Sub<&'b Matrix<T, D2, Const<1>, SB>> for &'a OPoint<T, D1>
where T: Scalar + ClosedSubAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, right: &'b Vector<T, D2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<'b, T, D1, D2, SB> Sub<&'b Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>
where T: Scalar + ClosedSubAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, right: &'b Vector<T, D2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<'a, 'b, T, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedSubAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer<T>>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<'b, T, R1, C1, R2, C2, SA, SB> Sub<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedSubAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer<T>>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: &'b Matrix<T, R2, C2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<'a, T, D1, D2, SB> Sub<Matrix<T, D2, Const<1>, SB>> for &'a OPoint<T, D1>
where T: Scalar + ClosedSubAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, right: Vector<T, D2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<T, D1, D2, SB> Sub<Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>
where T: Scalar + ClosedSubAssign, ShapeConstraint: SameNumberOfRows<D1, D2, Representative = D1> + SameNumberOfColumns<U1, U1, Representative = U1>, D1: DimName, D2: Dim, SB: Storage<T, D2>, DefaultAllocator: Allocator<D1>,

Sourceยง

type Output = OPoint<T, D1>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, right: Vector<T, D2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<'a, T, R1, C1, R2, C2, SA, SB> Sub<Matrix<T, R2, C2, SB>> for &'a Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedSubAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R2, C2, R1, C1>, ShapeConstraint: SameNumberOfRows<R2, R1> + SameNumberOfColumns<C2, C1>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R2, R1>>::Representative, <ShapeConstraint as SameNumberOfColumns<C2, C1>>::Representative>>::Buffer<T>>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<T, R1, C1, R2, C2, SA, SB> Sub<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedSubAssign, SA: Storage<T, R1, C1>, SB: Storage<T, R2, C2>, DefaultAllocator: SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

type Output = Matrix<T, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<<ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer<T>>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: Matrix<T, R2, C2, SB>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<'b, T, D1: DimName, D2: Dim, SB> SubAssign<&'b Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>

Sourceยง

fn sub_assign(&mut self, right: &'b Vector<T, D2, SB>)

Performs the -= operation. Read more
Sourceยง

impl<'b, T, R1, C1, R2, C2, SA, SB> SubAssign<&'b Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedSubAssign, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

fn sub_assign(&mut self, rhs: &'b Matrix<T, R2, C2, SB>)

Performs the -= operation. Read more
Sourceยง

impl<T, D1: DimName, D2: Dim, SB> SubAssign<Matrix<T, D2, Const<1>, SB>> for OPoint<T, D1>

Sourceยง

fn sub_assign(&mut self, right: Vector<T, D2, SB>)

Performs the -= operation. Read more
Sourceยง

impl<T, R1, C1, R2, C2, SA, SB> SubAssign<Matrix<T, R2, C2, SB>> for Matrix<T, R1, C1, SA>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T: Scalar + ClosedSubAssign, SA: StorageMut<T, R1, C1>, SB: Storage<T, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

fn sub_assign(&mut self, rhs: Matrix<T, R2, C2, SB>)

Performs the -= operation. Read more
Sourceยง

impl<T1, T2, R, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Isometry<T1, R, D>
where T1: RealField, T2: RealField + SupersetOf<T1>, R: AbstractRotation<T1, D> + SubsetOf<OMatrix<T1, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>> + SubsetOf<OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>>, Const<D>: DimNameAdd<U1> + DimMin<Const<D>, Output = Const<D>>, DefaultAllocator: Allocator<Const<D>, Const<1>, Buffer<T1> = ArrayStorage<T1, D, 1>> + Allocator<DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,

Sourceยง

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Rotation<T1, D>
where T1: RealField, T2: RealField + SupersetOf<T1>, Const<D>: DimNameAdd<U1> + DimMin<Const<D>, Output = Const<D>>, DefaultAllocator: Allocator<Const<D>, Const<D>, Buffer<T1> = ArrayStorage<T1, D, D>> + Allocator<DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,

Sourceยง

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Scale<T1, D>

Sourceยง

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, R, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Similarity<T1, R, D>
where T1: RealField, T2: RealField + SupersetOf<T1>, R: AbstractRotation<T1, D> + SubsetOf<OMatrix<T1, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>> + SubsetOf<OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>>, Const<D>: DimNameAdd<U1> + DimMin<Const<D>, Output = Const<D>>, DefaultAllocator: Allocator<Const<D>, Const<1>, Buffer<T1> = ArrayStorage<T1, D, 1>> + Allocator<DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,

Sourceยง

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, C, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Transform<T1, C, D>

Sourceยง

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, const D: usize> SubsetOf<Matrix<T2, <Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output, <DefaultAllocator as Allocator<<Const<D> as DimNameAdd<Const<1>>>::Output, <Const<D> as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for Translation<T1, D>
where T1: RealField, T2: RealField + SupersetOf<T1>, Const<D>: DimNameAdd<U1>, DefaultAllocator: Allocator<Const<D>, Buffer<T1> = ArrayStorage<T1, D, 1>> + Allocator<DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,

Sourceยง

fn to_superset( &self, ) -> OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked( m: &OMatrix<T2, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>, ) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, D> SubsetOf<Matrix<T2, <D as DimNameAdd<Const<1>>>::Output, Const<1>, <DefaultAllocator as Allocator<<D as DimNameAdd<Const<1>>>::Output>>::Buffer<T2>>> for OPoint<T1, D>

Sourceยง

fn to_superset(&self) -> OVector<T2, DimNameSum<D, U1>>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset(v: &OVector<T2, DimNameSum<D, U1>>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked(v: &OVector<T2, DimNameSum<D, U1>>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1: RealField, T2: RealField + SupersetOf<T1>> SubsetOf<Matrix<T2, Const<3>, Const<3>, ArrayStorage<T2, 3, 3>>> for UnitComplex<T1>

Sourceยง

fn to_superset(&self) -> Matrix3<T2>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset(m: &Matrix3<T2>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked(m: &Matrix3<T2>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1: RealField, T2: RealField + SupersetOf<T1>> SubsetOf<Matrix<T2, Const<4>, Const<4>, ArrayStorage<T2, 4, 4>>> for UnitDualQuaternion<T1>

Sourceยง

fn to_superset(&self) -> Matrix4<T2>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset(m: &Matrix4<T2>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked(m: &Matrix4<T2>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1: RealField, T2: RealField + SupersetOf<T1>> SubsetOf<Matrix<T2, Const<4>, Const<4>, ArrayStorage<T2, 4, 4>>> for UnitQuaternion<T1>

Sourceยง

fn to_superset(&self) -> Matrix4<T2>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset(m: &Matrix4<T2>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked(m: &Matrix4<T2>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<T1, T2, R1, C1, R2, C2> SubsetOf<Matrix<T2, R2, C2, <DefaultAllocator as Allocator<R2, C2>>::Buffer<T2>>> for OMatrix<T1, R1, C1>
where R1: Dim, C1: Dim, R2: Dim, C2: Dim, T1: Scalar, T2: Scalar + SupersetOf<T1>, DefaultAllocator: Allocator<R2, C2> + Allocator<R1, C1> + SameShapeAllocator<R1, C1, R2, C2>, ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,

Sourceยง

fn to_superset(&self) -> OMatrix<T2, R2, C2>

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

fn is_in_subset(m: &OMatrix<T2, R2, C2>) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Sourceยง

fn from_superset_unchecked(m: &OMatrix<T2, R2, C2>) -> Self

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Sourceยง

fn from_superset(element: &T) -> Option<Self>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

impl<'a, T, C: Dim> Sum<&'a Matrix<T, Dyn, C, <DefaultAllocator as Allocator<Dyn, C>>::Buffer<T>>> for OMatrix<T, Dyn, C>

Sourceยง

fn sum<I: Iterator<Item = &'a OMatrix<T, Dyn, C>>>( iter: I, ) -> OMatrix<T, Dyn, C>

ยงExample
let v = &DVector::repeat(3, 1.0f64);

assert_eq!(vec![v, v, v].into_iter().sum::<DVector<f64>>(),
           v + v + v);
ยงPanics

Panics if the iterator is empty:

โ“˜
iter::empty::<&DMatrix<f64>>().sum::<DMatrix<f64>>(); // panics!
Sourceยง

impl<'a, T, R: DimName, C: DimName> Sum<&'a Matrix<T, R, C, <DefaultAllocator as Allocator<R, C>>::Buffer<T>>> for OMatrix<T, R, C>

Sourceยง

fn sum<I: Iterator<Item = &'a OMatrix<T, R, C>>>(iter: I) -> OMatrix<T, R, C>

Takes an iterator and generates Self from the elements by โ€œsumming upโ€ the items.
Sourceยง

impl<T, R: Dim, C: Dim, S> UlpsEq for Matrix<T, R, C, S>
where T: Scalar + UlpsEq, S: RawStorage<T, R, C>, T::Epsilon: Clone,

Sourceยง

fn default_max_ulps() -> u32

The default ULPs to tolerate when testing values that are far-apart. Read more
Sourceยง

fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

A test for equality that uses units in the last place (ULP) if the values are far apart.
Sourceยง

fn ulps_ne(&self, other: &Rhs, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of UlpsEq::ulps_eq.
Sourceยง

impl<T, R: Dim, C: Dim, S> UpperExp for Matrix<T, R, C, S>
where T: Scalar + UpperExp, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T, R: Dim, C: Dim, S> UpperHex for Matrix<T, R, C, S>
where T: Scalar + UpperHex, S: RawStorage<T, R, C>,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T: Copy, R: Copy, C: Copy, S: Copy> Copy for Matrix<T, R, C, S>

Sourceยง

impl<T, R: Dim, C: Dim, S> Eq for Matrix<T, R, C, S>
where T: Eq, S: RawStorage<T, R, C>,

Auto Trait Implementationsยง

ยง

impl<T, R, C, S> Freeze for Matrix<T, R, C, S>
where S: Freeze,

ยง

impl<T, R, C, S> RefUnwindSafe for Matrix<T, R, C, S>

ยง

impl<T, R, C, S> Send for Matrix<T, R, C, S>
where S: Send, T: Send, R: Send, C: Send,

ยง

impl<T, R, C, S> Sync for Matrix<T, R, C, S>
where S: Sync, T: Sync, R: Sync, C: Sync,

ยง

impl<T, R, C, S> Unpin for Matrix<T, R, C, S>
where S: Unpin, T: Unpin, R: Unpin, C: Unpin,

ยง

impl<T, R, C, S> UnwindSafe for Matrix<T, R, C, S>

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

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

Sourceยง

impl<T> LowerBounded for T
where T: Bounded,

Sourceยง

fn min_value() -> T

Returns the smallest finite number this type can represent
Sourceยง

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Sourceยง

type Target = T

๐Ÿ”ฌThis is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Sourceยง

impl<R> Rng for R
where R: RngCore + ?Sized,

Sourceยง

fn random<T>(&mut self) -> T

Return a random value via the StandardUniform distribution. Read more
Sourceยง

fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>

Return an iterator over random variates Read more
Sourceยง

fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Sourceยง

fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
Sourceยง

fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being true. Read more
Sourceยง

fn sample<T, D>(&mut self, distr: D) -> T
where D: Distribution<T>,

Sample a new value, using the given distribution. Read more
Sourceยง

fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>
where D: Distribution<T>, Self: Sized,

Create an iterator that generates values using the given distribution. Read more
Sourceยง

fn fill<T>(&mut self, dest: &mut T)
where T: Fill + ?Sized,

Fill any type implementing Fill with random data Read more
Sourceยง

fn gen<T>(&mut self) -> T

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Alias for Rng::random.
Sourceยง

fn gen_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random_range
Sourceยง

fn gen_bool(&mut self, p: f64) -> bool

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random_bool
Alias for Rng::random_bool.
Sourceยง

fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random_ratio
Sourceยง

impl<T> RngCore for T
where T: DerefMut, <T as Deref>::Target: RngCore,

Sourceยง

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
Sourceยง

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
Sourceยง

fn fill_bytes(&mut self, dst: &mut [u8])

Fill dest with random data. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T> SimdPartialOrd for T
where T: SimdValue<Element = T, SimdBool = bool> + PartialOrd,

Sourceยง

fn simd_gt(self, other: T) -> <T as SimdValue>::SimdBool

Lanewise greater than > comparison.
Sourceยง

fn simd_lt(self, other: T) -> <T as SimdValue>::SimdBool

Lanewise less than < comparison.
Sourceยง

fn simd_ge(self, other: T) -> <T as SimdValue>::SimdBool

Lanewise greater or equal >= comparison.
Sourceยง

fn simd_le(self, other: T) -> <T as SimdValue>::SimdBool

Lanewise less or equal <= comparison.
Sourceยง

fn simd_eq(self, other: T) -> <T as SimdValue>::SimdBool

Lanewise equal == comparison.
Sourceยง

fn simd_ne(self, other: T) -> <T as SimdValue>::SimdBool

Lanewise not equal != comparison.
Sourceยง

fn simd_max(self, other: T) -> T

Lanewise max value.
Sourceยง

fn simd_min(self, other: T) -> T

Lanewise min value.
Sourceยง

fn simd_clamp(self, min: T, max: T) -> T

Clamps each lane of self between the corresponding lane of min and max.
Sourceยง

fn simd_horizontal_min(self) -> <T as SimdValue>::Element

The min value among all lanes of self.
Sourceยง

fn simd_horizontal_max(self) -> <T as SimdValue>::Element

The max value among all lanes of self.
Sourceยง

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Sourceยง

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Sourceยง

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Sourceยง

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Sourceยง

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<R> TryRngCore for R
where R: RngCore + ?Sized,

Sourceยง

type Error = Infallible

The type returned in the event of a RNG error.
Sourceยง

fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>

Return the next random u32.
Sourceยง

fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>

Return the next random u64.
Sourceยง

fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>

Fill dest entirely with random data.
Sourceยง

fn unwrap_err(self) -> UnwrapErr<Self>
where Self: Sized,

Wrap RNG with the UnwrapErr wrapper.
Sourceยง

fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>

Wrap RNG with the UnwrapMut wrapper.
Sourceยง

fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>
where Self: Sized,

Convert an RngCore to a RngReadAdapter.
Sourceยง

impl<T> UpperBounded for T
where T: Bounded,

Sourceยง

fn max_value() -> T

Returns the largest finite number this type can represent
Sourceยง

impl<T, Right> ClosedAdd<Right> for T
where T: Add<Right, Output = T> + AddAssign<Right>,

Sourceยง

impl<T, Right> ClosedAddAssign<Right> for T
where T: ClosedAdd<Right> + AddAssign<Right>,

Sourceยง

impl<T, Right> ClosedDiv<Right> for T
where T: Div<Right, Output = T> + DivAssign<Right>,

Sourceยง

impl<T, Right> ClosedDivAssign<Right> for T
where T: ClosedDiv<Right> + DivAssign<Right>,

Sourceยง

impl<T, Right> ClosedMul<Right> for T
where T: Mul<Right, Output = T> + MulAssign<Right>,

Sourceยง

impl<T, Right> ClosedMulAssign<Right> for T
where T: ClosedMul<Right> + MulAssign<Right>,

Sourceยง

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Sourceยง

impl<T, Right> ClosedSub<Right> for T
where T: Sub<Right, Output = T> + SubAssign<Right>,

Sourceยง

impl<T, Right> ClosedSubAssign<Right> for T
where T: ClosedSub<Right> + SubAssign<Right>,

Sourceยง

impl<T> CryptoRng for T
where T: DerefMut, <T as Deref>::Target: CryptoRng,

Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Sourceยง

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Sourceยง

impl<R> TryCryptoRng for R
where R: CryptoRng + ?Sized,