Type Definition nalgebra::core::SquareMatrix
[−]
[src]
type SquareMatrix<N, D, S> = Matrix<N, D, D, S>;
A square matrix.
Methods
impl<N: Scalar, D: Dim, S: Storage<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn diagonal(&self) -> VectorN<N, D> where
DefaultAllocator: Allocator<N, D>,
[src]
DefaultAllocator: Allocator<N, D>,
Creates a square matrix with its diagonal set to diag
and all other entries set to 0.
pub fn trace(&self) -> N where
N: Ring,
[src]
N: Ring,
Computes a trace of a square matrix, i.e., the sum of its diagonal elements.
impl<N: Real, D: Dim, S: Storage<N, D, D>> SquareMatrix<N, D, S> where
DefaultAllocator: Allocator<N, D, D>,
[src]
DefaultAllocator: Allocator<N, D, D>,
pub fn is_special_orthogonal(&self, eps: N) -> bool where
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<(usize, usize), D>,
[src]
D: DimMin<D, Output = D>,
DefaultAllocator: Allocator<(usize, usize), D>,
Checks that this matrix is orthogonal and has a determinant equal to 1.
pub fn is_invertible(&self) -> bool
[src]
Returns true
if this matrix is invertible.
impl<N: Scalar + Field, D: DimName, S: Storage<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn append_scaling(&self, scaling: N) -> MatrixN<N, D> where
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D, D>,
[src]
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to self
followed by an uniform scaling factor.
pub fn prepend_scaling(&self, scaling: N) -> MatrixN<N, D> where
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D, D>,
[src]
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to an uniform scaling factor followed by self
.
pub fn append_nonuniform_scaling<SB>(
&self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D>,
[src]
&self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to self
followed by a non-uniform scaling factor.
pub fn prepend_nonuniform_scaling<SB>(
&self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D>,
[src]
&self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to a non-uniform scaling factor followed by self
.
pub fn append_translation<SB>(
&self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D>,
[src]
&self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D>,
Computes the transformation equal to self
followed by a translation.
pub fn prepend_translation<SB>(
&self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, DimNameDiff<D, U1>>,
[src]
&self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) -> MatrixN<N, D> where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, D> + Allocator<N, DimNameDiff<D, U1>>,
Computes the transformation equal to a translation followed by self
.
impl<N: Scalar + Field, D: DimName, S: StorageMut<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn append_scaling_mut(&mut self, scaling: N) where
D: DimNameSub<U1>,
[src]
D: DimNameSub<U1>,
Computes in-place the transformation equal to self
followed by an uniform scaling factor.
pub fn prepend_scaling_mut(&mut self, scaling: N) where
D: DimNameSub<U1>,
[src]
D: DimNameSub<U1>,
Computes in-place the transformation equal to an uniform scaling factor followed by self
.
pub fn append_nonuniform_scaling_mut<SB>(
&mut self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
[src]
&mut self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
Computes in-place the transformation equal to self
followed by a non-uniform scaling factor.
pub fn prepend_nonuniform_scaling_mut<SB>(
&mut self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
[src]
&mut self,
scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
Computes in-place the transformation equal to a non-uniform scaling factor followed by self
.
pub fn append_translation_mut<SB>(
&mut self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
[src]
&mut self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
Computes the transformation equal to self
followed by a translation.
pub fn prepend_translation_mut<SB>(
&mut self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>,
[src]
&mut self,
shift: &Vector<N, DimNameDiff<D, U1>, SB>
) where
D: DimNameSub<U1>,
SB: Storage<N, DimNameDiff<D, U1>>,
DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>,
Computes the transformation equal to a translation followed by self
.
impl<N: Real, D: Dim, S: Storage<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn solve_lower_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
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 concidered not-zero.
pub fn solve_upper_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
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 concidered not-zero.
pub fn solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, 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 concidered not-zero.
pub fn solve_lower_triangular_with_diag_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>,
diag: N
) -> bool where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &mut Matrix<N, R2, C2, S2>,
diag: N
) -> bool where
S2: StorageMut<N, 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 concidered 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.
pub fn solve_upper_triangular_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, 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 concidered not-zero.
pub fn tr_solve_lower_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
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 concidered not-zero.
pub fn tr_solve_upper_triangular<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &Matrix<N, R2, C2, S2>
) -> Option<MatrixMN<N, R2, C2>> where
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 concidered not-zero.
pub fn tr_solve_lower_triangular_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, 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 concidered not-zero.
pub fn tr_solve_upper_triangular_mut<R2: Dim, C2: Dim, S2>(
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
[src]
&self,
b: &mut Matrix<N, R2, C2, S2>
) -> bool where
S2: StorageMut<N, 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 concidered not-zero.
impl<N: Real, D: DimMin<D, Output = D>, S: Storage<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn determinant(&self) -> N where
DefaultAllocator: Allocator<N, D, D> + Allocator<(usize, usize), D>,
[src]
DefaultAllocator: Allocator<N, D, D> + Allocator<(usize, usize), D>,
Computes the matrix determinant.
If the matrix has a dimension larger than 3, an LU decomposition is used.
impl<N: Real, D: Dim, S: Storage<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn try_inverse(self) -> Option<MatrixN<N, D>> where
DefaultAllocator: Allocator<N, D, D>,
[src]
DefaultAllocator: Allocator<N, D, D>,
Attempts to invert this matrix.
impl<N: Real, D: Dim, S: StorageMut<N, D, D>> SquareMatrix<N, D, S>
[src]
pub fn try_inverse_mut(&mut self) -> bool where
DefaultAllocator: Allocator<N, D, D>,
[src]
DefaultAllocator: Allocator<N, D, D>,
Attempts to invert this matrix in-place. Returns false
and leaves self
untouched if
inversion fails.
impl<N: Real, D: DimSub<U1>, S: Storage<N, D, D>> SquareMatrix<N, D, S> where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D> + Allocator<N, DimDiff<D, U1>>,
[src]
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D> + Allocator<N, DimDiff<D, U1>>,
pub fn hessenberg(self) -> Hessenberg<N, D>
[src]
Computes the Hessenberg decomposition of this matrix using householder reflections.
impl<N: Real, D: DimSub<U1>, S: Storage<N, D, D>> SquareMatrix<N, D, S> where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, DimDiff<D, U1>>,
[src]
DefaultAllocator: Allocator<N, D, D> + Allocator<N, DimDiff<D, U1>>,
pub fn symmetric_tridiagonalize(self) -> SymmetricTridiagonal<N, D>
[src]
Computes the tridiagonalization of this symmetric matrix.
Only the lower-triangular part (including the diagonal) of m
is read.
impl<N: Real, D: DimSub<Dynamic>, S: Storage<N, D, D>> SquareMatrix<N, D, S> where
DefaultAllocator: Allocator<N, D, D>,
[src]
DefaultAllocator: Allocator<N, D, D>,
pub fn cholesky(self) -> Option<Cholesky<N, D>>
[src]
Attempts to compute the Cholesky decomposition of this matrix.
Returns None
if the input matrix is not definite-positive. The intput matrix is assumed
to be symmetric and only the lower-triangular part is read.
impl<N: Real, D: Dim, S: Storage<N, D, D>> SquareMatrix<N, D, S> where
D: DimSub<U1>,
ShapeConstraint: DimEq<Dynamic, DimDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, DimDiff<D, U1>> + Allocator<N, DimDiff<D, U1>> + Allocator<N, D, D> + Allocator<N, D>,
[src]
D: DimSub<U1>,
ShapeConstraint: DimEq<Dynamic, DimDiff<D, U1>>,
DefaultAllocator: Allocator<N, D, DimDiff<D, U1>> + Allocator<N, DimDiff<D, U1>> + Allocator<N, D, D> + Allocator<N, D>,
pub fn real_schur(self) -> RealSchur<N, D>
[src]
Computes the Schur decomposition of a square matrix.
pub fn try_real_schur(self, eps: N, max_niter: usize) -> Option<RealSchur<N, D>>
[src]
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
− tolerence 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. Ifniter == 0
, then the algorithm continues indefinitely until convergence.
pub fn eigenvalues(&self) -> Option<VectorN<N, D>>
[src]
Computes the eigenvalues of this matrix.
pub fn complex_eigenvalues(&self) -> VectorN<Complex<N>, D> where
DefaultAllocator: Allocator<Complex<N>, D>,
[src]
DefaultAllocator: Allocator<Complex<N>, D>,
Computes the eigenvalues of this matrix.
impl<N: Real, D: DimSub<U1>, S: Storage<N, D, D>> SquareMatrix<N, D, S> where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D> + Allocator<N, DimDiff<D, U1>>,
[src]
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D> + Allocator<N, DimDiff<D, U1>>,
pub fn symmetric_eigen(self) -> SymmetricEigen<N, D>
[src]
Computes the eigendecomposition of this symmetric matrix.
Only the lower-triangular part (including the diagonal) of m
is read.
pub fn try_symmetric_eigen(
self,
eps: N,
max_niter: usize
) -> Option<SymmetricEigen<N, D>>
[src]
self,
eps: N,
max_niter: usize
) -> Option<SymmetricEigen<N, 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. Ifniter == 0
, then the algorithm continues indefinitely until convergence.
pub fn symmetric_eigenvalues(&self) -> VectorN<N, D>
[src]
Computes the eigenvalues of this symmetric matrix.
Only the lower-triangular part of the matrix is read.