tensor4all_tcicore/matrixluci/kernel.rs
1//! Pivot-kernel traits.
2//!
3//! The [`PivotKernel`] trait abstracts pivot selection strategies.
4//! Implementations include [`DenseFaerLuKernel`](super::DenseFaerLuKernel)
5//! (full-pivoting LU via faer) and
6//! [`LazyBlockRookKernel`](super::LazyBlockRookKernel) (residual-based
7//! rook search for lazy sources).
8
9use crate::matrixluci::scalar::Scalar;
10use crate::matrixluci::source::CandidateMatrixSource;
11use crate::matrixluci::types::{PivotKernelOptions, PivotSelectionCore};
12
13/// Kernel that selects pivot rows and columns from a candidate matrix.
14///
15/// Different implementations choose pivots using different strategies
16/// (dense full-pivoting LU, lazy rook search, etc.).
17pub trait PivotKernel<T: Scalar> {
18 /// Factorize the candidate matrix and return pivot-only output.
19 fn factorize<S: CandidateMatrixSource<T>>(
20 &self,
21 source: &S,
22 options: &PivotKernelOptions,
23 ) -> crate::matrixluci::Result<PivotSelectionCore>;
24}
25
26#[cfg(test)]
27mod tests;