pub struct RandomMeasurementMatrix {
pub m: usize,
pub n: usize,
pub matrix: Vec<Vec<f64>>,
}Expand description
A random Gaussian measurement matrix for compressed sensing.
Each row is an independent Gaussian random vector; m << n enables
sub-Nyquist recovery of sparse signals.
Fields§
§m: usizeNumber of measurements (rows).
n: usizeSignal length (columns).
matrix: Vec<Vec<f64>>Underlying matrix entries stored row-major.
Implementations§
Source§impl RandomMeasurementMatrix
impl RandomMeasurementMatrix
Sourcepub fn generate_gaussian(m: usize, n: usize) -> Self
pub fn generate_gaussian(m: usize, n: usize) -> Self
Generate an m × n Gaussian measurement matrix (entries ~ N(0, 1/m)).
The columns are scaled by 1/sqrt(m) so that each measurement
approximately preserves the signal energy.
Sourcepub fn generate_bernoulli(m: usize, n: usize) -> Self
pub fn generate_bernoulli(m: usize, n: usize) -> Self
Generate an m × n Bernoulli ±1/sqrt(m) measurement matrix.
Each entry is independently ±1/sqrt(m) with equal probability 1/2.
Auto Trait Implementations§
impl Freeze for RandomMeasurementMatrix
impl RefUnwindSafe for RandomMeasurementMatrix
impl Send for RandomMeasurementMatrix
impl Sync for RandomMeasurementMatrix
impl Unpin for RandomMeasurementMatrix
impl UnsafeUnpin for RandomMeasurementMatrix
impl UnwindSafe for RandomMeasurementMatrix
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.