pub struct IDENTITY { /* private fields */ }Methods from Deref<Target = Matrix4<f32>>§
Sourcepub fn imax(&self) -> usize
pub fn imax(&self) -> usize
Computes the index of the vector component with the largest value.
§Examples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.imax(), 2);Sourcepub fn iamax(&self) -> usize
pub fn iamax(&self) -> usize
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);Sourcepub fn imin(&self) -> usize
pub fn imin(&self) -> usize
Computes the index of the vector component with the smallest value.
§Examples:
let vec = Vector3::new(11, -15, 13);
assert_eq!(vec.imin(), 1);Sourcepub fn iamin(&self) -> usize
pub fn iamin(&self) -> usize
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);Sourcepub fn iamax_full(&self) -> (usize, usize)
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));Sourcepub fn dot<R2, C2, SB>(&self, rhs: &Matrix<N, R2, C2, SB>) -> N
pub fn dot<R2, C2, SB>(&self, rhs: &Matrix<N, R2, C2, SB>) -> N
The dot product between two vectors or matrices (seen as vectors).
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.
§Examples:
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);Sourcepub fn tr_dot<R2, C2, SB>(&self, rhs: &Matrix<N, R2, C2, SB>) -> N
pub fn tr_dot<R2, C2, SB>(&self, rhs: &Matrix<N, R2, C2, SB>) -> N
The dot product between the transpose of self and rhs.
§Examples:
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);Sourcepub fn add_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, R3, C3>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2> + SameNumberOfRows<R1, R3> + SameNumberOfColumns<C1, C3>,
pub fn add_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, 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.
Sourcepub fn sub_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, R3, C3>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2> + SameNumberOfRows<R1, R3> + SameNumberOfColumns<C1, C3>,
pub fn sub_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, 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.
Sourcepub fn tr_mul<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, C1, C2, <DefaultAllocator as Allocator<N, C1, C2>>::Buffer>where
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: Allocator<N, C1, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
pub fn tr_mul<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, C1, C2, <DefaultAllocator as Allocator<N, C1, C2>>::Buffer>where
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: Allocator<N, C1, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2>,
Equivalent to self.transpose() * rhs.
Sourcepub fn tr_mul_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, R3, C3>,
ShapeConstraint: SameNumberOfRows<R1, R2> + DimEq<C1, R3> + DimEq<C2, C3>,
pub fn tr_mul_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, 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.
Sourcepub fn mul_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, R3, C3>,
ShapeConstraint: SameNumberOfRows<R3, R1> + SameNumberOfColumns<C3, C2> + AreMultipliable<R1, C1, R2, C2>,
pub fn mul_to<R2, C2, SB, R3, C3, SC>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
out: &mut Matrix<N, R3, C3, SC>,
)where
R2: Dim,
C2: Dim,
R3: Dim,
C3: Dim,
SB: Storage<N, R2, C2>,
SC: StorageMut<N, 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.
Sourcepub fn kronecker<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <R1 as DimMul<R2>>::Output, <C1 as DimMul<C2>>::Output, <DefaultAllocator as Allocator<N, <R1 as DimMul<R2>>::Output, <C1 as DimMul<C2>>::Output>>::Buffer>
pub fn kronecker<R2, C2, SB>( &self, rhs: &Matrix<N, R2, C2, SB>, ) -> Matrix<N, <R1 as DimMul<R2>>::Output, <C1 as DimMul<C2>>::Output, <DefaultAllocator as Allocator<N, <R1 as DimMul<R2>>::Output, <C1 as DimMul<C2>>::Output>>::Buffer>
The kronecker product of two matrices (aka. tensor product of the corresponding linear maps).
Sourcepub fn add_scalar(
&self,
rhs: N,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
pub fn add_scalar(
&self,
rhs: N,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
Adds a scalar to self.
Sourcepub fn amax(&self) -> N
pub fn amax(&self) -> N
Returns the absolute value of the coefficient with the largest absolute value.
Sourcepub fn amin(&self) -> N
pub fn amin(&self) -> N
Returns the absolute value of the coefficient with the smallest absolute value.
Sourcepub fn append_scaling(
&self,
scaling: N,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>
pub fn append_scaling( &self, scaling: N, ) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>
Computes the transformation equal to self followed by an uniform scaling factor.
Sourcepub fn prepend_scaling(
&self,
scaling: N,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>
pub fn prepend_scaling( &self, scaling: N, ) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>
Computes the transformation equal to an uniform scaling factor followed by self.
Sourcepub fn append_nonuniform_scaling<SB>(
&self,
scaling: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D>,
pub fn append_nonuniform_scaling<SB>(
&self,
scaling: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to self followed by a non-uniform scaling factor.
Sourcepub fn prepend_nonuniform_scaling<SB>(
&self,
scaling: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D>,
pub fn prepend_nonuniform_scaling<SB>(
&self,
scaling: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to a non-uniform scaling factor followed by self.
Sourcepub fn append_translation<SB>(
&self,
shift: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D>,
pub fn append_translation<SB>(
&self,
shift: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to self followed by a translation.
Sourcepub fn prepend_translation<SB>(
&self,
shift: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, <D as DimNameSub<U1>>::Output>,
pub fn prepend_translation<SB>(
&self,
shift: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, SB>,
) -> Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>where
D: DimNameSub<U1>,
SB: Storage<N, <D as DimNameSub<U1>>::Output>,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, <D as DimNameSub<U1>>::Output>,
Computes the transformation equal to a translation followed by self.
Sourcepub fn transform_vector(
&self,
v: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimNameSub<U1>>::Output>>::Buffer>,
) -> Matrix<N, <D as DimNameSub<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimNameSub<U1>>::Output>>::Buffer>
pub fn transform_vector( &self, v: &Matrix<N, <D as DimNameSub<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimNameSub<U1>>::Output>>::Buffer>, ) -> Matrix<N, <D as DimNameSub<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimNameSub<U1>>::Output>>::Buffer>
Transforms the given vector, assuming the matrix self uses homogeneous coordinates.
Sourcepub fn transform_point(
&self,
pt: &Point<N, <D as DimNameSub<U1>>::Output>,
) -> Point<N, <D as DimNameSub<U1>>::Output>
pub fn transform_point( &self, pt: &Point<N, <D as DimNameSub<U1>>::Output>, ) -> Point<N, <D as DimNameSub<U1>>::Output>
Transforms the given point, assuming the matrix self uses homogeneous coordinates.
Sourcepub fn abs(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>
pub fn abs( &self, ) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>
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))Sourcepub fn component_mul<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>where
N: ClosedMul,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,
pub fn component_mul<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>where
N: ClosedMul,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: SameShapeAllocator<N, 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);Sourcepub fn component_div<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>where
N: ClosedDiv,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: SameShapeAllocator<N, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,
pub fn component_div<R2, C2, SB>(
&self,
rhs: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R1, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C1, C2>>::Representative>>::Buffer>where
N: ClosedDiv,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: SameShapeAllocator<N, 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);Sourcepub fn upper_triangle(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
pub fn upper_triangle(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
Extracts the upper triangular part of this matrix (including the diagonal).
Sourcepub fn lower_triangle(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
pub fn lower_triangle(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
Extracts the upper triangular part of this matrix (including the diagonal).
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The total number of elements of this matrix.
§Examples:
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.len(), 12);Sourcepub fn shape(&self) -> (usize, usize)
pub fn shape(&self) -> (usize, usize)
The shape of this matrix returned as the tuple (number of rows, number of columns).
§Examples:
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.shape(), (3, 4));Sourcepub fn nrows(&self) -> usize
pub fn nrows(&self) -> usize
The number of rows of this matrix.
§Examples:
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.nrows(), 3);Sourcepub fn ncols(&self) -> usize
pub fn ncols(&self) -> usize
The number of columns of this matrix.
§Examples:
let mat = Matrix3x4::<f32>::zeros();
assert_eq!(mat.ncols(), 4);Sourcepub fn strides(&self) -> (usize, usize)
pub fn strides(&self) -> (usize, usize)
The strides (row stride, column stride) of this matrix.
§Examples:
let mat = DMatrix::<f32>::zeros(10, 10);
let slice = mat.slice_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));Sourcepub fn iter(&self) -> MatrixIter<'_, N, R, C, S>
pub fn iter(&self) -> MatrixIter<'_, N, R, C, S>
Iterates through this matrix coordinates in column-major order.
§Examples:
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());Sourcepub fn vector_to_matrix_index(&self, i: usize) -> (usize, usize)
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.
Sourcepub unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N
pub unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N
Gets a reference to the element of this matrix at row irow and column icol without
bound-checking.
Sourcepub fn relative_eq<R2, C2, SB>(
&self,
other: &Matrix<N, R2, C2, SB>,
eps: <N as AbsDiffEq>::Epsilon,
max_relative: <N as AbsDiffEq>::Epsilon,
) -> boolwhere
N: RelativeEq,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
<N as AbsDiffEq>::Epsilon: Copy,
ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,
pub fn relative_eq<R2, C2, SB>(
&self,
other: &Matrix<N, R2, C2, SB>,
eps: <N as AbsDiffEq>::Epsilon,
max_relative: <N as AbsDiffEq>::Epsilon,
) -> boolwhere
N: RelativeEq,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
<N as AbsDiffEq>::Epsilon: Copy,
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.
Sourcepub fn eq<R2, C2, SB>(&self, other: &Matrix<N, R2, C2, SB>) -> boolwhere
N: PartialEq,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,
pub fn eq<R2, C2, SB>(&self, other: &Matrix<N, R2, C2, SB>) -> boolwhere
N: PartialEq,
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,
Tests whether self and rhs are exactly equal.
Sourcepub fn clone_owned(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
pub fn clone_owned(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
Clones this matrix to one that owns its data.
Sourcepub fn clone_owned_sum<R2, C2>(
&self,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative>>::Buffer>where
R2: Dim,
C2: Dim,
DefaultAllocator: SameShapeAllocator<N, R, C, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,
pub fn clone_owned_sum<R2, C2>(
&self,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative>>::Buffer>where
R2: Dim,
C2: Dim,
DefaultAllocator: SameShapeAllocator<N, 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.
Sourcepub fn map<N2, F>(
&self,
f: F,
) -> Matrix<N2, R, C, <DefaultAllocator as Allocator<N2, R, C>>::Buffer>
pub fn map<N2, F>( &self, f: F, ) -> Matrix<N2, R, C, <DefaultAllocator as Allocator<N2, R, C>>::Buffer>
Returns a matrix containing the result of f applied to each of its entries.
Sourcepub fn map_with_location<N2, F>(
&self,
f: F,
) -> Matrix<N2, R, C, <DefaultAllocator as Allocator<N2, R, C>>::Buffer>
pub fn map_with_location<N2, F>( &self, f: F, ) -> Matrix<N2, R, C, <DefaultAllocator as Allocator<N2, R, C>>::Buffer>
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(value, row, col).
Sourcepub fn zip_map<N2, N3, S2, F>(
&self,
rhs: &Matrix<N2, R, C, S2>,
f: F,
) -> Matrix<N3, R, C, <DefaultAllocator as Allocator<N3, R, C>>::Buffer>
pub fn zip_map<N2, N3, S2, F>( &self, rhs: &Matrix<N2, R, C, S2>, f: F, ) -> Matrix<N3, R, C, <DefaultAllocator as Allocator<N3, R, C>>::Buffer>
Returns a matrix containing the result of f applied to each entries of self and
rhs.
Sourcepub fn zip_zip_map<N2, N3, N4, S2, S3, F>(
&self,
b: &Matrix<N2, R, C, S2>,
c: &Matrix<N3, R, C, S3>,
f: F,
) -> Matrix<N4, R, C, <DefaultAllocator as Allocator<N4, R, C>>::Buffer>
pub fn zip_zip_map<N2, N3, N4, S2, S3, F>( &self, b: &Matrix<N2, R, C, S2>, c: &Matrix<N3, R, C, S3>, f: F, ) -> Matrix<N4, R, C, <DefaultAllocator as Allocator<N4, R, C>>::Buffer>
Returns a matrix containing the result of f applied to each entries of self and
b, and c.
Sourcepub fn transpose_to<R2, C2, SB>(&self, out: &mut Matrix<N, R2, C2, SB>)where
R2: Dim,
C2: Dim,
SB: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,
pub fn transpose_to<R2, C2, SB>(&self, out: &mut Matrix<N, R2, C2, SB>)where
R2: Dim,
C2: Dim,
SB: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,
Transposes self and store the result into out.
Sourcepub fn transpose(
&self,
) -> Matrix<N, C, R, <DefaultAllocator as Allocator<N, C, R>>::Buffer>where
DefaultAllocator: Allocator<N, C, R>,
pub fn transpose(
&self,
) -> Matrix<N, C, R, <DefaultAllocator as Allocator<N, C, R>>::Buffer>where
DefaultAllocator: Allocator<N, C, R>,
Transposes self.
Sourcepub unsafe fn vget_unchecked(&self, i: usize) -> &N
pub unsafe fn vget_unchecked(&self, i: usize) -> &N
Gets a reference to the i-th element of this column vector without bound checking.
Sourcepub fn as_slice(&self) -> &[N]
pub fn as_slice(&self) -> &[N]
Extracts a slice containing the entire matrix entries ordered column-by-columns.
Sourcepub fn conjugate_transpose_to<R2, C2, SB>(
&self,
out: &mut Matrix<Complex<N>, R2, C2, SB>,
)where
R2: Dim,
C2: Dim,
SB: StorageMut<Complex<N>, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,
pub fn conjugate_transpose_to<R2, C2, SB>(
&self,
out: &mut Matrix<Complex<N>, R2, C2, SB>,
)where
R2: Dim,
C2: Dim,
SB: StorageMut<Complex<N>, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, C2> + SameNumberOfColumns<C, R2>,
Takes the conjugate and transposes self and store the result into out.
Sourcepub fn conjugate_transpose(
&self,
) -> Matrix<Complex<N>, C, R, <DefaultAllocator as Allocator<Complex<N>, C, R>>::Buffer>
pub fn conjugate_transpose( &self, ) -> Matrix<Complex<N>, C, R, <DefaultAllocator as Allocator<Complex<N>, C, R>>::Buffer>
The conjugate transposition of self.
Sourcepub fn diagonal(
&self,
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>where
DefaultAllocator: Allocator<N, D>,
pub fn diagonal(
&self,
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>where
DefaultAllocator: Allocator<N, D>,
Creates a square matrix with its diagonal set to diag and all other entries set to 0.
Sourcepub fn trace(&self) -> Nwhere
N: Ring,
pub fn trace(&self) -> Nwhere
N: Ring,
Computes a trace of a square matrix, i.e., the sum of its diagonal elements.
Sourcepub fn to_homogeneous(
&self,
) -> Matrix<N, <D as DimAdd<U1>>::Output, <D as DimAdd<U1>>::Output, <DefaultAllocator as Allocator<N, <D as DimAdd<U1>>::Output, <D as DimAdd<U1>>::Output>>::Buffer>
pub fn to_homogeneous( &self, ) -> Matrix<N, <D as DimAdd<U1>>::Output, <D as DimAdd<U1>>::Output, <DefaultAllocator as Allocator<N, <D as DimAdd<U1>>::Output, <D as DimAdd<U1>>::Output>>::Buffer>
Yields the homogeneous matrix for this matrix, i.e., appending an additional dimension and
and setting the diagonal element to 1.
Sourcepub fn to_homogeneous(
&self,
) -> Matrix<N, <D as DimAdd<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimAdd<U1>>::Output>>::Buffer>
pub fn to_homogeneous( &self, ) -> Matrix<N, <D as DimAdd<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimAdd<U1>>::Output>>::Buffer>
Computes the coordinates in projective space of this vector, i.e., appends a 0 to its
coordinates.
Sourcepub fn perp<R2, C2, SB>(&self, b: &Matrix<N, R2, C2, SB>) -> Nwhere
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, U2> + SameNumberOfColumns<C, U1> + SameNumberOfRows<R2, U2> + SameNumberOfColumns<C2, U1>,
pub fn perp<R2, C2, SB>(&self, b: &Matrix<N, R2, C2, SB>) -> Nwhere
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, U2> + SameNumberOfColumns<C, U1> + SameNumberOfRows<R2, U2> + SameNumberOfColumns<C2, U1>,
The perpendicular product between two 2D column vectors, i.e. a.x * b.y - a.y * b.x.
Sourcepub fn cross<R2, C2, SB>(
&self,
b: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative>>::Buffer>where
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: SameShapeAllocator<N, R, C, R2, C2>,
ShapeConstraint: SameNumberOfRows<R, R2> + SameNumberOfColumns<C, C2>,
pub fn cross<R2, C2, SB>(
&self,
b: &Matrix<N, R2, C2, SB>,
) -> Matrix<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative, <DefaultAllocator as Allocator<N, <ShapeConstraint as SameNumberOfRows<R, R2>>::Representative, <ShapeConstraint as SameNumberOfColumns<C, C2>>::Representative>>::Buffer>where
R2: Dim,
C2: Dim,
SB: Storage<N, R2, C2>,
DefaultAllocator: SameShapeAllocator<N, 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.
Sourcepub fn cross_matrix(
&self,
) -> Matrix<N, U3, U3, <DefaultAllocator as Allocator<N, U3, U3>>::Buffer>
pub fn cross_matrix( &self, ) -> Matrix<N, U3, U3, <DefaultAllocator as Allocator<N, U3, U3>>::Buffer>
Computes the matrix M such that for all vector v we have M * v == self.cross(&v).
Sourcepub fn angle<R2, C2, SB>(&self, other: &Matrix<N, R2, C2, SB>) -> N
pub fn angle<R2, C2, SB>(&self, other: &Matrix<N, R2, C2, SB>) -> N
The smallest angle between two vectors.
Sourcepub fn norm_squared(&self) -> N
pub fn norm_squared(&self) -> N
The squared L2 norm of this vector.
Sourcepub fn magnitude(&self) -> N
pub fn magnitude(&self) -> N
A synonym for the norm of this matrix.
Aka the length.
This function is simply implemented as a call to norm()
Sourcepub fn magnitude_squared(&self) -> N
pub fn magnitude_squared(&self) -> N
A synonym for the squared norm of this matrix.
Aka the squared length.
This function is simply implemented as a call to norm_squared()
Sourcepub fn normalize(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
pub fn normalize(
&self,
) -> Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>where
DefaultAllocator: Allocator<N, R, C>,
Returns a normalized version of this matrix.
Sourcepub fn try_normalize(
&self,
min_norm: N,
) -> Option<Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>>where
DefaultAllocator: Allocator<N, R, C>,
pub fn try_normalize(
&self,
min_norm: N,
) -> Option<Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>>where
DefaultAllocator: Allocator<N, R, C>,
Returns a normalized version of this matrix unless its norm as smaller or equal to eps.
Sourcepub fn lerp<S2>(
&self,
rhs: &Matrix<N, D, U1, S2>,
t: N,
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
pub fn lerp<S2>( &self, rhs: &Matrix<N, D, U1, S2>, t: N, ) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
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));Sourcepub fn row(
&self,
i: usize,
) -> Matrix<N, U1, C, SliceStorage<'_, N, U1, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn row( &self, i: usize, ) -> Matrix<N, U1, C, SliceStorage<'_, N, U1, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Returns a slice containing the i-th row of this matrix.
Sourcepub fn row_part(
&self,
i: usize,
n: usize,
) -> Matrix<N, U1, Dynamic, SliceStorage<'_, N, U1, Dynamic, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn row_part( &self, i: usize, n: usize, ) -> Matrix<N, U1, Dynamic, SliceStorage<'_, N, U1, Dynamic, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Returns a slice containing the n first elements of the i-th row of this matrix.
Sourcepub fn rows(
&self,
first_row: usize,
nrows: usize,
) -> Matrix<N, Dynamic, C, SliceStorage<'_, N, Dynamic, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn rows( &self, first_row: usize, nrows: usize, ) -> Matrix<N, Dynamic, C, SliceStorage<'_, N, Dynamic, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Extracts from this matrix a set of consecutive rows.
Sourcepub fn rows_with_step(
&self,
first_row: usize,
nrows: usize,
step: usize,
) -> Matrix<N, Dynamic, C, SliceStorage<'_, N, Dynamic, C, Dynamic, <S as Storage<N, R, C>>::CStride>>
pub fn rows_with_step( &self, first_row: usize, nrows: usize, step: usize, ) -> Matrix<N, Dynamic, C, SliceStorage<'_, N, Dynamic, C, Dynamic, <S as Storage<N, R, C>>::CStride>>
Extracts from this matrix a set of consecutive rows regularly skipping step rows.
Sourcepub fn fixed_rows<RSlice>(
&self,
first_row: usize,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RSlice: DimName,
pub fn fixed_rows<RSlice>(
&self,
first_row: usize,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RSlice: DimName,
Extracts a compile-time number of consecutive rows from this matrix.
Sourcepub fn fixed_rows_with_step<RSlice>(
&self,
first_row: usize,
step: usize,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, Dynamic, <S as Storage<N, R, C>>::CStride>>where
RSlice: DimName,
pub fn fixed_rows_with_step<RSlice>(
&self,
first_row: usize,
step: usize,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, Dynamic, <S as Storage<N, R, C>>::CStride>>where
RSlice: DimName,
Extracts from this matrix a compile-time number of rows regularly skipping step
rows.
Sourcepub fn rows_generic<RSlice>(
&self,
row_start: usize,
nrows: RSlice,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RSlice: Dim,
pub fn rows_generic<RSlice>(
&self,
row_start: usize,
nrows: RSlice,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RSlice: Dim,
Extracts from this matrix nrows rows regularly skipping step rows. Both
argument may or may not be values known at compile-time.
Sourcepub fn rows_generic_with_step<RSlice>(
&self,
row_start: usize,
nrows: RSlice,
step: usize,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, Dynamic, <S as Storage<N, R, C>>::CStride>>where
RSlice: Dim,
pub fn rows_generic_with_step<RSlice>(
&self,
row_start: usize,
nrows: RSlice,
step: usize,
) -> Matrix<N, RSlice, C, SliceStorage<'_, N, RSlice, C, Dynamic, <S as Storage<N, R, C>>::CStride>>where
RSlice: Dim,
Extracts from this matrix nrows rows regularly skipping step rows. Both
argument may or may not be values known at compile-time.
Sourcepub fn column(
&self,
i: usize,
) -> Matrix<N, R, U1, SliceStorage<'_, N, R, U1, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn column( &self, i: usize, ) -> Matrix<N, R, U1, SliceStorage<'_, N, R, U1, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Returns a slice containing the i-th column of this matrix.
Sourcepub fn column_part(
&self,
i: usize,
n: usize,
) -> Matrix<N, Dynamic, U1, SliceStorage<'_, N, Dynamic, U1, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn column_part( &self, i: usize, n: usize, ) -> Matrix<N, Dynamic, U1, SliceStorage<'_, N, Dynamic, U1, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Returns a slice containing the n first elements of the i-th column of this matrix.
Sourcepub fn columns(
&self,
first_col: usize,
ncols: usize,
) -> Matrix<N, R, Dynamic, SliceStorage<'_, N, R, Dynamic, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn columns( &self, first_col: usize, ncols: usize, ) -> Matrix<N, R, Dynamic, SliceStorage<'_, N, R, Dynamic, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Extracts from this matrix a set of consecutive columns.
Sourcepub fn columns_with_step(
&self,
first_col: usize,
ncols: usize,
step: usize,
) -> Matrix<N, R, Dynamic, SliceStorage<'_, N, R, Dynamic, <S as Storage<N, R, C>>::RStride, Dynamic>>
pub fn columns_with_step( &self, first_col: usize, ncols: usize, step: usize, ) -> Matrix<N, R, Dynamic, SliceStorage<'_, N, R, Dynamic, <S as Storage<N, R, C>>::RStride, Dynamic>>
Extracts from this matrix a set of consecutive columns regularly skipping step
columns.
Sourcepub fn fixed_columns<CSlice>(
&self,
first_col: usize,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
CSlice: DimName,
pub fn fixed_columns<CSlice>(
&self,
first_col: usize,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
CSlice: DimName,
Extracts a compile-time number of consecutive columns from this matrix.
Sourcepub fn fixed_columns_with_step<CSlice>(
&self,
first_col: usize,
step: usize,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, Dynamic>>where
CSlice: DimName,
pub fn fixed_columns_with_step<CSlice>(
&self,
first_col: usize,
step: usize,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, Dynamic>>where
CSlice: DimName,
Extracts from this matrix a compile-time number of columns regularly skipping
step columns.
Sourcepub fn columns_generic<CSlice>(
&self,
first_col: usize,
ncols: CSlice,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
CSlice: Dim,
pub fn columns_generic<CSlice>(
&self,
first_col: usize,
ncols: CSlice,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
CSlice: Dim,
Extracts from this matrix ncols columns. The number of columns may or may not be
known at compile-time.
Sourcepub fn columns_generic_with_step<CSlice>(
&self,
first_col: usize,
ncols: CSlice,
step: usize,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, Dynamic>>where
CSlice: Dim,
pub fn columns_generic_with_step<CSlice>(
&self,
first_col: usize,
ncols: CSlice,
step: usize,
) -> Matrix<N, R, CSlice, SliceStorage<'_, N, R, CSlice, <S as Storage<N, R, C>>::RStride, Dynamic>>where
CSlice: Dim,
Extracts from this matrix ncols columns skipping step columns. Both argument may
or may not be values known at compile-time.
Sourcepub fn slice(
&self,
start: (usize, usize),
shape: (usize, usize),
) -> Matrix<N, Dynamic, Dynamic, SliceStorage<'_, N, Dynamic, Dynamic, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn slice( &self, start: (usize, usize), shape: (usize, usize), ) -> Matrix<N, Dynamic, Dynamic, SliceStorage<'_, N, Dynamic, Dynamic, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Slices this matrix starting at its component (irow, icol) and with (nrows, ncols)
consecutive elements.
Sourcepub fn slice_with_steps(
&self,
start: (usize, usize),
shape: (usize, usize),
steps: (usize, usize),
) -> Matrix<N, Dynamic, Dynamic, SliceStorage<'_, N, Dynamic, Dynamic, Dynamic, Dynamic>>
pub fn slice_with_steps( &self, start: (usize, usize), shape: (usize, usize), steps: (usize, usize), ) -> Matrix<N, Dynamic, Dynamic, SliceStorage<'_, N, Dynamic, Dynamic, Dynamic, Dynamic>>
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.
Sourcepub fn fixed_slice<RSlice, CSlice>(
&self,
irow: usize,
icol: usize,
) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn fixed_slice<RSlice, CSlice>( &self, irow: usize, icol: usize, ) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Slices this matrix starting at its component (irow, icol) and with (R::dim(), CSlice::dim()) consecutive components.
Sourcepub fn fixed_slice_with_steps<RSlice, CSlice>(
&self,
start: (usize, usize),
steps: (usize, usize),
) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, Dynamic, Dynamic>>
pub fn fixed_slice_with_steps<RSlice, CSlice>( &self, start: (usize, usize), steps: (usize, usize), ) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, Dynamic, Dynamic>>
Slices this matrix starting at its component (start.0, start.1) and with
(R::dim(), CSlice::dim()) 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.
Sourcepub fn generic_slice<RSlice, CSlice>(
&self,
start: (usize, usize),
shape: (RSlice, CSlice),
) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
pub fn generic_slice<RSlice, CSlice>( &self, start: (usize, usize), shape: (RSlice, CSlice), ) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>
Creates a slice that may or may not have a fixed size and stride.
Sourcepub fn generic_slice_with_steps<RSlice, CSlice>(
&self,
start: (usize, usize),
shape: (RSlice, CSlice),
steps: (usize, usize),
) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, Dynamic, Dynamic>>
pub fn generic_slice_with_steps<RSlice, CSlice>( &self, start: (usize, usize), shape: (RSlice, CSlice), steps: (usize, usize), ) -> Matrix<N, RSlice, CSlice, SliceStorage<'_, N, RSlice, CSlice, Dynamic, Dynamic>>
Creates a slice that may or may not have a fixed size and stride.
Sourcepub fn rows_range_pair<Range1, Range2>(
&self,
r1: Range1,
r2: Range2,
) -> (Matrix<N, <Range1 as SliceRange<R>>::Size, C, SliceStorage<'_, N, <Range1 as SliceRange<R>>::Size, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>, Matrix<N, <Range2 as SliceRange<R>>::Size, C, SliceStorage<'_, N, <Range2 as SliceRange<R>>::Size, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>)where
Range1: SliceRange<R>,
Range2: SliceRange<R>,
pub fn rows_range_pair<Range1, Range2>(
&self,
r1: Range1,
r2: Range2,
) -> (Matrix<N, <Range1 as SliceRange<R>>::Size, C, SliceStorage<'_, N, <Range1 as SliceRange<R>>::Size, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>, Matrix<N, <Range2 as SliceRange<R>>::Size, C, SliceStorage<'_, N, <Range2 as SliceRange<R>>::Size, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>)where
Range1: SliceRange<R>,
Range2: SliceRange<R>,
Splits this NxM matrix into two parts delimited by two ranges.
Panics if the ranges overlap or if the first range is empty.
Sourcepub fn columns_range_pair<Range1, Range2>(
&self,
r1: Range1,
r2: Range2,
) -> (Matrix<N, R, <Range1 as SliceRange<C>>::Size, SliceStorage<'_, N, R, <Range1 as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>, Matrix<N, R, <Range2 as SliceRange<C>>::Size, SliceStorage<'_, N, R, <Range2 as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>)where
Range1: SliceRange<C>,
Range2: SliceRange<C>,
pub fn columns_range_pair<Range1, Range2>(
&self,
r1: Range1,
r2: Range2,
) -> (Matrix<N, R, <Range1 as SliceRange<C>>::Size, SliceStorage<'_, N, R, <Range1 as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>, Matrix<N, R, <Range2 as SliceRange<C>>::Size, SliceStorage<'_, N, R, <Range2 as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>)where
Range1: SliceRange<C>,
Range2: SliceRange<C>,
Splits this NxM matrix into two parts delimited by two ranges.
Panics if the ranges overlap or if the first range is empty.
Sourcepub fn slice_range<RowRange, ColRange>(
&self,
rows: RowRange,
cols: ColRange,
) -> Matrix<N, <RowRange as SliceRange<R>>::Size, <ColRange as SliceRange<C>>::Size, SliceStorage<'_, N, <RowRange as SliceRange<R>>::Size, <ColRange as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RowRange: SliceRange<R>,
ColRange: SliceRange<C>,
pub fn slice_range<RowRange, ColRange>(
&self,
rows: RowRange,
cols: ColRange,
) -> Matrix<N, <RowRange as SliceRange<R>>::Size, <ColRange as SliceRange<C>>::Size, SliceStorage<'_, N, <RowRange as SliceRange<R>>::Size, <ColRange as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RowRange: SliceRange<R>,
ColRange: SliceRange<C>,
Slices a sub-matrix containing the rows indexed by the range rows and the columns indexed
by the range cols.
Sourcepub fn rows_range<RowRange>(
&self,
rows: RowRange,
) -> Matrix<N, <RowRange as SliceRange<R>>::Size, C, SliceStorage<'_, N, <RowRange as SliceRange<R>>::Size, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RowRange: SliceRange<R>,
pub fn rows_range<RowRange>(
&self,
rows: RowRange,
) -> Matrix<N, <RowRange as SliceRange<R>>::Size, C, SliceStorage<'_, N, <RowRange as SliceRange<R>>::Size, C, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
RowRange: SliceRange<R>,
Slice containing all the rows indexed by the range rows.
Sourcepub fn columns_range<ColRange>(
&self,
cols: ColRange,
) -> Matrix<N, R, <ColRange as SliceRange<C>>::Size, SliceStorage<'_, N, R, <ColRange as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
ColRange: SliceRange<C>,
pub fn columns_range<ColRange>(
&self,
cols: ColRange,
) -> Matrix<N, R, <ColRange as SliceRange<C>>::Size, SliceStorage<'_, N, R, <ColRange as SliceRange<C>>::Size, <S as Storage<N, R, C>>::RStride, <S as Storage<N, R, C>>::CStride>>where
ColRange: SliceRange<C>,
Slice containing all the columns indexed by the range rows.
Sourcepub fn is_identity(&self, eps: <N as AbsDiffEq>::Epsilon) -> bool
pub fn is_identity(&self, eps: <N as AbsDiffEq>::Epsilon) -> bool
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.
Sourcepub fn is_orthogonal(&self, eps: <N as AbsDiffEq>::Epsilon) -> bool
pub fn is_orthogonal(&self, eps: <N as AbsDiffEq>::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.
Sourcepub fn is_special_orthogonal(&self, eps: N) -> bool
pub fn is_special_orthogonal(&self, eps: N) -> bool
Checks that this matrix is orthogonal and has a determinant equal to 1.
Sourcepub fn is_invertible(&self) -> bool
pub fn is_invertible(&self) -> bool
Returns true if this matrix is invertible.
Sourcepub fn xx(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn xx( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xxx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xxx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xy(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn xy( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yx(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn yx( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yy(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn yy( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xxy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xxy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xyx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xyx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xyy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xyy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yxx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yxx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yxy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yxy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yyx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yyx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yyy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yyy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xz(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn xz( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yz(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn yz( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zx(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn zx( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zy(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn zy( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zz(
&self,
) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
pub fn zz( &self, ) -> Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xxz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xxz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xyz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xyz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xzx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xzx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xzy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xzy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn xzz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn xzz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yxz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yxz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yyz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yyz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yzx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yzx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yzy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yzy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn yzz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn yzz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zxx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zxx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zxy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zxy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zxz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zxz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zyx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zyx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zyy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zyy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zyz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zyz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zzx(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zzx( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zzy(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zzy( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn zzz(
&self,
) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
pub fn zzz( &self, ) -> Matrix<N, U3, U1, <DefaultAllocator as Allocator<N, U3>>::Buffer>
Builds a new vector from components of self.
Sourcepub fn determinant(&self) -> N
pub fn determinant(&self) -> N
Computes the matrix determinant.
If the matrix has a dimension larger than 3, an LU decomposition is used.
Sourcepub fn eigenvalues(
&self,
) -> Option<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>>
pub fn eigenvalues( &self, ) -> Option<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>>
Computes the eigenvalues of this matrix.
Sourcepub fn complex_eigenvalues(
&self,
) -> Matrix<Complex<N>, D, U1, <DefaultAllocator as Allocator<Complex<N>, D>>::Buffer>
pub fn complex_eigenvalues( &self, ) -> Matrix<Complex<N>, D, U1, <DefaultAllocator as Allocator<Complex<N>, D>>::Buffer>
Computes the eigenvalues of this matrix.
Sourcepub fn solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
pub fn solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, 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.
Sourcepub fn solve_upper_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
pub fn solve_upper_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, 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.
Sourcepub fn solve_lower_triangular_mut<R2, C2, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>,
) -> bool
pub fn solve_lower_triangular_mut<R2, C2, S2>( &self, b: &mut Matrix<N, R2, C2, S2>, ) -> bool
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.
Sourcepub fn solve_lower_triangular_with_diag_mut<R2, C2, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>,
diag: N,
) -> bool
pub fn solve_lower_triangular_with_diag_mut<R2, C2, S2>( &self, b: &mut Matrix<N, R2, C2, S2>, diag: N, ) -> bool
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.
Sourcepub fn solve_upper_triangular_mut<R2, C2, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>,
) -> bool
pub fn solve_upper_triangular_mut<R2, C2, S2>( &self, b: &mut Matrix<N, R2, C2, S2>, ) -> bool
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.
Sourcepub fn tr_solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
pub fn tr_solve_lower_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, 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.
Sourcepub fn tr_solve_upper_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
pub fn tr_solve_upper_triangular<R2, C2, S2>(
&self,
b: &Matrix<N, R2, C2, S2>,
) -> Option<Matrix<N, R2, C2, <DefaultAllocator as Allocator<N, R2, C2>>::Buffer>>where
R2: Dim,
C2: Dim,
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, 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.
Sourcepub fn tr_solve_lower_triangular_mut<R2, C2, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>,
) -> bool
pub fn tr_solve_lower_triangular_mut<R2, C2, S2>( &self, b: &mut Matrix<N, R2, C2, S2>, ) -> bool
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.
Sourcepub fn tr_solve_upper_triangular_mut<R2, C2, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>,
) -> bool
pub fn tr_solve_upper_triangular_mut<R2, C2, S2>( &self, b: &mut Matrix<N, R2, C2, S2>, ) -> bool
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.
Sourcepub fn singular_values(
&self,
) -> Matrix<N, <R as DimMin<C>>::Output, U1, <DefaultAllocator as Allocator<N, <R as DimMin<C>>::Output>>::Buffer>
pub fn singular_values( &self, ) -> Matrix<N, <R as DimMin<C>>::Output, U1, <DefaultAllocator as Allocator<N, <R as DimMin<C>>::Output>>::Buffer>
Computes the singular values of this matrix.
Sourcepub fn rank(&self, eps: N) -> usize
pub fn rank(&self, eps: N) -> usize
Computes the rank of this matrix.
All singular values below eps are considered equal to 0.
Sourcepub fn symmetric_eigenvalues(
&self,
) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
pub fn symmetric_eigenvalues( &self, ) -> Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
Computes the eigenvalues of this symmetric matrix.
Only the lower-triangular part of the matrix is read.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IDENTITY
impl RefUnwindSafe for IDENTITY
impl Send for IDENTITY
impl Sync for IDENTITY
impl Unpin for IDENTITY
impl UnwindSafe for IDENTITY
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.