pub trait SparseSymLinearSolverInterface {
// Required methods
fn initialize_structure(
&mut self,
dim: i32,
nonzeros: i32,
ia: &[i32],
ja: &[i32],
) -> ESymSolverStatus;
fn values_array_mut(&mut self) -> &mut [f64];
fn multi_solve(
&mut self,
new_matrix: bool,
ia: &[i32],
ja: &[i32],
nrhs: i32,
rhs_vals: &mut [f64],
check_neg_evals: bool,
number_of_neg_evals: i32,
) -> ESymSolverStatus;
fn number_of_neg_evals(&self) -> i32;
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,
_n_rows: i32,
_n_cols: i32,
_irn: &[i32],
_jcn: &[i32],
_vals: &[f64],
_c_deps: &mut Vec<i32>,
) -> ESymSolverStatus { ... }
fn factor_pattern(&self, _want_values: bool) -> Option<FactorPattern> { ... }
}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: i32,
nonzeros: i32,
ia: &[i32],
ja: &[i32],
) -> ESymSolverStatus
fn initialize_structure( &mut self, dim: i32, nonzeros: i32, ia: &[i32], ja: &[i32], ) -> ESymSolverStatus
Initialize backend internal structures for a matrix of given dimension and pattern.
Sourcefn values_array_mut(&mut self) -> &mut [f64]
fn values_array_mut(&mut self) -> &mut [f64]
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: &[i32],
ja: &[i32],
nrhs: i32,
rhs_vals: &mut [f64],
check_neg_evals: bool,
number_of_neg_evals: i32,
) -> ESymSolverStatus
fn multi_solve( &mut self, new_matrix: bool, ia: &[i32], ja: &[i32], nrhs: i32, rhs_vals: &mut [f64], check_neg_evals: bool, number_of_neg_evals: i32, ) -> 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) -> i32
fn number_of_neg_evals(&self) -> i32
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,
_n_rows: i32,
_n_cols: i32,
_irn: &[i32],
_jcn: &[i32],
_vals: &[f64],
_c_deps: &mut Vec<i32>,
) -> ESymSolverStatus
fn determine_dependent_rows( &mut self, _n_rows: i32, _n_cols: i32, _irn: &[i32], _jcn: &[i32], _vals: &[f64], _c_deps: &mut Vec<i32>, ) -> ESymSolverStatus
Find the linearly dependent rows of a constraint Jacobian J
(the Ipopt-style degeneracy probe). J is n_rows × n_cols,
supplied as a 1-based triplet (irn, jcn, vals); on
success c_deps is filled with the 0-based indices of a
set of rows whose removal leaves J full row rank (each
dropped row is a linear combination of the retained ones).
Callers must check Self::provides_degeneracy_detection
first. The default returns FatalError, matching upstream’s
“not supported” default; backends that implement this set
provides_degeneracy_detection() -> true.
Sourcefn factor_pattern(&self, _want_values: bool) -> Option<FactorPattern>
fn factor_pattern(&self, _want_values: bool) -> Option<FactorPattern>
Snapshot of the most recent factor’s L pattern and permutation.
Backends that expose their factor data structures (e.g. feral)
return Some(_); backends that don’t (e.g. MA57, which keeps
its factors inside opaque Fortran work arrays) return None.
Diagnostic-only — consumed by the --dump kkt:*+L path. Set
want_values=true to populate FactorPattern::l_vals.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".