pub mod auxiliary;
mod element_op;
mod raw;
pub mod view;
pub use element_op::{
Adjoint, ComposableElementOp, Compose, Conj, ElementOp, ElementOpApply, Identity, Transpose,
};
pub use raw::{RawStridedMut, RawStridedRef};
pub use view::{col_major_strides, row_major_strides, StridedArray, StridedView, StridedViewMut};
#[derive(Debug, thiserror::Error)]
pub enum StridedError {
#[error("rank mismatch: {0} vs {1}")]
RankMismatch(usize, usize),
#[error("shape mismatch: {0:?} vs {1:?}")]
ShapeMismatch(Vec<usize>, Vec<usize>),
#[error("invalid axis {axis} for rank {rank}")]
InvalidAxis { axis: usize, rank: usize },
#[error("stride and dims length mismatch")]
StrideLengthMismatch,
#[error("offset overflow while computing pointer")]
OffsetOverflow,
#[error("failed to convert scalar for scaling")]
ScalarConversion,
#[error("non-square matrix: rows={rows}, cols={cols}")]
NonSquare { rows: usize, cols: usize },
}
pub type Result<T> = std::result::Result<T, StridedError>;