Skip to main content

Regularization

Struct Regularization 

Source
pub struct Regularization<T: Real = f64> {
    pub primal: T,
    pub dual: T,
    pub pivot_tol: Option<T>,
    pub bump: T,
    pub scale: ShiftScale,
}
Expand description

Regularization of a quasi-definite KKT matrix (Altman & Gondzio 1999; Algorithm K).

Fields§

§primal: T

ρ ≥ 0, added to the primal block (which becomes −D − ρI, in the units Regularization::scale says); ignored for the normal equations.

§dual: T

δ ≥ 0, added to the dual block (δI), or to the whole diagonal of the normal equations (A D Aᵀ + δI), in the units Regularization::scale says.

§pivot_tol: Option<T>

Below this magnitude (or with the wrong sign) a pivot of the equilibrated matrix is bumped to ±bump with the sign the inertia expects (dynamic regularization, step K3); None disables it.

§bump: T

The magnitude β > 0 of a bumped pivot (of the equilibrated matrix).

§scale: ShiftScale

Whether ρ, δ are taken in the equilibrated matrix (the default) or in K itself (step K2″).

Implementations§

Source§

impl<T: Real> Regularization<T>

Source

pub fn none() -> Self

No regularization at all: ρ = δ = 0, no bumping (the factorization then fails on a zero pivot, or with the wrong inertia).

Source

pub fn relative_to(k: &CscMatrix<T>, factor: T) -> Self

Absolute static shifts relative to the largest entry of k: ρ = δ = factor · max|k_ij| with ShiftScale::Absolute, and the dynamic part of Regularization::default (the L1.5 variant).

One shift for the whole matrix: at the end of an interior-point method, where max|k_ij| ≈ 10^{10}, factor = 10⁻⁸ gives δ ≈ 10², a large perturbation of the rows of small magnitude — refinement against the unregularized K then converges slowly (Chapter 5.14, “Choosing the regularization”). The default (ShiftScale::Equilibrated) is relative row by row instead.

Source

pub fn is_quasi_definite(&self) -> bool

ρ > 0 and δ > 0: the regularized augmented matrix is quasi-definite (it factorizes without pivoting, in any order).

Trait Implementations§

Source§

impl<T: Clone + Real> Clone for Regularization<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy + Real> Copy for Regularization<T>

Source§

impl<T: Debug + Real> Debug for Regularization<T>

Source§

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

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

impl<T: Real> Default for Regularization<T>

Source§

fn default() -> Self

ρ = 10⁻⁶, δ = 10⁻⁸ in the equilibrated matrix (ShiftScale::Equilibrated: relative to each row), and pivots of the wrong sign or of magnitude at most τ = 10⁻¹³ bumped to ±β = ±2·10⁻⁷. ρδ = 10⁻¹⁴, about 50 units of roundoff, keeps the regularized augmented matrix numerically quasi-definite; δ alone, small, is what the normal equations see (Chapter 5.14, “Choosing the regularization”, measured in L1.5b). τ, β are of the order of the defaults of current interior-point codes (Clarabel’s documented dynamic regularization; not tuned here).

Source§

impl<T: PartialEq + Real> PartialEq for Regularization<T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq + Real> StructuralPartialEq for Regularization<T>

Auto Trait Implementations§

§

impl<T> Forget for Regularization<T>

§

impl<T> Freeze for Regularization<T>
where T: Freeze, Option<T>: Freeze,

§

impl<T> RefUnwindSafe for Regularization<T>

§

impl<T> Send for Regularization<T>
where T: Send, Option<T>: Send,

§

impl<T> Sync for Regularization<T>
where T: Sync, Option<T>: Sync,

§

impl<T> Unpin for Regularization<T>
where T: Unpin, Option<T>: Unpin,

§

impl<T> UnsafeUnpin for Regularization<T>

§

impl<T> UnwindSafe for Regularization<T>

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> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.