Skip to main content

ADMMSolver

Struct ADMMSolver 

Source
pub struct ADMMSolver {
    pub rho: f64,
    pub max_iter: usize,
    pub tol: f64,
}
Expand description

ADMM solver for problems of the form: min f(x) + g(z) s.t. Ax + Bz = c.

Fields§

§rho: f64

Penalty parameter ρ > 0.

§max_iter: usize

Maximum iterations.

§tol: f64

Tolerance.

Implementations§

Source§

impl ADMMSolver

Source

pub fn new(rho: f64, max_iter: usize, tol: f64) -> Self

Create a new ADMM solver.

Source

pub fn lasso_convergence_rate(&self, lambda: f64, _n: usize) -> f64

ADMM for LASSO: min (1/2)||Ax-b||^2 + λ||x||_1. Simplified: returns the number of iterations to convergence estimate.

Source

pub fn dual_update(&self, y: f64, primal_residual: f64) -> f64

Dual update: y_{k+1} = y_k + ρ(Ax_{k+1} + Bz_{k+1} - c). Simplified for scalar: returns updated dual variable.

Source

pub fn stopping_criteria(&self, primal_res: f64, dual_res: f64) -> bool

Stopping criteria: primal and dual residuals. primal: ||Ax + Bz - c||, dual: ||ρA^T B(z - z_old)||.

Source

pub fn convergence_bound_at(&self, k: usize, _initial_gap: f64) -> f64

Convergence bound: ADMM converges at O(1/k) for general convex problems.

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.