pub mod csc;
mod etree;
pub mod lu;
pub mod ordering;
pub mod perm;
pub mod solver;
#[cfg(test)]
mod accuracy_tests;
mod stats;
pub mod supernodal;
pub mod symbolic;
pub use csc::{CscPattern, CscView};
pub use lu::{LuFactors, SparseScalar};
pub use ordering::colamd::{ColamdControl, ColamdOrdering, colamd_order};
pub use solver::{LuMethod, LuSolver, LuSymbolic};
pub use stats::SparseLuStats;
pub use supernodal::{SupernodalLu, SymbolicSupernodal};
pub use symbolic::SymbolicLu;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum SparseError {
BadShape,
InvalidStructure,
UnsortedRows,
DuplicateEntry,
Singular,
IndexOverflow,
StructureMismatch,
NotFinite,
}
impl core::fmt::Display for SparseError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let msg = match self {
Self::BadShape => "inconsistent shape or length",
Self::InvalidStructure => "invalid CSC structure",
Self::UnsortedRows => "row indices must be strictly increasing within a column",
Self::DuplicateEntry => "duplicate entry in a column",
Self::Singular => "the matrix is singular",
Self::IndexOverflow => "index or workspace size overflow",
Self::StructureMismatch => "the matrix pattern differs from the symbolic analysis",
Self::NotFinite => "the matrix has a NaN or infinite entry",
};
f.write_str(msg)
}
}
impl std::error::Error for SparseError {}