pub struct BasisPursuit;Expand description
Basis Pursuit via iterative shrinkage-thresholding (ISTA and FISTA).
Solves the LASSO problem: argmin_x 0.5 ||Ax - b||^2 + lambda ||x||_1.
FISTA adds Nesterov momentum for faster O(1/k²) convergence versus O(1/k) for plain ISTA.
Implementations§
Source§impl BasisPursuit
impl BasisPursuit
Sourcepub fn solve_lasso(
a: &[Vec<f64>],
b: &[f64],
lambda: f64,
max_iter: usize,
) -> Vec<f64>
pub fn solve_lasso( a: &[Vec<f64>], b: &[f64], lambda: f64, max_iter: usize, ) -> Vec<f64>
Solve the LASSO problem using ISTA.
a— measurement matrix (m × n, row-major)b— measurement vector (length m)lambda— sparsity regularisation weightmax_iter— maximum number of iterations
Returns the recovered sparse signal of length n.
Sourcepub fn solve_fista(
a: &[Vec<f64>],
b: &[f64],
lambda: f64,
max_iter: usize,
) -> Vec<f64>
pub fn solve_fista( a: &[Vec<f64>], b: &[f64], lambda: f64, max_iter: usize, ) -> Vec<f64>
Solve the LASSO problem using FISTA (Fast ISTA with Nesterov momentum).
a— measurement matrix (m × n, row-major)b— measurement vector (length m)lambda— sparsity regularisation weightmax_iter— maximum number of iterations
Returns the recovered sparse signal of length n.
Auto Trait Implementations§
impl Freeze for BasisPursuit
impl RefUnwindSafe for BasisPursuit
impl Send for BasisPursuit
impl Sync for BasisPursuit
impl Unpin for BasisPursuit
impl UnsafeUnpin for BasisPursuit
impl UnwindSafe for BasisPursuit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.