Îõ³h&B2@KÌ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK Safe-Inferred;?·ÊmatrixType of matrices.àElements can be of any type. Rows and columns are indexed starting by 1. This means that, if  m :: Matrix a and  i,j :: Int, then  m ! (i,j) is the element in the i-th row and j-th column of m.matrixNumber of rows.matrixNumber of columns.Lmatrix.Number of columns of the matrix without offsetMmatrix(Content of the matrix as a plain vector.Nmatrix/Just a cool way to output the size of a matrix.matrixDisplay a matrix as a O using the P instance of its elements.matrix O(rows*cols) . Similar to Q<. It copies the matrix content dropping any extra memory.Useful when using ' from a big matrix.matrixéFlatten a matrix of matrices. All sub matrices must have same dimensions This criteria is not checked.matrix O(rows*cols)(. Map a function over a row. Example: Œ ( 1 2 3 ) ( 1 2 3 ) ( 4 5 6 ) ( 5 6 7 ) mapRow (\_ x -> x + 1) 2 ( 7 8 9 ) = ( 7 8 9 )matrix O(rows*cols)+. Map a function over a column. Example: Œ ( 1 2 3 ) ( 1 3 3 ) ( 4 5 6 ) ( 4 6 6 ) mapCol (\_ x -> x + 1) 2 ( 7 8 9 ) = ( 7 9 9 )matrix O(rows*cols)+. Map a function over elements. Example: ˜ ( 1 2 3 ) ( 0 -1 -2 ) ( 4 5 6 ) ( 1 0 -1 ) mapPos (\(r,c) a -> r - c) ( 7 8 9 ) = ( 2 1 0 ) matrix O(rows*cols)$. The zero matrix of the given size. €zero n m = m 1 ( 0 0 ... 0 0 ) 2 ( 0 0 ... 0 0 ) ( ... ) ( 0 0 ... 0 0 ) n ( 0 0 ... 0 0 ) matrix O(rows*cols)Ã. Generate a matrix from a generator function. Example of usage: à ( 1 0 -1 -2 ) ( 3 2 1 0 ) ( 5 4 3 2 ) matrix 4 4 $ \(i,j) -> 2*i - j = ( 7 6 5 4 ) matrix O(rows*cols)%. Identity matrix of the given order. ‚identity n = n 1 ( 1 0 ... 0 0 ) 2 ( 0 1 ... 0 0 ) ( ... ) ( 0 0 ... 1 0 ) n ( 0 0 ... 0 1 ) matrix Similar to  , but using R$, which should be more efficient. matrixÝCreate a matrix from a non-empty list given the desired size. The list must have at least  rows*cols elements. An example: ß ( 1 2 3 ) ( 4 5 6 ) fromList 3 3 [1..] = ( 7 8 9 )matrix.Get the elements of a matrix stored in a list. È ( 1 2 3 ) ( 4 5 6 ) toList ( 7 8 9 ) = [1,2,3,4,5,6,7,8,9]matrixñGet the elements of a matrix stored in a list of lists, where each list contains the elements of a single row. Û ( 1 2 3 ) [ [1,2,3] ( 4 5 6 ) , [4,5,6] toLists ( 7 8 9 ) = , [7,8,9] ]matrix¥Diagonal matrix from a non-empty list given the desired size. Non-diagonal elements will be filled with the given default element. The list must have at least order elements. šdiagonalList n 0 [1..] = n 1 ( 1 0 ... 0 0 ) 2 ( 0 2 ... 0 0 ) ( ... ) ( 0 0 ... n-1 0 ) n ( 0 0 ... 0 n )matrix=Create a matrix from a non-empty list of non-empty lists. ?Each list must have at least as many elements as the first list. Examples: èfromLists [ [1,2,3] ( 1 2 3 ) , [4,5,6] ( 4 5 6 ) , [7,8,9] ] = ( 7 8 9 ) ëfromLists [ [1,2,3 ] ( 1 2 3 ) , [4,5,6,7] ( 4 5 6 ) , [8,9,0 ] ] = ( 8 9 0 )matrixO(1)). Represent a vector as a one row matrix.matrixO(1),. Represent a vector as a one column matrix.matrix O(rows*cols). Permutation matrix. ÐpermMatrix n i j = i j n 1 ( 1 0 ... 0 ... 0 ... 0 0 ) 2 ( 0 1 ... 0 ... 0 ... 0 0 ) ( ... ... ... ) i ( 0 0 ... 0 ... 1 ... 0 0 ) ( ... ... ... ) j ( 0 0 ... 1 ... 0 ... 0 0 ) ( ... ... ... ) ( 0 0 ... 0 ... 0 ... 1 0 ) n ( 0 0 ... 0 ... 0 ... 0 1 )When i == j it reduces to   n.matrixO(1)1. Get an element of a matrix. Indices range from (1,1) to (n,m). It returns an S. if the requested element is outside of range.matrixO(1). Unsafe variant of , without bounds checking.matrixShort alias for .TmatrixInternal alias for .matrix Variant of ( that returns Maybe instead of an error.matrix Variant of  ( that returns Maybe instead of an error.matrixO(1)$. Get a row of a matrix as a vector.matrix Varian of ) that returns a maybe instead of an errormatrixO(rows)'. Get a column of a matrix as a vector.matrix Varian of  getColumn) that returns a maybe instead of an errormatrixO(min rows cols). Diagonal of a not necessarily square matrix.matrix O(rows*cols). Transform a  to a R of size  rows*cols?. This is equivalent to get all the rows of the matrix using 0 and then append them, but far more efficient. matrix(Replace the value of a cell in a matrix.!matrixUnsafe variant of  , without bounds checking."matrix O(rows*cols)(. The transpose of a matrix. Example: ß ( 1 2 3 ) ( 1 4 7 ) ( 4 5 6 ) ( 2 5 8 ) transpose ( 7 8 9 ) = ( 3 6 9 )#matrix/O(rows*rows*rows*rows) = O(cols*cols*cols*cols)Í. The inverse of a square matrix. Uses naive Gaussian elimination formula.$matrix÷Converts a matrix to reduced row echelon form, thus solving a linear system of equations. This requires that (cols > rows) if cols < rows, then there are fewer variables than equations and the problem cannot be solved consistently. If rows = cols, then it is basically a homogenous system of equations, so it will be reduced to identity or an error depending on whether the marix is invertible (this case is allowed for robustness). This implementation is taken from rosettacode =https://rosettacode.org/wiki/Reduced_row_echelon_form#Haskell%matrixŒExtend a matrix to a given size adding a default element. If the matrix already has the required size, nothing happens. The matrix is never reduced in size. Example: £ ( 1 2 3 0 0 ) ( 1 2 3 ) ( 4 5 6 0 0 ) ( 4 5 6 ) ( 7 8 9 0 0 ) extendTo 0 4 5 ( 7 8 9 ) = ( 0 0 0 0 0 )The definition of % is based on &: ÂextendTo e n m a = setSize e (max n $ nrows a) (max m $ ncols a) a&matrixýSet the size of a matrix to given parameters. Use a default element for undefined entries if the matrix has been extended.'matrixO(1)>. Extract a submatrix given row and column limits. Example: ç ( 1 2 3 ) ( 4 5 6 ) ( 2 3 ) submatrix 1 2 2 3 ( 7 8 9 ) = ( 5 6 )(matrix O(rows*cols)6. Remove a row and a column from a matrix. Example: á ( 1 2 3 ) ( 4 5 6 ) ( 1 3 ) minorMatrix 2 2 ( 7 8 9 ) = ( 7 9 ))matrixO(1)›. Make a block-partition of a matrix using a given element as reference. The element will stay in the bottom-right corner of the top-left corner matrix. ñ ( ) ( | ) ( ) ( ... | ... ) ( x ) ( x | ) splitBlocks i j ( ) = (-------------) , where x = a_{i,j} ( ) ( | ) ( ) ( ... | ... ) ( ) ( | )×Note that some blocks can end up empty. We use the following notation for these blocks: #( TL | TR ) (---------) ( BL | BR )/Where T = Top, B = Bottom, L = Left, R = Right.*matrix$Join blocks of the form detailed in ) . Precisely: ÀjoinBlocks (tl,tr,bl,br) = (tl <|> tr) <-> (bl <|> br)+matrix)Horizontally join two matrices. Visually: ( A ) <|> ( B ) = ( A | B )Where both matrices A and B have the same number of rows. This condition is not checked.,matrix'Vertically join two matrices. Visually: Ç ( A ) ( A ) <-> ( B ) = ( - ) ( B )Where both matrices A and B# have the same number of columns. This condition is not checked.-matrixþPerform an operation element-wise. The second matrix must have at least as many rows and columns as the first matrix. If it's bigger, the leftover items will be ignored. If it's smaller, it will cause a run-time error. You may want to use .Ä if you are definitely sure that a run-time error won't arise..matrixUnsafe version of - , but faster.UmatrixInternal unsafe addition.VmatrixInternal unsafe substraction./matrix-Standard matrix multiplication by definition.0matrix-Standard matrix multiplication by definition.WmatrixÎStandard matrix multiplication by definition, without checking if sizes match.Xmatrix3Strassen's algorithm over square matrices of order 2^n.1matrix!Strassen's matrix multiplication.YmatrixStrassen's mixed algorithm.2matrix'Mixed Strassen's matrix multiplication.3matrix-Scale a matrix by a given factor. Example: ô ( 1 2 3 ) ( 2 4 6 ) ( 4 5 6 ) ( 8 10 12 ) scaleMatrix 2 ( 7 8 9 ) = ( 14 16 18 )4matrix*Scale a row by a given factor. Example: ñ ( 1 2 3 ) ( 1 2 3 ) ( 4 5 6 ) ( 8 10 12 ) scaleRow 2 2 ( 7 8 9 ) = ( 7 8 9 )5matrixmatrix2Product of the elements in the diagonal. See also  . Example: = ( 1 2 3 ) ( 4 5 6 ) diagProd ( 7 8 9 ) = 45?matrixÆMatrix determinant using Laplace expansion. If the elements of the  are instance of [ and \ consider to use @4 in order to obtain better performance. Function ? is  extremely slow.@matrixÞMatrix determinant using LU decomposition. It works even when the input matrix is singular.matrix9Function takes the current column as additional argument.matrix Row to map.matrix6Function takes the current row as additional argument.matrixColumn to map.matrix;Function takes the current Position as additional argument. matrixRowsmatrixColumns matrixRowsmatrixColumnsmatrixGenerator function matrixDefault elementmatrixDiagonal vector matrixRowsmatrixColumnsmatrixList of elementsmatrixSize of the matrix.matrixPermuted row 1.matrixPermuted row 2.matrixPermutation matrix.matrixRowmatrixColumnmatrixMatrixmatrixRowmatrixColumnmatrixMatrix]matrix New elementmatrixNumber of columns of the matrixmatrix Row offsetmatrix Column offsetmatrixPosition to set the new elementmatrixMutable vector^matrix New elementmatrixNumber of columns of the matrixmatrix Row offsetmatrix Column offsetmatrixPosition to set the new elementmatrixMutable vector matrix New value.matrixPosition to replace.matrixOriginal matrix.matrix=Matrix with the given position replaced with the given value.!matrix New value.matrixPosition to replace.matrixOriginal matrix.matrix=Matrix with the given position replaced with the given value.%matrixElement to add when extending.matrixMinimal number of rows.matrixMinimal number of columns.&matrixDefault element.matrixNumber of rows.matrixNumber of columns.'matrix Starting rowmatrix Ending rowmatrixStarting columnmatrix Ending column(matrixRow r to remove.matrixColumn c to remove.matrixOriginal matrix.matrixMatrix with row r and column c removed.)matrixRow of the splitting element.matrix Column of the splitting element.matrixMatrix to split.matrix (TL,TR,BL,BR)6matrixRow 1.matrixRow 2.matrixOriginal matrix.matrix"Matrix with rows 1 and 2 switched.7matrixCol 1.matrixCol 2.matrixOriginal matrix.matrix"Matrix with cols 1 and 2 switched._matrixUmatrixLmatrixPmatrixdmatrix Current rowmatrix Total rows`matrixUmatrixLmatrixPmatrixQmatrixdmatrixematrix Current rowmatrix Total rowsÁ  !"#$%&'()*+,-./0123456789:;<=>?@Á     !"&%#$'()+,*-./0123456789:;<=>?@U6V6á      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSQTUVWXVWYQZ[\]^_`aQbcdefQghijklí%matrix-0.3.6.2-3LG9juuYr3qHS1l4DLGg8w Data.MatrixMatrixnrowsncols prettyMatrix forceMatrixflattenmapRowmapColmapPoszeromatrixidentitydiagonalfromListtoListtoLists diagonalList fromLists rowVector colVector permMatrixgetElem unsafeGet!safeGetsafeSetgetRow safeGetRowgetCol safeGetColgetDiaggetMatrixAsVectorsetElem unsafeSet transposeinverserrefextendTosetSize submatrix minorMatrix splitBlocks joinBlocks<|><-> elementwiseelementwiseUnsafemultStdmultStd2 multStrassenmultStrassenMixed scaleMatrixscaleRow combineRows switchRows switchColsluDecompluDecompUnsafe luDecomp'luDecompUnsafe' cholDecomptracediagProd detLaplacedetLU $fNumMatrix$fTraversableMatrix$fFoldableMatrix$fApplicativeMatrix$fMonoidMatrix$fSemigroupMatrix$fFunctorMatrix$fNFDataMatrix $fShowMatrix $fEqMatrix$fGenericMatrixvcolsmvectsizeStrbaseGHC.BaseStringGHC.ShowShow%vector-0.13.1.0-2lCeeCyC2I3KCSVrGQfe2 Data.VectorforceVectorGHC.Errerror!.+.-.multStd_strassen strassenMixed GHC.MaybeNothingghc-prim GHC.ClassesOrdGHC.Real FractionalmsetElem unsafeMset recLUDecomp recLUDecomp'