use thiserror::Error;
pub type Result<T> = std::result::Result<T, OptimError>;
#[derive(Debug, Error)]
pub enum OptimError {
#[error("invalid configuration: {0}")]
InvalidConfig(String),
#[error("shape mismatch: expected {expected:?}, got {actual:?}")]
ShapeMismatch {
expected: Vec<usize>,
actual: Vec<usize>,
},
#[error("dimension mismatch: expected {expected}, got {actual}")]
DimensionMismatch {
expected: usize,
actual: usize,
},
#[error("empty input: {0}")]
EmptyInput(String),
#[error("compression error: {0}")]
Compression(String),
#[error("prediction error: {0}")]
Prediction(String),
#[error("tensor error: {0}")]
Tensor(#[from] candle_core::Error),
#[error("ternary error: {0}")]
Ternary(#[from] trit_vsa::TernaryError),
}