#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub enum KaczmarzVariantExt {
Classical,
Randomized,
Block,
Greedy,
REK,
}
impl Default for KaczmarzVariantExt {
fn default() -> Self {
Self::Randomized
}
}
#[derive(Debug, Clone)]
pub struct KaczmarzConfigExt {
pub max_iter: usize,
pub tol: f64,
pub variant: KaczmarzVariantExt,
pub block_size: usize,
pub seed: u64,
pub relaxation: f64,
}
impl Default for KaczmarzConfigExt {
fn default() -> Self {
Self {
max_iter: 10_000,
tol: 1e-6,
variant: KaczmarzVariantExt::Randomized,
block_size: 32,
seed: 42,
relaxation: 1.0,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub enum SketchTypeExt {
Gaussian,
SRHT,
CountSketch,
OSNAP,
SparseJL,
}
impl Default for SketchTypeExt {
fn default() -> Self {
Self::Gaussian
}
}
#[derive(Debug, Clone)]
pub struct SketchConfig {
pub sketch_type: SketchTypeExt,
pub sketch_size: usize,
pub seed: u64,
pub max_iter: usize,
pub tol: f64,
pub sparse_jl_sparsity: usize,
pub osnap_blocks: usize,
}
impl Default for SketchConfig {
fn default() -> Self {
Self {
sketch_type: SketchTypeExt::Gaussian,
sketch_size: 128,
seed: 42,
max_iter: 100,
tol: 1e-6,
sparse_jl_sparsity: 0,
osnap_blocks: 0,
}
}
}
#[derive(Debug, Clone)]
pub struct ProjectionResult {
pub solution: Vec<f64>,
pub residual_norm: f64,
pub iterations: usize,
pub converged: bool,
}