úÎ^Y+L      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK Safe-Infered5Sparse vector is just indexed map of non-zero values "real size of vector (with zeroes) IntMap storing non-zero values  Type of internal vector storage Dot product of two Ls (for internal use) 6Shifts (re-enumerates) keys of IntMap by given number CAdds element to the map at given index, shifting all keys after it FDeletes element of the map at given index, shifting all keys after it DSplits map using predicate and returns a pair with filtered map and ( re-enumereted second part (that doesn'#t satisfy predicate). For example: ?partitionMap (>0) (fromList [(1,1),(2,-1),(3,-2),(4,3),(5,-4)]);( fromList [(1,1),(4,3)], fromList [(1,-1),(2,-2),(3,-4)] )  Sets vector's size #Vector of zero size with no values -Vector of given size with no non-zero values $Vector of length 1 with given value This is like cons (:) operator for lists. x .> v = singVec x <> vJSplits vector using predicate and returns a pair with filtered values and ( re-enumereted second part (that doesn'#t satisfy predicate). For example: 9partitionVec (>0) (sparseList [0,1,-1,2,3,0,-4,5,-6,0,7])=( sparseList [0,1,0,2,3,0,0,5,0,0,7], sparseList [-1,-4,-6] )CLooks up an element in the vector (if not found, zero is returned) >Deletes element of vector at given index (size of vector doesn' t change) ,Returns plain list with all zeroes restored >Converts plain list to sparse vector, throwing out all zeroes "Dot product of two sparse vectors Unicode alias for  M2Shows size and filled vector (but without zeroes) NMonoid O4 operation works like concatenation of two vectors 6 (indexes of second are shifted by length of first) PQ operators like (*), (+) and (-) work on sparse vectors  like R ( &)2 works on lists, except size of result is maximum  of arguments sizes. S, T and U work through V , so usual Q laws  are satisfied (such as (signum v)*(abs v) == v. W/ constructs a vector with single element. So, 3 + (sparseList [0,2,1])sparseList [3,2,1]X.fold functions are applied to non-zero values YV2 applies given function on vector non-zero values  MNPXY    MNPXY Safe-Infered,0Sparse matrix is indexed map of non-zero rows, 'real height and width of filled matrix /IntMap (IntMap ±) representing non-zero values Internal storage of matrix Matrix real height and width Matrix real height and width  Sets height and width of matrix !#Matrix of zero size with no values "Zero matrix of given size #8Checks if vector has no non-zero values (i.e. is empty) $8Checks if vector has no non-zero values (i.e. is empty) %8Checks if matrix has no non-zero values (i.e. is empty) &8Checks if matrix has no non-zero values (i.e. is empty) 'Identity matrix of given size (8Adds row at given index, increasing matrix height by 1 ! and shifting indexes after it ):Adds column at given index, increasing matrix width by 1 ! and shifting indexes after it *"Just adds zero row at given index +%Just adds zero column at given index ,;Deletes row at given index, decreasing matrix height by 1 ! and shifting indexes after it -=Deletes column at given index, decreasing matrix width by 1 ! and shifting indexes after it .(Deletes row and column at given indexes /:Partitions matrix, using pedicate on rows and returns two new matrices, Q one constructed from rows satisfying predicate, and another from rows that don't 1CLooks up an element in the matrix (if not found, zero is returned) 2%Returns row of matrix at given index 3(Returns column of matrix at given index 4+Updates values in row using given function 5@Fills row with zeroes (i.e. deletes it, but size of matrix doesn' t change) 6%Erases matrix element at given index 7>Inserts new element to the sparse matrix (replaces old value) :9Constructs square matrix with given elements on diagonal ;&Constructs matrix from a list of rows <,Converts sparse matrix to associative list, F adding fake zero element, to save real size for inverse conversion =,Converts associative list to sparse matrix, & using maximal index as matrix size >EConverts sparse matrix to plain list-matrix with all zeroes restored ?EConverts plain list-matrix to sparse matrix, throwing out all zeroes B(Transposes matrix (rows became columns) C Matrix-by-vector multiplication DUnicode alias for C E Vector-by-matrix multiplication FUnicode alias for E GSparse matrices multiplication HUnicode alias for G Z2Shows size and filled matrix (but without zeroes) [V/ applies given function on all non-zero values 3 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHZ\[0 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH0 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH0 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHZ\[ Safe-InferedIStaircase Form of matrix.  Using of ] causes ^ context. (TODO: eliminate it)  Method: C Gauss method applied to the rows of matrix. Though ± may be not C a field, we repeat the remainder division to obtain zeroes down  in the column. JclearColumn m --> m' " From the start, length(m) > 1.  m'(1,1) = gcd(firstColumn(m)), m'(i,1)==0 for i>1.  m'&(1,1) = 0 means that column was zero. K extGCD a b --> (gcd(a,b), tt) 7 a,b are divided repeatedly with remainder, like in 4 extended gcd method. tt is a protocol 2x2 matrix  so, [a,b] ·× tt = [gcd(a,b),0] IJKIJKIJKIJK_      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXUYZU[\UY]UY^UY_U`aUYbcdefgUhiUhjksparse-lin-alg-0.2.1 Math.LinearAlgebra.Sparse.Vector Math.LinearAlgebra.Sparse.Matrix.Math.LinearAlgebra.Sparse.Algorithms.Staircase SparseVectorSVdimvecSVecIndex·· shiftKeysaddElemdelElem partitionMap setLengthemptyVeczeroVecsingVec.> partitionVec! eraseInVecfillVec sparseListshowSparseList showNonZerodot· SparseMatrixSMdimsmxSMxheightwidthsetSizeemptyMxzeroMx isZeroVec isNotZeroVecisZeroMx isNotZeroMxidMxaddRowaddCol addZeroRow addZeroColdelRowdelCol delRowCol partitionMx separateMx#rowcolupdRoweraseRoweraseinsfindRowIndicesfindRowIndicesR diagonalMxfromRows toAssocList fromAssocListfillMxsparseMxshowSparseMatrixcolumntransmulMV×·mulVM·×mul× staircase clearColumnextGCDcontainers-0.4.2.1 Data.IntMapIntMap$fShowSparseVector$fMonoidSparseVectorbase Data.Monoidmappend$fNumSparseVectorGHC.NumNumGHC.ListzipWithsignumabsnegateGHC.Basefmap fromInteger$fFoldableSparseVector$fFunctorSparseVector$fShowSparseMatrix$fFunctorSparseMatrix$fNumSparseMatrixGHC.RealdivModIntegral