pub struct SparseSolver { /* private fields */ }Expand description
The one linear solver Carapace ships — a concrete struct, not a trait or enum, since there is exactly one implementation to commit to.
faer’s
sparse LU (with built-in COLAMD/AMD fill-reducing ordering), not a dense
nalgebra solve. A dense O(n^3) LU doesn’t scale to real models. It builds and
solves correctly under wasm32.
Implementations§
Source§impl SparseSolver
impl SparseSolver
pub fn new() -> Self
Sourcepub fn factor(
&self,
k: &SparseColMat<usize, f64>,
) -> Result<SparseFactorization, AnalysisError>
pub fn factor( &self, k: &SparseColMat<usize, f64>, ) -> Result<SparseFactorization, AnalysisError>
Factor k, without solving — the half of a solve that
TangentStrategy::ReuseAtStepStart/Initial (docs/algorithms.md
§3.1) let a caller skip repeating across iterations. faer‘s Lu
is a fully owned value (no lifetime tied back to k), so the result
outlives the matrix it was formed from — see SparseFactorization.
Symbolic analysis is reused while the full CSC pattern matches;
values (including zeros) never participate in cache invalidation.
Numeric factorization is always recomputed here, independently of
callers’ numeric tangent-reuse caches.
Sourcepub fn solve(
&self,
k: &SparseColMat<usize, f64>,
r: &DVector<f64>,
) -> Result<DVector<f64>, AnalysisError>
pub fn solve( &self, k: &SparseColMat<usize, f64>, r: &DVector<f64>, ) -> Result<DVector<f64>, AnalysisError>
Factor-then-solve in one call — for Algorithm::Linear and anywhere
else a single ad-hoc solve is enough. Equivalent to self.factor(k)? .solve(r), kept as its own method so a one-off caller doesn’t have
to name SparseFactorization just to discard it immediately.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SparseSolver
impl RefUnwindSafe for SparseSolver
impl Send for SparseSolver
impl Sync for SparseSolver
impl Unpin for SparseSolver
impl UnsafeUnpin for SparseSolver
impl UnwindSafe for SparseSolver
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
impl<T, U> Imply<T> for U
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.