#[derive(Debug, thiserror::Error)]
pub enum LinalgError {
#[error("Invalid input: {0}")]
InvalidInput(String),
#[error(
"Hessian matrix is not positive definite (minimum eigenvalue: {min_eigenvalue:.4e}). This indicates a numerical instability."
)]
HessianNotPositiveDefinite { min_eigenvalue: f64 },
#[error(
"Model is ill-conditioned with condition number {condition_number:.2e}. This typically occurs when the model is over-parameterized (too many knots relative to data points). Consider reducing the number of knots or increasing regularization."
)]
ModelIsIllConditioned { condition_number: f64 },
}