pub struct Cholesky<N: Real, D: Dim>where
DefaultAllocator: Allocator<N, D, D>,{ /* private fields */ }
Expand description
The Cholesky decomposition of a symmetric-definite-positive matrix.
Implementations§
source§impl<N: Real, D: DimSub<Dynamic>> Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
impl<N: Real, D: DimSub<Dynamic>> Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
sourcepub fn new(matrix: MatrixN<N, D>) -> Option<Self>
pub fn new(matrix: MatrixN<N, D>) -> Option<Self>
Attempts to compute the Cholesky decomposition of 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.
sourcepub fn unpack(self) -> MatrixN<N, D>
pub fn unpack(self) -> MatrixN<N, D>
Retrieves the lower-triangular factor of the Cholesky decomposition with its strictly upper-triangular part filled with zeros.
sourcepub fn unpack_dirty(self) -> MatrixN<N, D>
pub fn unpack_dirty(self) -> MatrixN<N, D>
Retrieves the lower-triangular factor of the Cholesky decomposition, without zeroing-out its strict upper-triangular part.
The values of the strict upper-triangular part are garbage and should be ignored by further computations.
sourcepub fn l(&self) -> MatrixN<N, D>
pub fn l(&self) -> MatrixN<N, D>
Retrieves the lower-triangular factor of the Cholesky decomposition with its strictly uppen-triangular part filled with zeros.
sourcepub fn l_dirty(&self) -> &MatrixN<N, D>
pub fn l_dirty(&self) -> &MatrixN<N, D>
Retrieves the lower-triangular factor of the Cholesky decomposition, without zeroing-out its strict upper-triangular part.
This is an allocation-less version of self.l()
. The values of the strict upper-triangular
part are garbage and should be ignored by further computations.
sourcepub fn solve_mut<R2: Dim, C2: Dim, S2>(&self, b: &mut Matrix<N, R2, C2, S2>)where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
pub fn solve_mut<R2: Dim, C2: Dim, S2>(&self, b: &mut Matrix<N, R2, C2, S2>)where
S2: StorageMut<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
Solves the system self * x = b
where self
is the decomposed matrix and x
the unknown.
The result is stored on b
.
sourcepub fn solve<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<N, R2, C2, S2>
) -> MatrixMN<N, R2, C2>where
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
pub fn solve<R2: Dim, C2: Dim, S2>(
&self,
b: &Matrix<N, R2, C2, S2>
) -> MatrixMN<N, R2, C2>where
S2: StorageMut<N, R2, C2>,
DefaultAllocator: Allocator<N, R2, C2>,
ShapeConstraint: SameNumberOfRows<R2, D>,
Returns the solution of the system self * x = b
where self
is the decomposed matrix and
x
the unknown.
Trait Implementations§
source§impl<N: Clone + Real, D: Clone + Dim> Clone for Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
impl<N: Clone + Real, D: Clone + Dim> Clone for Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
source§impl<N: Debug + Real, D: Debug + Dim> Debug for Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
impl<N: Debug + Real, D: Debug + Dim> Debug for Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
impl<N: Real, D: Dim> Copy for Cholesky<N, D>where
DefaultAllocator: Allocator<N, D, D>,
MatrixN<N, D>: Copy,
Auto Trait Implementations§
impl<N, D> !RefUnwindSafe for Cholesky<N, D>
impl<N, D> !Send for Cholesky<N, D>
impl<N, D> !Sync for Cholesky<N, D>
impl<N, D> !Unpin for Cholesky<N, D>
impl<N, D> !UnwindSafe for Cholesky<N, D>
Blanket Implementations§
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.