||]      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~,(C) 2016 Marco Zocca, 2012-2015 Edward KmettGPL-3 (see LICENSE)zocca.marco gmail provisionalportableSafe9; 2Provides a test to see if a quantity is near zero.nearZero (1e-11 :: Double)FalsenearZero (1e-17 :: Double)TruenearZero (1e-5 :: Float)FalsenearZero (1e-7 :: Float)True%Determine if a quantity is near zero. Rounding rule Rounding ruleRound to respectively 0 or 1  Complex types  a  1e-12  a  1e-6  a  1e-12  a  1e-6  None 8a cons-based moving-window datatype of length at least 35Wrap a function with a null check, returning in MaybeIComponentwise tuple operations TODO : use semilattice properties insteadIComponentwise tuple operations TODO : use semilattice properties insteadinteger-indexed ziplist ", 2d arrays foldr over the results of a fmapstrict left foldindexed right fold Safe(c) Marco Zocca 2017 GPL-style (see the file LICENSE)zocca marco gmail experimentalportableNone *9:;<=DR%;union binary lift : apply function on _union_ of two "sets"&Iintersection binary lift : apply function on _intersection_ of two "sets"@}A matrix ring is any collection of matrices over some ring R that form a ring under matrix addition and matrix multiplicationWScale a vector XEScale a vector by the reciprocal of a number (e.g. for normalization)Y,Convex combination of two vectors (NB: 0 <= a <= 1). Z Inner product[X`hilbertDistSq x y = || x - y ||^2` computes the squared L2 distance between two vectors\Infinity-norm (Real)]Infinity-norm (Complex)^Lp inner product (p > 0)_ Reciprocal`Scalea)Lift a real number onto the complex planeX !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefS !"#$&%'()*+,-./0123456789:;<=?>@ABECDFGIHJKLMNOQPRSTUVWXYZ[\]^_`aXSTUVfedWXYZ[GHIJKLMNOPQR\]cb^_`@ABCDEF<=>?;9:678345/012+,-.)*'($%& !"#a! !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG HIJKLMNOPQRSTUVWXYZ[\]^_`abcdef (C) 2016 Marco ZoccaGPL-3 (see LICENSE)zocca.marco gmail provisionalportableSafe%Cleaner way to display Complex values   None 9;<=ADRT:Stream fusion based version of the above, from [1] [1] : Thttps://www.schoolofhaskell.com/user/edwardk/revisiting-matrix-multiplication/part-3&Given a number of rows(resp. columns) n; and a _sorted_ Vector of Integers in increasing order (containing the row(col) indices of nonzero entries), return the cumulative vector of nonzero entries of length `n + 1` (the "row(col) pointer" of the CSR(CSC) format). NB: Fused count-and-accumulate E.g.: > csrPtrV (==) 4 (V.fromList [1,1,2,3]) [0,0,2,3,4]<O(N) : Intersection between sorted vectors, in-place updates5O(N) : Union between sorted vectors, in-place updates"" None 249;DIRA synonym for IntMap IntMap instancesxParamInstance can be used with all types that are instances of Set (which are by construction also instances of Functor) None9;<=DRnInsert an element insertIM2 :: IM.Key -> IM.Key -> a -> IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap a)TLookup a key lookupIM2 :: IM.Key -> IM.Key -> IM.IntMap (IM.IntMap a) -> Maybe aLookup with default 0Populate an IM2 from a list of (row index, column index, value) fromListIM2 :: Foldable t => t (IM.Key, IM.Key, a) -> IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap a)Indexed left fold over an IM2, with general accumulator ifoldlIM2' :: (IM.Key -> IM.Key -> a -> b -> b) -> b -> IM.IntMap (IM.IntMap a) -> bIndexed left fold over an IM2 ifoldlIM2 :: (IM.Key -> IM.Key -> t -> IM.IntMap a -> IM.IntMap a) -> IM.IntMap (IM.IntMap t) -> IM.IntMap aoLeft fold over an IM2, with general accumulator foldlIM2 :: (a -> b -> b) -> b -> IM.IntMap (IM.IntMap a) -> bInner indices become outer ones and vice versa. No loss of information because both inner and outer IntMaps are nubbed. transposeIM2 :: IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap a)Map over outer IM and filter all inner IM's ifilterIM2 :: (IM.Key -> IM.Key -> a -> Bool) -> IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap a)|Specialized filtering : keep only sub-diagonal elements filterSubdiag :: IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap a)}List of (row, col) indices of (nonzero) subdiagonal elements subdiagIndices :: IM.IntMap (IM.IntMap a) -> [(IM.Key, IM.Key)] Map over IM2|Indexed map over IM2 imapIM2 :: (IM.Key -> IM.Key -> a -> b) -> IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap b)}Mapping keys mapKeysIM2 :: (IM.Key -> IM.Key) -> (IM.Key -> IM.Key) -> IM.IntMap (IM.IntMap a) -> IM.IntMap (IM.IntMap a)NonegNumerical iteration errorsjMatrix exceptionsmOperand size mismatch errorsqOut of bounds index erroru Input errorghijklmnopqrstuvwxyz{|}~ghijklmnopqrstuvwxywxuvqrstymnop~jkl}|ghi{zghijklmnopqrstuvwxyz{|}~(c) Marco Zocca 2017 GPL-style (see the file LICENSE)zocca marco gmail experimentalportableNone2:I  is a special case of H that assesses convergence based on the L2 distance to a known solution xKnown0This function makes some default choices on the  machinery: convergence is assessed using the squared L2 distance between consecutive states, and divergence is detected when this function is increasing between pairs of measurements.", monadic version is a high-order abstraction of a numerical iterative process. It accumulates a rolling window of 3 states and compares a summary q of the latest 2 with that of the previous two in order to assess divergence (e.g. if `q latest2 > q prev2` then it). The process ends when either we hit an iteration budget or relative convergence is verified. The function then assesses the final state with a predicate qfinal] (e.g. against a known solution; if this is not known, the user can just supply `const True`)", monadic versionSome useful combinatorsoApply a function over a range of integer indices, zip the result with it and filter out the almost-zero entries", monadic version%A combinator I don't know how to callHelpers7Squared difference of a 2-element list. | NB: unsafe ! TRelative tolerance : relTol a b := ||a - b|| / (1 + min (||norm2 a||, ||norm2 b||))$     Known value Calling function name ConfigurationState summary array projectionConvergence criterionDivergence criterion Final state acceptance criterionState evolution Initial state Final state #          (C) 2016 Marco ZoccaGPL-3 (see LICENSE)zocca.marco gmail provisionalportableNone 29:;<=DIR#SpVector sparsityNumber of nonzeros*Empty sparse vector (length n, no entries)"Singleton sparse vector (length 1)Canonical basis vector in R^nHSparse vector from an association list while discarding all zero entries(Dense real SpVector (monomorphic Double)+Dense complex SpVector (monomorphic Double)>Create new sparse vector, assumin 0-based, contiguous indexing^Map a function over a range of indices and filter the result (indices and values) to fit in a n-long SpVector0", using just the integer bounds of the interval_one-hot encoding : `oneHotSV n k` produces a SpVector of length n having 1 at the k-th positionDENSE vector of `1`sDENSE vector of `0`s3Populate a SpVector with the contents of a Vector. jPopulate a Vector with the entries of a SpVector, discarding the indices (NB: loses sparsity information).Z- | Populate a Vector with the entries of a SpVector, replacing the missing entries with 0insert element x at index i: in a preexisting SpVector; discards out-of-bounds entriesTo dense list (default = 0)Indexed fold over SpVectorLookup an index in a SpVector7Lookup an index, return a default value if lookup fails8Lookup an index in a SpVector, returns 0 if lookup fails Tail elements Head element2Keep the first n components of the SpVector (like  for lists)LDiscard the first n components of the SpVector and rebalance the keys (like  for lists)2Keep the first n components of the SpVector (like  for lists)Keep a range of entries Concatenate two sparse vectorsFilterIndexed filterSparsify an SpVector*Generate an arbitrary (not random) vector u such that `v dot u = 0`bs are sparse containers too, i.e. any specific component may be missing (so it is assumed to be 0)@s form a vector space because they can be multiplied by a scalar s are finite-dimensional vectors=-=:(C) 2016 Marco ZoccaGPL-3 (see LICENSE)zocca.marco gmail provisionalportableNone 249:;<=DR<Internal implementation,`zeroSM m n` : Empty SpMatrix of size (m, n)"`eye n` : identity matrix of rank nPermutation matrix from a (possibly incomplete) list of row swaps starting from row 0 e.g. `permutationSM 5 [1,3]` first swaps rows (0, 1) and then rows (1, 3) :  0,1,0,0,0 0,0,0,1,0 0,0,1,0,0 1,0,0,0,0 0,0,0,0,1yPermutation matrix from a (possibly incomplete) list of row pair swaps e.g. `permutPairs 5 [(2,4)]` swaps rows 2 and 4 :  1,0,0,0,0 0,1,0,0,0 0,0,0,0,1 0,0,0,1,0 0,0,1,0,09`mkSubDiagonal n o xx` creates a square SpMatrix of size n with xx on the oth subdiagonalDInsert an element in a preexisting Spmatrix at the specified indices?Add to existing SpMatrix using data from list (row, col, value):Create new SpMatrix using data from list (row, col, value)ECreate new SpMatrix assuming contiguous, 0-based indexing of elements$Populate list with SpMatrix contentsHPopulate list with SpMatrix contents and populate missing entries with 0`Looks up an element in the matrix with a default (if the element is not found, zero is returned)3Zero-default lookup, infix form (no bound checking)`Looks up an element in the matrix with a default (if the element is not found, zero is returned)Indexed filtering functionbDiagonal, subdiagonal, superdiagonal partitions of a SpMatrix (useful for writing preconditioners)bDiagonal, subdiagonal, superdiagonal partitions of a SpMatrix (useful for writing preconditioners)bDiagonal, subdiagonal, superdiagonal partitions of a SpMatrix (useful for writing preconditioners)fExtract a submatrix given the specified index bounds, rebalancing keys with the two supplied functions^Extract a submatrix given the specified index bounds NB : subtracts (i1, j1) from the indices\Extract a submatrix given the specified index bounds NB : submatrix indices are _preserved_Extract whole column!Extract column within a row range1Extract column within a row range, rebalance keys.Are the supplied indices within matrix bounds?Is the matrix square?Is the matrix diagonal?%Is the matrix lower/upper triangular?%Is the matrix lower/upper triangular?_Data in internal representation (do not export) immSM :: SpMatrix t -> IM.IntMap (IM.IntMap t)#(Number of rows, Number of columns)&Number of rows times number of columns Number of rows Number of columnsVertical stackingVertical stackingHorizontal stackingHorizontal stackingaAssembles a square matrix from a list of square matrices, arranging these along the main diagonalIndexed filter over SpMatrixLeft fold over SpMatrixIndexed left fold over SpMatrixCount sub-diagonal nonzeros`Filter the index subset that lies below the diagonal (used in the QR decomposition, for example)Sparsify an SpMatrix3Round almost-0 and almost-1 to 0 and 1 respectivelyModify (row, column) keys, leaving data intact. Be careful when using this! modifyKeysSM' :: (IxRow -> IxRow) -> (IxCol -> IxCol) -> SpMatrix a -> SpMatrix a!0Swap two rows of a SpMatrix (bounds not checked)".Swap two rows of a SpMatrix (bounds checked) #transposeSM : Matrix transpose$Hermitian conjugate*'Matrix product without dimension checks+Removes all elements x for which `| x | <= eps`),Removes all elements x for which `| x | <= eps`)-A B^T.A^T B/ Contract row i of A with column j of B up to an index nD, i.e. summing over repeated indices: Aij Bjk , for j in [0 .. n] 2ces are sparse containers too, i.e. any specific component may be missing (so it is assumed to be 0)5-es are maps between finite-dimensional spaces6bes form an additive group, in that they can have an invertible associtative operation (matrix sum)b      !"#$%&'()*+,-./012345678Y      !"#$%&'()*+,-./b8765432      !"#$%&'(10)*+,.-/Z      !"#$%&'()*+,-./012345678(C) 2016 Marco ZoccaGPL-3 (see LICENSE)zocca.marco gmail provisionalportableNone %&9:;DQR2Modify the size of a SpVector. Do not use directly1Remap the keys of a SpVector. Do not use directly@AInsert row , using the provided row index transformation functionAInsert row BCInsert column, using the provided row index transformation functionC Insert columnD#Outer product (all-with-all matrix)E#Outer product (all-with-all matrix)FAFill the diagonal of a SpMatrix with the components of a SpVectorGpromote a SV to SMH.Demote (n x 1) or (1 x n) SpMatrix to SpVectorIRLookup a row in a SpMatrix; returns an SpVector with the row, if this is non-emptyJExtract ith rowKExtract jth columnLGeneric extraction functionMExtract ith row (dense)NExtract jth columnOExtract the diagonalP&extract row interval (all entries between columns j1 and j2, INCLUDED, are returned) extractSubRow :: SpMatrix a -> IxRow -> (IxCol, IxCol) -> SpVector a extractSubRow m i (j1, j2) = case lookupRowSM m i of Nothing -> zeroSV (ncols m) Just rv -> ifilterSV (j _ -> j >= j1 && j <= j2) rv", returning in Maybe extractSubRow :: SpMatrix a -> IxRow -> (Int, Int) -> Maybe (SpVector a) extractSubRow m i (j1, j2) = resizeSV (j2 - j1) . ifilterSV (j _ -> j >= j1 && j  =j2) <$ lookupRowSM m iExtract an interval of SpVector components, changing accordingly the resulting SpVector size. Keys are _not_ rebalanced, i.e. components are still labeled according with respect to the source matrix.Q>extract row interval, rebalance keys by subtracting lowest oneRextract column intervalSAextract column interval, rebalance keys by subtracting lowest one >Vector-on-matrix (FIXME : transposes matrix: more costly than matVec , I think)T)Pack a list of SpVectors into an SpMatrixU+Unpack an SpMatrix into a list of SpVectorsV6Pack a V.Vector of SpVectors as columns of an SpMatrix%@ABCDEFGHIJKLMNOPQRS! TUV"#$%&'WXYZ% !"#$&%'()*+,-./0123456789:;<=?>@ABECDFGIHJKLMNOQPRSTUVWXYZ[\]^_`a      !"#$%&'()*+,-./@ABCDEFGHIJKLMNOPQRSTUV@ABCFDEHGIKJLMNOPRQSVTU%@ABCDEFGHIJKLMNOPQRS! TUV"#$%&'WXYZNone:DR(kGolub-Kahan-Lanczos bidiagonalization (see "Restarted Lanczos Bidiagonalization for the SVD", SLEPc STR-8,  ,http://slepc.upv.es/documentation/manual.htm )(((None:DR)*+,-./012345678)*+,-./01234567) *+,-./012345678None *.9:;<=DR9'A lumped constraint for numerical typesa+uses the R matrix from the QR factorizationc!Householder reflection: a vector xS uniquely defines an orthogonal plane; the Householder operator reflects any point v3 with respect to this plane: v' = (I - 2 x >< x) vdzGivens method, row version: choose other row index i' s.t. i' is : * below the diagonal * corresponding element is nonzeroQR.C1 ) To zero out entry A(i, j) we must find row k such that A(k, j) is non-zero but A has zeros in row k for all columns less than j.LNB: the current version is quite inefficient in that: 1. the Givens' matrix G_iC is different from Identity only in 4 entries 2. at each iteration i we multiply G_i by the previous partial result M0. Since this corresponds to a rotation, and the :Q function already computes the value of the resulting non-zero component (output r@), `G_i ## M` can be simplified by just changing two entries of M3 (i.e. zeroing one out and changing the other into r).:1Givens coefficients and norm of associated vectoreGiven a matrix A, returns a pair of matrices (Q, R) such that Q R = A, where Q is orthogonal and R is upper triangular. Applies Givens rotation iteratively to zero out sub-diagonal elements.f`eigsQR n mm` performs n* iterations of the QR algorithm on matrix mm3, and returns a SpVector containing all eigenvaluesg`eigsRayleigh n mm` performs n0 iterations of the Rayleigh algorithm on matrix mm and returns the eigenpair closest to the initialization. It displays cubic-order convergence, but it also requires an educated guess on the initial eigenpair.;`eigArnoldi n aa b` computes at most n iterations of the Arnoldi algorithm to find a Krylov subspace of (A, b), along with a Hessenberg matrix of coefficients H. After that, it computes the QR decomposition of H, and the eigenvalues of A are listed on the diagonal of the R factor.hGiven a positive semidefinite matrix A, returns a lower-triangular matrix L such that L L^T = A . This is an implementation of the Cholesky Banachiewicz algorithm, i.e. proceeding row by row from the upper-left corner.i{Given a matrix A, returns a pair of matrices (L, U) where L is lower triangular and U is upper triangular such that L U = Aj4Given a matrix A, a vector b and a positive integer n-, this procedure finds the basis of an order n Krylov subspace (as the columns of matrix Q), along with an upper Hessenberg matrix H, such that A = Q^T H Q. At the i`th iteration, it finds (i + 1) coefficients (the i`th column of the Hessenberg matrix H) and the (i + 1)`th Krylov vector.kWPartition a matrix into strictly subdiagonal, diagonal and strictly superdiagonal partslAThe Jacobi preconditioner is just the reciprocal of the diagonal m+Used for Incomplete LU : remove entries in m" corresponding to zero entries in m29 (this is called ILU(0) in the preconditioner literature)nSymmetric Successive Over-Relaxation. `mSsor aa omega` : if `omega = 1` it returns the symmetric Gauss-Seidel preconditioner. When  = 1, the SOR reduces to Gauss-Seidel; when  > 1 and  < 1, it corresponds to over-relaxation and under-relaxation, respectively.oGDirect solver based on a triangular factorization of the system matrix.pForward substitution solverqBackward substitution solver<&Given a linear system `A x = b` where AR is an (m x m) real-valued matrix, the GMRES method finds an approximate solution xhatI such that the Euclidean norm of the residual `A xhat - b` is minimized. xhat is spanned by the order-n Krylov subspace of (A, b). In this implementation: 1) the Arnoldi iteration is carried out until numerical breakdown (therefore yielding _at_most_ `m+1` Krylov basis vectors) 2) the resulting Hessenberg matrix H is factorized in QR form (H = Q R) 3) the Krylov-subspace solution yhato is found by backsubstitution (since R is upper-triangular) 4) the approximate solution in the original space xhat6 is computed using the Krylov basis, `xhat = Q_n yhat`Many optimizations are possible, for example interleaving the QR factorization (and the subsequent triangular solve) with the Arnoldi process (and employing an updating QR factorization which only requires one Givens' rotation at every update). rGLeast-squares approximation of a rectangular system of equaitons. Uses  \ for the linear solves-Interface method to individual linear solvers={TODO : if system is poorly conditioned, is it better to warn the user or just switch solvers (e.g. via the pseudoinverse) ?F[\]^_`>?@ABCDEFGHIJKLMNOPQRST9abcdU:efPrint debug information Operand matrix Eigenvaluesg;Q, O, RVhLiL, Uj System matrixr.h.s.Max. # of iterationsQ, Hk/Subdiagonal, diagonal, superdiagonal partitionslmL, U (with holes)nrelaxation factorLeft, right factorsoLower triangularUpper triangularr.h.s.pLower triangularqUpper triangular<WXYZ[\]^rs=_tuvwxy+:[`^_\]abcdefghijklmnopqrs+s[\]^_`:rlmnopqfgeihjkdabc.[\]^_`>?@ABCDEFGHIJKLMNOPQRST9abcdU:efg;Vhijklmnopq<WXYZ[\]^rs=_tuvwxy` !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                        !"#$%&'()*+*,-./01234567889:;<=>?@ABCDEFGHIJKLLMNOPPQRSTUUVWXYZ[[\]^_`abcdefghij2sparse-linear-algebra-0.2.9-CExGnDw43po50YVxb8qH8t Numeric.EpsNumeric.LinearAlgebra.ClassControl.Exception.CommonNumeric.LinearAlgebra.SparseData.Sparse.SpVectorData.Sparse.SpMatrixData.Sparse.CommonData.Sparse.UtilsData.Sparse.TypesData.Sparse.PPrintData.Sparse.Internal.UtilsData.Sparse.Internal.IntMData.Sparse.Internal.IntMap2Control.Iterative/Numeric.LinearAlgebra.EigenSolvers.Experimental0Numeric.LinearAlgebra.LinearSolvers.ExperimentalEpsilonnearZeronearOneisNz roundZeroroundOne roundZeroOne$fEpsilonComplex$fEpsilonComplex0$fEpsilonComplex1$fEpsilonComplex2$fEpsilonCDouble$fEpsilonCFloat$fEpsilonDouble$fEpsilonFloat SparseMatrix smFromVector smTransposeencodeIxdecodeIx SparseVectorSpvIx svFromListsvFromListDensesvConcat SpContainer'ScIx' scInsert' scLookup' scToList' SpContainerScIxscInsertscLookupscToList@@SetliftU2liftI2Sparse'spy'SparsespyHasData'HDDnnz'dat'HasDataHDDatannzdat FiniteDim'FDSize'dim' FiniteDimFDSizedim LinearSystem<\>VLinearVectorSpace MatrixType#><# MatrixRing MatrixNorm####^#^# transpose normFrobeniusNormed Magnitude RealScalarnorm1norm2SqnormP normalize normalize2 normalize2'norm2norm2'normEltEltMagconjmag.*./lerpdot hilbertDistSq normInftyR normInftyCdotLp reciprocalscaletoC$fNormedComplex$fNormedDouble $fEltComplex $fEltFloat $fEltDoubleIterationException NotConvergedE DivergingEMatrixExceptionHugeConditionNumber NeedsPivotingOperandSizeMismatchDotSizeMismatchNonTriangularExceptionMatVecSizeMismatchExceptionOutOfBoundsIndexError OOBIxError OOBIxsErrorOOBNoCompatRows InputError NonNegErrorPartialFunctionError EmptyList checkIxBound$fExceptionIterationException$fShowIterationException$fExceptionMatrixException$fShowMatrixException$fExceptionOperandSizeMismatch$fShowOperandSizeMismatch $fExceptionOutOfBoundsIndexError$fShowOutOfBoundsIndexError$fExceptionInputError$fShowInputError$fExceptionPartialFunctionError$fShowPartialFunctionError$fEqPartialFunctionError$fEqInputError$fEqOutOfBoundsIndexError$fEqOperandSizeMismatch$fEqMatrixException$fEqIterationExceptionIterationConfigIterConfnumIterationsMaxprintDebugInfo iterationView printDebugIO modifyUntil modifyUntilMuntilConvergedG0untilConvergedGuntilConvergedGMmodifyInspectGuardedmodifyInspectGuardedMSpVectorSVsvDimsvDataspySVnzSV sizeStrSVdotSdotSSafezeroSV singletonSVei mkSpVector mkSpVector1mkSpVRmkSpVCfromListDenseSVspVectorDenseIxspVectorDenseLoHi oneHotSVUoneHotSVonesSVzerosSV fromVectortoVector toVectorDenseinsertSpVectorinsertSpVectorSafe fromListSVtoListSV toDenseListSVifoldSVlookupSVlookupDefaultSV lookupDenseSVtailSVheadSVtakeSVdropSVrangeSVconcatSVfilterSV ifilterSV sparsifySV orthogonalSV$fNormedSpVector$fNormedSpVector0$fInnerSpaceSpVector$fInnerSpaceSpVector0$fVectorSpaceSpVector$fVectorSpaceSpVector0$fAdditiveGroupSpVector$fAdditiveGroupSpVector0$fSpContainerSpVectora$fSparseSpVectora$fHasDataSpVectora$fFiniteDimSpVector$fFoldableSpVector $fSetSpVector$fFunctorSpVector$fShowSpVector $fEqSpVectorMatProd_ABABtSMInfosmNzsmSpySpMatrixSMsmDimsmDatasizeStrzeroSM mkDiagonaleye permutationSM permutPairsSM mkSubDiagonalinsertSpMatrix fromListSM' fromListSMmkSpMRmkSpMCfromListDenseSMtoListSM toDenseListSMlookupSM lookupWD_SM@@!filterSMextractSubDiagextractSuperDiag extractDiagextractSubmatrixSMextractSubmatrixRebalanceKeysextractSubmatrixtakeRowstakeCols extractColSMextractSubColSMextractSubColSM_RK isValidIxSM isSquareSM isDiagonalSM isLowerTriSM isUpperTriSMisOrthogonalSMimmSMdimSMnelSMnrowsncolsinfoSMnzSMspySMnzRowbwMinSMbwMaxSM bwBoundsSM vertStackSM-=- horizStackSM-||-fromBlocksDiag ifilterSMfoldlSMifoldlSMcountSubdiagonalNZSMsubdiagIndicesSM sparsifyIM2 sparsifySMroundZeroOneSM modifyKeysSM' modifyKeysSMswapRows swapRowsSafe transposeSM hermitianConjmatScaletracenormFrobeniusSMnormFrobeniusSMCmatMat_matMatUnsafeWithmatMatSparsified#~##~^##~#^ contractSub$fMatrixRingSpMatrix$fMatrixRingSpMatrix0$fSpContainerSpMatrixa$fSparseSpMatrixa$fHasDataSpMatrixa$fFiniteDimSpMatrix$fAdditiveGroupSpMatrix $fSetSpMatrix$fShowSpMatrix $fEqSpMatrix$fFunctorSpMatrix$fFoldableSpMatrix $fEqSMInfo $fShowSMInfo $fEqMatProd_$fShowMatProd_ insertRowWith insertRow insertColWith insertCol outerProdSV>< diagonalSMsvToSMtoSV lookupRowSM extractRow extractColextractVectorDenseWithextractRowDenseextractColDenseextractDiagDense extractSubRowextractSubRow_RK extractSubColextractSubCol_RK fromColsLtoColsfromCols$fPrintDenseSpMatrix$fPrintDenseSpVector$fLinearVectorSpaceSpVector$fLinearVectorSpaceSpVector0LinSolveMethodGMRES_CGNE_BCG_CGS_ BICGSTAB_conditionNumberSMhhMathhReflgivensqreigsQR eigRayleighcholluarnoldidiagPartitions jacobiPreilu0mSsorluSolve triLowerSolve triUpperSolvepinv linSolve0$fLinearSystemSpVector$fLinearSystemSpVector0$fShowBICGSTAB $fShowCGS $fShowBCG $fShowCGNE$fEqCGNE$fEqBCG$fEqCGS $fEqBICGSTAB$fEqLinSolveMethod$fShowLinSolveMethodbaseGHC.Numabsghc-prim GHC.Classes<= withDefault with2DefaultsW3harnessmaxTupminTup denseIxArray denseIxArray2foldrMap foldlStrictifoldrUBLBinBounds inBounds2 inBounds0 inBounds02head'tail'initW3pushW3fstW3sndW3thirdW3 withInitW3 withTailW3initSafeLexOrd RowsFirst ColsFirstLexIxIxColIxRowColsRowsCunC PPrintOptions pprintDigitspprintDecimals PrintDenseprdnewline printfDoublepprintDefaults$fShowCStreamcsrPtrV intersectWith unionWith MergeStateMergeLMergeRMergeLeftEndedMergeRightEnded MergeStartStepYieldSkipDonenumLoop numLoopST' numLoopST''intersectWithCompareunionWithComparesortWith sortWith3 sortByFst3 sortBySnd3fst3snd3third3tail3mapFst3mapSnd3 mapThird3lift2mergeStreamsWith isOrderedVIntM$fVectorSpaceIntM0 $fNormedIntM0unIMemptysize singleton filterWithKeyinsertfilterIlookuplookupLT foldlWithKey foldlWithKey' mapWithKeykeysmapKeysunionfindMinfindMax!mkImmkImC$fInnerSpaceIntM$fInnerSpaceIntM0$fVectorSpaceIntM $fNormedIntM$fAdditiveGroupIntM $fSetIntM $fIsListIntM insertIM2 lookupIM2 lookupWD_IM fromListIM2 ifoldlIM2' ifoldlIM2foldlIM2 transposeIM2 ifilterIM2 filterSubdiagsubdiagIndicesmapIM2imapIM2 mapKeysIM2countSubdiagonalNZrpairs mapColumnIM2 onRangeSparseonRangeSparseMcombxdiffSqLrelTolSunS1unS2ConvergenceStatusBufferNotReady Converging Converged Diverging NotConverged unfoldZipM0 unfoldZipMqdiverg norm2DiffliftS1s0ic1$fShowIterationConfigGHC.ListtakedropresizeSV mapKeysSVvecMatSDmatVecSDshowNz toDenseRowtoDenseRowClip printDenseSMtoDenseListClip printDenseSV gklBidiagTFQMR_xTfq_wTfq_uTfq_vTfq_dTfq_mTfq_tauTfq _thetaTfq_etaTfq_rhoTfq _alphaTfq tfqmrInit tfqmrStep $fShowTFQMRNum' givensCoef eigArnoldigmresaa4BICGSTAB _xBicgstab _rBicgstab _pBicgstabCGS_x_r_p_uBCG_xBcg_rBcg_rHatBcg_pBcg_pHatBcgCGNE_xCgne_rCgne_pCgnerotMathhVcgneInitcgneStepbcgInitbcgStepcgsInitcgsStep bicgsInit bicgstabStepaa4c