use ndarray::{Ixs, ShapeError};
use thiserror::Error;
pub type Result<T> = ::std::result::Result<T, LinalgError>;
#[derive(Debug, Error)]
pub enum LinalgError {
#[error("Not square: rows({}) != cols({})", rows, cols)]
NotSquare { rows: i32, cols: i32 },
#[error(transparent)]
Lapack(#[from] lax::error::Error),
#[error("invalid stride: s0={}, s1={}", s0, s1)]
InvalidStride { s0: Ixs, s1: Ixs },
#[error("Memroy is not continously")]
MemoryNotCont,
#[error("{} cannot be made from a ({}, {}) matrix", obj, rows, cols)]
NotStandardShape {
obj: &'static str,
rows: i32,
cols: i32,
},
#[error(transparent)]
Shape(#[from] ShapeError),
}