pub struct SparseMode;Expand description
Sparse linear algebra mode.
Uses SparseColMat<usize, f64> for Jacobians and Hessians.
Optimal for large-scale problems with sparse structure (e.g., pose graphs).
Trait Implementations§
Source§impl AssemblyBackend for SparseMode
impl AssemblyBackend for SparseMode
Source§fn assemble(
problem: &Problem,
variables: &HashMap<String, VariableEnum>,
variable_index_map: &HashMap<String, usize>,
symbolic_structure: Option<&SymbolicStructure>,
_total_dof: usize,
) -> LinearizerResult<(Mat<f64>, SparseColMat<usize, f64>)>
fn assemble( problem: &Problem, variables: &HashMap<String, VariableEnum>, variable_index_map: &HashMap<String, usize>, symbolic_structure: Option<&SymbolicStructure>, _total_dof: usize, ) -> LinearizerResult<(Mat<f64>, SparseColMat<usize, f64>)>
Assemble residuals and Jacobian from the problem.
Source§fn compute_column_norms(jacobian: &SparseColMat<usize, f64>) -> Vec<f64>
fn compute_column_norms(jacobian: &SparseColMat<usize, f64>) -> Vec<f64>
Compute column norms of the Jacobian (for Jacobi scaling).
Source§fn apply_column_scaling(
jacobian: &SparseColMat<usize, f64>,
scaling: &[f64],
) -> SparseColMat<usize, f64>
fn apply_column_scaling( jacobian: &SparseColMat<usize, f64>, scaling: &[f64], ) -> SparseColMat<usize, f64>
Apply diagonal column scaling to the Jacobian.
Returns a new Jacobian with columns scaled by
1 / (1 + norm).Source§fn apply_inverse_scaling(step: &Mat<f64>, scaling: &[f64]) -> Mat<f64>
fn apply_inverse_scaling(step: &Mat<f64>, scaling: &[f64]) -> Mat<f64>
Apply inverse scaling to a step vector: step_i *= scaling_i
Source§fn hessian_vec_product(
hessian: &SparseColMat<usize, f64>,
vec: &Mat<f64>,
) -> Mat<f64>
fn hessian_vec_product( hessian: &SparseColMat<usize, f64>, vec: &Mat<f64>, ) -> Mat<f64>
Hessian-vector product: H * v (needed by DogLeg for Cauchy point)
Source§impl LinearSolver<SparseMode> for IterativeSchurSolver
impl LinearSolver<SparseMode> for IterativeSchurSolver
Source§fn solve_normal_equation(
&mut self,
residuals: &Mat<f64>,
jacobian: &SparseColMat<usize, f64>,
) -> LinAlgResult<Mat<f64>>
fn solve_normal_equation( &mut self, residuals: &Mat<f64>, jacobian: &SparseColMat<usize, f64>, ) -> LinAlgResult<Mat<f64>>
Solve the normal equations: (J^T · J) · dx = −J^T · r
Source§fn solve_augmented_equation(
&mut self,
residuals: &Mat<f64>,
jacobian: &SparseColMat<usize, f64>,
lambda: f64,
) -> LinAlgResult<Mat<f64>>
fn solve_augmented_equation( &mut self, residuals: &Mat<f64>, jacobian: &SparseColMat<usize, f64>, lambda: f64, ) -> LinAlgResult<Mat<f64>>
Solve the augmented equations: (J^T · J + λI) · dx = −J^T · r
Source§fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
Get the cached Hessian matrix (J^T · J) from the last solve
Source§fn get_gradient(&self) -> Option<&Mat<f64>>
fn get_gradient(&self) -> Option<&Mat<f64>>
Get the cached gradient vector (J^T · r) from the last solve
Source§impl LinearSolver<SparseMode> for SparseCholeskySolver
impl LinearSolver<SparseMode> for SparseCholeskySolver
Source§fn solve_normal_equation(
&mut self,
residuals: &Mat<f64>,
jacobians: &SparseColMat<usize, f64>,
) -> LinAlgResult<Mat<f64>>
fn solve_normal_equation( &mut self, residuals: &Mat<f64>, jacobians: &SparseColMat<usize, f64>, ) -> LinAlgResult<Mat<f64>>
Solve the normal equations: (J^T · J) · dx = −J^T · r
Source§fn solve_augmented_equation(
&mut self,
residuals: &Mat<f64>,
jacobians: &SparseColMat<usize, f64>,
lambda: f64,
) -> LinAlgResult<Mat<f64>>
fn solve_augmented_equation( &mut self, residuals: &Mat<f64>, jacobians: &SparseColMat<usize, f64>, lambda: f64, ) -> LinAlgResult<Mat<f64>>
Solve the augmented equations: (J^T · J + λI) · dx = −J^T · r
Source§fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
Get the cached Hessian matrix (J^T · J) from the last solve
Source§fn get_gradient(&self) -> Option<&Mat<f64>>
fn get_gradient(&self) -> Option<&Mat<f64>>
Get the cached gradient vector (J^T · r) from the last solve
Source§impl LinearSolver<SparseMode> for SparseQRSolver
impl LinearSolver<SparseMode> for SparseQRSolver
Source§fn solve_normal_equation(
&mut self,
residuals: &Mat<f64>,
jacobians: &SparseColMat<usize, f64>,
) -> LinAlgResult<Mat<f64>>
fn solve_normal_equation( &mut self, residuals: &Mat<f64>, jacobians: &SparseColMat<usize, f64>, ) -> LinAlgResult<Mat<f64>>
Solve the normal equations: (J^T · J) · dx = −J^T · r
Source§fn solve_augmented_equation(
&mut self,
residuals: &Mat<f64>,
jacobians: &SparseColMat<usize, f64>,
lambda: f64,
) -> LinAlgResult<Mat<f64>>
fn solve_augmented_equation( &mut self, residuals: &Mat<f64>, jacobians: &SparseColMat<usize, f64>, lambda: f64, ) -> LinAlgResult<Mat<f64>>
Solve the augmented equations: (J^T · J + λI) · dx = −J^T · r
Source§fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
Get the cached Hessian matrix (J^T · J) from the last solve
Source§fn get_gradient(&self) -> Option<&Mat<f64>>
fn get_gradient(&self) -> Option<&Mat<f64>>
Get the cached gradient vector (J^T · r) from the last solve
Source§impl LinearSolver<SparseMode> for SparseSchurComplementSolver
impl LinearSolver<SparseMode> for SparseSchurComplementSolver
Source§fn solve_normal_equation(
&mut self,
residuals: &Mat<f64>,
jacobian: &SparseColMat<usize, f64>,
) -> LinAlgResult<Mat<f64>>
fn solve_normal_equation( &mut self, residuals: &Mat<f64>, jacobian: &SparseColMat<usize, f64>, ) -> LinAlgResult<Mat<f64>>
Solve the normal equations: (J^T · J) · dx = −J^T · r
Source§fn solve_augmented_equation(
&mut self,
residuals: &Mat<f64>,
jacobian: &SparseColMat<usize, f64>,
lambda: f64,
) -> LinAlgResult<Mat<f64>>
fn solve_augmented_equation( &mut self, residuals: &Mat<f64>, jacobian: &SparseColMat<usize, f64>, lambda: f64, ) -> LinAlgResult<Mat<f64>>
Solve the augmented equations: (J^T · J + λI) · dx = −J^T · r
Source§fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
fn get_hessian(&self) -> Option<&SparseColMat<usize, f64>>
Get the cached Hessian matrix (J^T · J) from the last solve
Source§fn get_gradient(&self) -> Option<&Mat<f64>>
fn get_gradient(&self) -> Option<&Mat<f64>>
Get the cached gradient vector (J^T · r) from the last solve
Auto Trait Implementations§
impl Freeze for SparseMode
impl RefUnwindSafe for SparseMode
impl Send for SparseMode
impl Sync for SparseMode
impl Unpin for SparseMode
impl UnsafeUnpin for SparseMode
impl UnwindSafe for SparseMode
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
Mutably borrows from an owned value. Read more
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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<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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.