pub trait SampleRange<A: Scalar> {
// Required method
fn sample_range_by_rank<R: Rng>(
&self,
k: usize,
p: usize,
rng: &mut R,
) -> Result<Array2<A>>;
}
Expand description
Randomly sample the range of an operator
Let $A\in\mathbb{C}{m\times n}$ be a matrix. To sample the range of rank $k$ one can multiply $A$ by a Gaussian random matrix $\Omega$ of dimension $n\times k + p$, where $p$ is a small oversampling parameter. The result of this product is post-processed by a pivoted QR decomposition and the first $k$ columns of the $Q$ matrix in the pivoted QR decomposition returned.
Required Methods§
Sourcefn sample_range_by_rank<R: Rng>(
&self,
k: usize,
p: usize,
rng: &mut R,
) -> Result<Array2<A>>
fn sample_range_by_rank<R: Rng>( &self, k: usize, p: usize, rng: &mut R, ) -> Result<Array2<A>>
Randomly sample the range of an operator. Return an approximate orthogonal basis of the dominant range.
§Arguments
k
: The target rank of the basis for the range.p
: Oversampling parameter.p
should be chosen small. A typical size is p=5.rng
: The random number generator.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.