Skip to main content

BatchedBlockSolver

Trait BatchedBlockSolver 

Source
pub trait BatchedBlockSolver {
    // Required methods
    fn factor_blocks(
        &self,
        rows: &[ArrowRowBlock],
        ridge_t: f64,
        d: usize,
        evidence_factorization: bool,
    ) -> Result<ArrowFactorSlab, ArrowSchurError>;
    fn solve_block_vector(
        &self,
        factor: ArrayView2<'_, f64>,
        rhs: ArrayView1<'_, f64>,
    ) -> Array1<f64>;
    fn solve_block_matrix(
        &self,
        factor: ArrayView2<'_, f64>,
        rhs: ArrayView2<'_, f64>,
    ) -> Array2<f64>;
    fn sqrt_solve_block_matrix(
        &self,
        factor: ArrayView2<'_, f64>,
        rhs: ArrayView2<'_, f64>,
    ) -> Array2<f64>;
    fn block_gemm_subtract(
        &self,
        schur: &mut Array2<f64>,
        left: &Array2<f64>,
        right: &Array2<f64>,
    );

    // Provided method
    fn factor_blocks_with_policy(
        &self,
        rows: &[ArrowRowBlock],
        ridge_t: f64,
        d: usize,
        evidence_factorization: bool,
        gpu_policy: GpuPolicy,
    ) -> Result<ArrowFactorSlab, ArrowSchurError> { ... }
}
Expand description

CPU/GPU seam for BA point-block work.

BA systems spend most time in independent point-block factorizations, triangular solves, and Schur block products. MegBA maps exactly these operations to GPU kernels. This trait keeps that boundary explicit so a CUDA/Ceres backend can replace CpuBatchedBlockSolver without changing ArrowSchurSystem algebra.

Required Methods§

Source

fn factor_blocks( &self, rows: &[ArrowRowBlock], ridge_t: f64, d: usize, evidence_factorization: bool, ) -> Result<ArrowFactorSlab, ArrowSchurError>

Factor every per-row point block H_tt^(i) + ridge_t I, as in BA’s point elimination stage.

evidence_factorization lifts the Newton-step κ rejection while still requiring genuine PD unless the system’s evidence deflation handles it.

Source

fn solve_block_vector( &self, factor: ArrayView2<'_, f64>, rhs: ArrayView1<'_, f64>, ) -> Array1<f64>

Solve one factored point block against a vector RHS.

Source

fn solve_block_matrix( &self, factor: ArrayView2<'_, f64>, rhs: ArrayView2<'_, f64>, ) -> Array2<f64>

Solve one factored point block against a dense matrix RHS.

Source

fn sqrt_solve_block_matrix( &self, factor: ArrayView2<'_, f64>, rhs: ArrayView2<'_, f64>, ) -> Array2<f64>

Apply the Square-Root BA lower-triangular solve L_i^-1 rhs.

Source

fn block_gemm_subtract( &self, schur: &mut Array2<f64>, left: &Array2<f64>, right: &Array2<f64>, )

Subtract a row-local Schur product from the dense reduced system.

Provided Methods§

Source

fn factor_blocks_with_policy( &self, rows: &[ArrowRowBlock], ridge_t: f64, d: usize, evidence_factorization: bool, gpu_policy: GpuPolicy, ) -> Result<ArrowFactorSlab, ArrowSchurError>

Factor under an explicit request policy. Backends without a device path may ignore the policy; the production CPU/GPU hybrid honors it before any runtime probe.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§