use crate::Matrix;
#[inline]
pub fn check_bounds(pos: usize, begin: usize, end: usize) {
if pos < begin || pos >= end {
panic!("Error: Index out of range.");
}
}
#[inline]
pub fn check_empty(size: usize) {
if size == 0 {
panic!("Error: The container is empty.");
}
}
#[inline]
pub fn check_size(s1: usize, s2: usize) {
if s1 != s2 {
panic!("Error: The dimensions mismatch.");
}
}
#[inline]
pub fn check_square(m: &Matrix) {
if m.row_size() != m.col_size() {
panic!("Error: The matrix is not a square matrix.");
}
}