            col: self.col,
            val: self.val,
        }
    }
}

impl std::ops::Sub for Matrix {
    type Output = Self;

    fn sub(mut self, other: Self) -> Self {
        if self.row != other.row || self.col != other.col {
            panic!("the sizes of the two matrices do not match");