tensor4all_tensorci/
error.rs1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, TCIError>;
7
8#[derive(Error, Debug)]
10pub enum TCIError {
11 #[error("Dimension mismatch: {message}")]
13 DimensionMismatch {
14 message: String,
16 },
17
18 #[error("Index out of bounds: {message}")]
20 IndexOutOfBounds {
21 message: String,
23 },
24
25 #[error("Invalid pivot: {message}")]
27 InvalidPivot {
28 message: String,
30 },
31
32 #[error("Failed to converge after {iterations} iterations")]
34 ConvergenceFailure {
35 iterations: usize,
37 },
38
39 #[error("Empty tensor structure")]
41 Empty,
42
43 #[error("Invalid operation: {message}")]
45 InvalidOperation {
46 message: String,
48 },
49 #[error("Index inconsistency: {message}")]
51 IndexInconsistency {
52 message: String,
54 },
55
56 #[error("Matrix CI error: {0}")]
58 MatrixCIError(#[from] tensor4all_tcicore::MatrixCIError),
59
60 #[error("Matrix LUCI error: {0}")]
62 MatrixLuciError(#[from] tensor4all_tcicore::MatrixLuciError),
63
64 #[error("Tensor train error: {0}")]
66 TensorTrainError(#[from] tensor4all_simplett::TensorTrainError),
67}