# MutableMatrix -- the class of all mutable matrices

## Description

A mutable matrix in Macaulay2 is a rectangular array of elements of a specific ring, whose entries can be modified.

A mutable matrix is different from a Matrix in that a matrix contains degree information for the target and source of the matrix, while a mutable matrix has no such information. Also, more operations are provided for matrices.

For an overview of mutable matrices, see mutable matrices.

Mutable matrices can either be encoded in a sparse manner (the matrix only encodes the non-zero elements), or in a dense manner (all elements are stored -- even zeros). The distinction is an option to several of the routines that create mutable matrices (mutableMatrix, mutableIdentity). Certain operations over RR or CC are performed using the lapack library and require dense encoding of matrices: LUdecomposition, SVD, solve, eigenvalues, eigenvectors.

### matrix arithmetic

Many matrix arithmetic routines are only available for immutabie matrices, not mutable matrices. It is necessary to use matrix to make an immutable matrix first.

## Methods that use a mutable matrix :

• "MutableMatrix * MutableMatrix" -- see * -- a binary operator, usually used for multiplication
• "RingElement * MutableMatrix" -- see * -- a binary operator, usually used for multiplication
• "MutableMatrix + MutableMatrix" -- see + -- a unary or binary operator, usually used for addition
• "- MutableMatrix" -- see - -- a unary or binary operator, usually used for negation or subtraction
• "MutableMatrix - MutableMatrix" -- see - -- a unary or binary operator, usually used for negation or subtraction
• "MutableMatrix == MutableMatrix" -- see == -- equality
• "MutableMatrix == ZZ" -- see == -- equality
• "ZZ == MutableMatrix" -- see == -- equality
• "clean(RR,MutableMatrix)" -- see clean -- Set to zero elements that are approximately zero
• "columnMult(MutableMatrix,ZZ,Number)" -- see columnMult -- multiply a column by a ring element
• "columnMult(MutableMatrix,ZZ,RingElement)" -- see columnMult -- multiply a column by a ring element
• "columnPermute(MutableMatrix,ZZ,List)" -- see columnPermute -- permute some columns
• columnRankProfile(MutableMatrix) (missing documentation)
• "columnSwap(MutableMatrix,ZZ,ZZ)" -- see columnSwap -- interchange columns
• "determinant(MutableMatrix)" -- see determinant -- determinant of a matrix
• "eigenvalues(MutableMatrix)" -- see eigenvalues -- find eigenvalues of a matrix
• "eigenvectors(MutableMatrix)" -- see eigenvectors -- find eigenvectors of a matrix over RR or CC
• "entries(MutableMatrix)" -- see entries -- lists the entries of a matrix
• "fillMatrix(MutableMatrix)" -- see fillMatrix -- fill a mutable matrix with random numbers
• "fillMatrix(MutableMatrix,ZZ)" -- see fillMatrix -- fill a mutable matrix with random numbers
• "inverse(MutableMatrix)" -- see inverse(Matrix) -- compute the inverse
• lift(MutableMatrix,type of InexactNumber') (missing documentation)
• lift(MutableMatrix,type of InexactNumber) (missing documentation)
• lift(MutableMatrix,type of Number) (missing documentation)
• lift(MutableMatrix,type of RingElement) (missing documentation)
• "LLL(MutableMatrix)" -- see LLL -- compute an LLL basis
• "LUdecomposition(MutableMatrix)" -- see LUdecomposition -- LU decomposition
• "MutableMatrix _ Sequence" -- see Matrix _ Sequence -- get entry of matrix
• matrix(MutableMatrix) -- make a matrix from a mutable one
• "mutableMatrix(MutableMatrix)" -- see mutableMatrix -- make a mutable matrix
• MutableMatrix * RingElement (missing documentation)
• MutableMatrix * RR (missing documentation)
• MutableMatrix * ZZ (missing documentation)
• MutableMatrix ^ List (missing documentation)
• MutableMatrix ^ ZZ (missing documentation)
• MutableMatrix _ List (missing documentation)
• MutableMatrix _ Sequence = Thing -- assignment to an element of a mutable matrix
• "norm(InexactField,MutableMatrix)" -- see norm
• "norm(MutableMatrix)" -- see norm
• "norm(RR,MutableMatrix)" -- see norm
• nullSpace(MutableMatrix) (missing documentation)
• "numColumns(MutableMatrix)" -- see numColumns(Matrix) -- number of columns in a matrix or mutable matrix
• "numRows(MutableMatrix)" -- see numRows(Matrix) -- number of rows in a matrix or mutable matrix
• "precision(MutableMatrix)" -- see precision
• "QRDecomposition(MutableMatrix)" -- see QRDecomposition -- compute a QR decomposition of a real matrix
• "rank(MutableMatrix)" -- see rank -- compute the rank
• "reducedRowEchelonForm(MutableMatrix)" -- see reducedRowEchelonForm -- compute the reduced row echelon form of a matrix or mutable matrix over a field
• "ring(MutableMatrix)" -- see ring -- get the associated ring of an object
• "rowMult(MutableMatrix,ZZ,Number)" -- see rowMult -- multiply a row by a ring element
• "rowMult(MutableMatrix,ZZ,RingElement)" -- see rowMult -- multiply a row by a ring element
• "rowPermute(MutableMatrix,ZZ,List)" -- see rowPermute -- permute some rows
• rowRankProfile(MutableMatrix) (missing documentation)
• "rowSwap(MutableMatrix,ZZ,ZZ)" -- see rowSwap -- interchange rows
• RR * MutableMatrix (missing documentation)
• "solve(MutableMatrix,MutableMatrix)" -- see solve -- solve linear equation(s)
• "submatrix(MutableMatrix,VisibleList)" -- see submatrix(Matrix,VisibleList) -- select columns
• "submatrix(MutableMatrix,VisibleList,VisibleList)" -- see submatrix(Matrix,VisibleList,VisibleList) -- select part of a matrix
• "SVD(MutableMatrix)" -- see SVD -- singular value decomposition of a matrix
• "transpose(MutableMatrix)" -- see transpose(Matrix) -- transpose a matrix
• ZZ * MutableMatrix (missing documentation)

## For the programmer

The object MutableMatrix is a type, with ancestor classes HashTable < Thing.