1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, FastIcaError>;
4
5#[derive(Error, Debug)]
7#[non_exhaustive]
8pub enum FastIcaError {
9 #[error("Dataset must contain at least one sample")]
11 NotEnoughSamples,
12 #[error("Invalid value encountered: {0}")]
14 InvalidValue(String),
15 #[error("SVD Decomposition failed, X could be an Ill-Conditioned matrix")]
18 SvdDecomposition,
19 #[error("tolerance should be positive but is {0}")]
20 InvalidTolerance(f32),
21 #[cfg(feature = "blas")]
22 #[error("Linalg BLAS error: {0}")]
23 LinalgBlasError(#[from] ndarray_linalg::error::LinalgError),
24 #[error("Linalg error: {0}")]
25 LinalgError(#[from] linfa_linalg::LinalgError),
27 #[error(transparent)]
28 LinfaError(#[from] linfa::error::Error),
29}