pub trait SparseSymLinearSolverInterface {
// Required methods
fn initialize_structure(
&mut self,
dim: Index,
nonzeros: Index,
ia: &[Index],
ja: &[Index],
) -> ESymSolverStatus;
fn values_array_mut(&mut self) -> &mut [Number] ⓘ;
fn multi_solve(
&mut self,
new_matrix: bool,
ia: &[Index],
ja: &[Index],
nrhs: Index,
rhs_vals: &mut [Number],
check_neg_evals: bool,
number_of_neg_evals: Index,
) -> ESymSolverStatus;
fn number_of_neg_evals(&self) -> Index;
fn increase_quality(&mut self) -> bool;
fn provides_inertia(&self) -> bool;
fn matrix_format(&self) -> EMatrixFormat;
// Provided methods
fn provides_degeneracy_detection(&self) -> bool { ... }
fn determine_dependent_rows(
&mut self,
_ia: &[Index],
_ja: &[Index],
_c_deps: &mut Vec<Index>,
) -> ESymSolverStatus { ... }
}Expand description
Backend-side trait. The lifecycle mirrors upstream’s narrative
comment in IpSparseSymLinearSolverInterface.hpp:
- caller asks
Self::matrix_format. - caller calls
Self::initialize_structureonce with(ia, ja). - caller takes the values pointer from
Self::values_array_mut, fills it. - caller calls
Self::multi_solvewithnew_matrix=truefor each new value pattern. - caller may query
Self::number_of_neg_evals/Self::increase_qualitybetween solves.
new_matrix=false requests a back-substitution against the
existing factorization.
Required Methods§
Sourcefn initialize_structure(
&mut self,
dim: Index,
nonzeros: Index,
ia: &[Index],
ja: &[Index],
) -> ESymSolverStatus
fn initialize_structure( &mut self, dim: Index, nonzeros: Index, ia: &[Index], ja: &[Index], ) -> ESymSolverStatus
Initialize backend internal structures for a matrix of given dimension and pattern.
Sourcefn values_array_mut(&mut self) -> &mut [Number] ⓘ
fn values_array_mut(&mut self) -> &mut [Number] ⓘ
Slice into which the caller writes the matrix nonzeros (in the
same order as ja from Self::initialize_structure).
Sourcefn multi_solve(
&mut self,
new_matrix: bool,
ia: &[Index],
ja: &[Index],
nrhs: Index,
rhs_vals: &mut [Number],
check_neg_evals: bool,
number_of_neg_evals: Index,
) -> ESymSolverStatus
fn multi_solve( &mut self, new_matrix: bool, ia: &[Index], ja: &[Index], nrhs: Index, rhs_vals: &mut [Number], check_neg_evals: bool, number_of_neg_evals: Index, ) -> ESymSolverStatus
Factor (if new_matrix) and back-substitute against nrhs
right-hand sides packed in rhs_vals (length nrhs * dim).
Solutions overwrite rhs_vals.
Sourcefn number_of_neg_evals(&self) -> Index
fn number_of_neg_evals(&self) -> Index
Number of negative eigenvalues found in the most recent
factorization. Caller must check Self::provides_inertia
first.
Sourcefn increase_quality(&mut self) -> bool
fn increase_quality(&mut self) -> bool
Ask the backend to use a more accurate (but slower) pivot
strategy on the next solve. Returns false if the maximum
quality is already reached.
Sourcefn provides_inertia(&self) -> bool
fn provides_inertia(&self) -> bool
Whether this backend reports the number of negative eigenvalues post-factor.
Sourcefn matrix_format(&self) -> EMatrixFormat
fn matrix_format(&self) -> EMatrixFormat
Required matrix layout. Caller marshals data into this format.
Provided Methods§
Sourcefn provides_degeneracy_detection(&self) -> bool
fn provides_degeneracy_detection(&self) -> bool
Whether Self::determine_dependent_rows is supported.
Sourcefn determine_dependent_rows(
&mut self,
_ia: &[Index],
_ja: &[Index],
_c_deps: &mut Vec<Index>,
) -> ESymSolverStatus
fn determine_dependent_rows( &mut self, _ia: &[Index], _ja: &[Index], _c_deps: &mut Vec<Index>, ) -> ESymSolverStatus
Find linearly dependent rows — used by Ipopt’s degeneracy
probe. Default is FatalError matching upstream’s default
implementation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".