Trait AdaptiveSampling

Source
pub trait AdaptiveSampling<A: Scalar> {
    // Required method
    fn sample_range_adaptive<R: Rng>(
        &self,
        rel_tol: f64,
        sample_size: usize,
        rng: &mut R,
    ) -> Result<(Array2<A>, Vec<(usize, f64)>)>;
}
Expand description

This trait defines the adaptive sampling of the range of an operator.

Required Methods§

Source

fn sample_range_adaptive<R: Rng>( &self, rel_tol: f64, sample_size: usize, rng: &mut R, ) -> Result<(Array2<A>, Vec<(usize, f64)>)>

Adaptively randomly sample the range of an operator up to a given tolerance.

§Arguments
  • rel_tol: The relative error tolerance. The error is checked probabilistically.
  • sample_size: Number of samples drawn together in each iteration.
  • rng: The random number generator.

Returns a tuple (q, residuals), where q is an ndarray containing the orthogonalized columns of the range, and residuals is a vector of tuples of the form (rank, rel_res), where rel_res is the estimated relative residual for the first rank columns of q.

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.

Implementors§