Skip to main content

TSymLinearSolver

Struct TSymLinearSolver 

Source
pub struct TSymLinearSolver { /* private fields */ }
Expand description

Driver wrapping a SparseSymLinearSolverInterface (and optionally a TSymScalingMethod).

Implementations§

Source§

impl TSymLinearSolver

Source

pub fn new( backend: Box<dyn SparseSymLinearSolverInterface>, scaling_method: Option<Box<dyn TSymScalingMethod>>, linear_scaling_on_demand: bool, ) -> Self

Build a driver around backend. Pass Some(scaling) to enable symmetric scaling. linear_scaling_on_demand=true matches upstream’s default and keeps scaling off until Self::increase_quality turns it on.

Source

pub fn initialize_structure( &mut self, dim: Index, airn: &[Index], ajcn: &[Index], ) -> ESymSolverStatus

Pin the triplet sparsity pattern. Must be called once before the first Self::multi_solve. airn / ajcn are 1-based. Mirrors the bulk of TSymLinearSolver::InitializeStructure.

Source

pub fn multi_solve( &mut self, vals: &[Number], new_matrix: bool, nrhs: Index, rhs_vals: &mut [Number], check_neg_evals: bool, number_of_neg_evals: Index, ) -> ESymSolverStatus

Solve A x = b (or multiple RHS).

vals is the new triplet-format value array (length nonzeros_triplet). new_matrix=true requests a refactor (and a fresh scaling-factor computation if scaling is on); new_matrix=false reuses the existing factor and just runs back-substitution.

rhs_vals packs nrhs columns, each length dim, in column-major layout. Solutions overwrite rhs_vals.

Trait Implementations§

Source§

impl Debug for TSymLinearSolver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SymLinearSolver for TSymLinearSolver

Source§

fn increase_quality(&mut self) -> bool

Mirrors upstream’s IncreaseQuality: switching scaling on at the wrapper level (linear_scaling_on_demand=true path) takes precedence over asking the backend for tighter pivoting.

Source§

fn number_of_neg_evals(&self) -> Index

Most recent factorization’s negative-eigenvalue count.
Source§

fn provides_inertia(&self) -> bool

Whether this solver reports inertia.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.