Elementary Arithmetic
- A + B: MtrxSprs, MtrxSprs -> MtrxSprs
Given \(m \times n\) sparse matrices \(A\) and \(B\) over a ring \(R\), return \(A+B\).
- A - B: MtrxSprs, MtrxSprs -> MtrxSprs
Given \(m \times n\) sparse matrices \(A\) and \(B\) over a ring \(R\), return \(A-B\).
- A * B: MtrxSprs, MtrxSprs -> MtrxSprs
Given an \(m \times n\) sparse matrix \(A\) over a ring \(R\) and an \(n \times p\) sparse matrix \(B\) over \(R\), return the \(m \times p\) sparse matrix \(A\cdot B\) over \(R\).
- x * A: RngElt, MtrxSprs -> MtrxSprs
- A * x: MtrxSprs, RngElt -> MtrxSprs
Given an \(m \times n\) sparse matrix \(A\) over a ring \(R\) and a ring element \(x\) coercible into \(R\), return the scalar product \(x\cdot A\).
- A ^-1: MtrxSprs, RngIntElt -> MtrxSprs
Given a invertible square sparse matrix \(A\) over a ring \(R\), return the inverse \(B\) of \(A\) so that \(A\cdot B = B\cdot A = 1\). The coefficient ring \(R\) must be either a field, a Euclidean domain, or a ring with an exact division algorithm and having characteristic equal to zero or greater than \(m\) (this includes most commutative rings).
- A ^ n: MtrxSprs, RngIntElt -> MtrxSprs
Given a square sparse matrix \(A\) over a ring \(R\) and an integer \(n\), return the matrix power \(A^n\). \(A^0\) is defined to be the identity matrix for any square matrix \(A\) (even if \(A\) is zero). If \(n\) is negative, \(A\) must be invertible (see the previous function), and the result is \((A^{-1})^{-n}\).