f      !"#$%&'()*+,-./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.Is this quantity close to 1 ?)Is this quantity distinguishable from 0 ?Round 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"+'Sparsity (fraction of nonzero elements)2Number of nonzeros9:Dimension (i.e. Int for SpVector, (Int, Int) for SpMatrix);>Solve a linear system; uses GMRES internally as default method?Matrix-vector action@Dual matrix-vector actionA}A matrix ring is any collection of matrices over some ring R that form a ring under matrix addition and matrix multiplicationCMatrix-matrix productDA B^TEA^T BF:Matrix transpose (Hermitian conjugate in the Complex case)GFrobenius normKL1 normLEuclidean (L2) norm squaredMLp norm (p > 0)NNormalize w.r.t. Lp normONormalize w.r.t. L2 normP(Normalize w.r.t. norm2' instead of norm2QEuclidean (L2) normRMEuclidean (L2) norm; returns a Complex (norm :+ 0) for Complex-valued vectorsSLp norm (p > 0)VCComplex conjugate, or identity function if its input is real-valuedW MagnitudeXScale a vector YEScale a vector by the reciprocal of a number (e.g. for normalization)Z,Convex combination of two vectors (NB: 0 <= a <= 1). [ 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)` ReciprocalaScaleb)Lift a real number onto the complex planeX !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgS !"#$%'&()*+,-./0123456789:;<=>@?ABCFEDGHJISQRNOPKLMTUVWXYZ[\]^_`abXTUVWgfeXYZ[\HIJKLMNOPQRS]^dc_`aABCDEFG=>?@<:;7894560123,-./*+()%&' !"#$b! !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH IJKLMNOPQRSTUVWXYZ[\]^_`abcdefg (C) 2016 Marco ZoccaGPL-3 (see LICENSE)zocca.marco gmail provisionalportableSafePretty printing options:  of integer digits,  of decimal digitsh&Pretty-print with a descriptive headeriPretty-print with no headerQprintf format string prepD :: (Ord t, Epsilon t) => PPrintOptions -> t -> String"printf format string for a Complexprintf for a list of values !printDN prepD (PPOpts 1 3) [1,pi]!printf for list of complex values 0printCN pdef [(1:+pi), (3.5:+4.3), (pi:+(-3.4))]hi ih hi 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)               None2 CSB Block\Invariants : 1) rowIx, colIx and val have same length 2) " have at most (bRows x bCols) NZNonejNumerical iteration errorsmMatrix exceptionspOperand size mismatch errorstOut of bounds index errorx Input errorjklmnopqrstuvwxyz{|}~jklmnopqrstuvwxyz{|z{xytuvw|pqrsmnojkl~}jklmnopqrstuvwxyz{|}~(c) Marco Zocca 2017 GPL-style (see the file LICENSE)zocca marco gmail experimentalportableNone2:Iprint function for type bMax.# of iterationsPrint iteration info to stdout Project state to a type b5modifyUntil with optional iteration logging to stdout 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 qf of the latest 2 with that of the previous two in order to assess divergence (e.g. if `q latest2 > q prev2` then the function throws an exception and terminates). The process ends by either hitting an iteration budget or by relative convergence, whichever happens first. After the iterations stop, the function then assesses the final state with a predicate qfinalw (e.g. for comparing the final state with a known one; if this is not available, 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)*+,-./0% !"#$%&'()*+,-./ !"#$%&'()*+,-./0(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`s#DENSE vector with constant elements3Populate a SpVector with the contents of a Vector. jPopulate a Vector with the entries of a SpVector, discarding the indices (NB: loses sparsity information).VPopulate 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 entriesSCreate new SpVector using data from a Foldable (e.g. a list) in (index, value) form Create a dense! SpVector from a list of Double's Create a dense) SpVector from a list of Complex Double's&Populate a list with SpVector contentsTo 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 1 for lists)LDiscard the first n components of the SpVector and rebalance the keys (like 2 for lists)2Keep the first n components of the SpVector (like 1 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 vectorsA1A>(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)VCreate new SpMatrix using data from a Foldable (e.g. a list) in (row, col, value) formECreate 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 columnsNumber of rowsNumber 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 SpMatrix Indexed left fold over SpMatrix!Count sub-diagonal nonzeros"`Filter the index subset that lies below the diagonal (used in the QR decomposition, for example)$Sparsify an SpMatrix%3Round almost-0 and almost-1 to 0 and 1 respectively&Modify (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 trace1'Matrix product without dimension checks2Removes all elements x for which `| x | <= eps`)3Removes all elements x for which `| x | <= eps`)4A B^T5A^T B6 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] 9ces are sparse containers too, i.e. any specific component may be missing (so it is assumed to be 0)<-es are maps between finite-dimensional spaces=bes form an additive group, in that they can have an invertible associtative operation (matrix sum)b      !"#$%&'()*+,-./0123456789:;<=>?Y      !"#$%&'()*+,-./0123456b?>=<;:9      !"#$%&'()*+,-./870123546Z      !"#$%&'()*+,-./0123456789:;<=>?(C) 2016 Marco ZoccaGPL-3 (see LICENSE)zocca.marco gmail provisionalportableNone %&9:;DQR32Modify the size of a SpVector. Do not use directly41Remap the keys of a SpVector. Do not use directlyGAInsert row , using the provided row index transformation functionHInsert row ICInsert column, using the provided row index transformation functionJ Insert columnK Outer productL Outer productMAFill the diagonal of a SpMatrix with the components of a SpVectorNpromote a SV to SMO.Demote (n x 1) or (1 x n) SpMatrix to SpVectorPRLookup a row in a SpMatrix; returns an SpVector with the row, if this is non-emptyQExtract ith rowRExtract jth columnSGeneric extraction functionTExtract ith row (dense)UExtract jth columnVExtract the diagonalW&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.X>extract row interval, rebalance keys by subtracting lowest oneYextract column intervalZAextract column interval, rebalance keys by subtracting lowest one5>Vector-on-matrix (FIXME : transposes matrix: more costly than matVec , I think)[/Pack a list of SpVectors as rows of an SpMatrix\/Pack a list of SpVectors as columns an SpMatrix]7Unpack the rows of an SpMatrix into a list of SpVectors^:Unpack the columns of an SpMatrix into a list of SpVectors_6Pack a V.Vector of SpVectors as columns of an SpMatrix`3Pack a V.Vector of SpVectors as rows of an SpMatrix*34GHIJKLMNOPQRSTUVWXYZ65[\]^_`789:;<=>abcd+ !"#$%'&()*+,-./0123456789:;<=>@?ABCFEDGHJISQRNOPKLMTUVWXYZ[\]^_`abhi      !"#$%&'()*+,-./0123456GHIJKLMNOPQRSTUVWXYZ[\]^_`GHIJMKLONPRQSTUVWYXZ[`_\]^*34GHIJKLMNOPQRSTUVWXYZ65[\]^_`789:;<=>abcdNone:DR?`eigRayleigh 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.@kGolub-Kahan-Lanczos bidiagonalization (see "Restarted Lanczos Bidiagonalization for the SVD", SLEPc STR-8,  ,http://slepc.upv.es/documentation/manual.htm )?@?@?@None:DRABCDEFGHIJKLMNOPABCDEFGHIJKLMNOA BCDEFGHIJKLMNOPNone *.9:;<=DRe$Iterative methods for linear systemsQ'A lumped constraint for numerical typesknMatrix condition number: computes the QR factorization and extracts the extremal eigenvalues from the R factorl!Householder reflection: a vector xw uniquely defines an orthogonal (hyper)plane, i.e. an orthogonal subspace; the Householder operator reflects any point v- through this subspace: v' = (I - 2 x >< x) vmGivens' method, row version: given a row, column pair (i,j), choose a row index i' distinct from i such that : * i' is below the diagonal * the corresponding element is nonzero 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 column indices < j. NB: The Givens' matrix differs from Identity in 4 entries (geometrically, it is a planar rotation embedded in R^n) NB2: The form of a Complex rotation matrix is as follows (RM indicates complex conjugation): ( c s ) G =( ) ( -s* c*)S1Givens coefficients and norm of associated vectornGiven 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.NB: at each iteration i we multiply the Givens matrix G_i by the previous partial result M0. Since this corresponds to a rotation, and the SQ function already computes the value of the resulting non-zero component (output r@), `G_i ## M` can be simplified by just updating two entries of M3 (i.e. zeroing one out and changing the other into r).%However, we must also accumulate the G_i in order to build Q>, and the present formulation follows this definition closely.o`eigsQR n mm` performs at most n* iterations of the QR algorithm on matrix mm4, and returns a SpVector containing all eigenvalues.p:`eigsArnoldi n aa b` computes at most n iterations of the Arnoldi algorithm to find a Krylov subspace of (A, b), denoted Q, along with a Hessenberg matrix of coefficients H. After that, it computes the QR decomposition of H, denoted (O, R) and the eigenvalues {_i} of A are listed on the diagonal of the R factor.q*Given 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. | NB: The algorithm throws an exception if some diagonal element of A is zero.rGiven a matrix A, returns a pair of matrices (L, U) where L is lower triangular and U is upper triangular such that L U = A . Implements the Doolittle algorithm, which sets the diagonal of the L matrix to ones and expects all diagonal entries of A to be nonzero. Apply pivoting (row or column permutation) to enforce a nonzero diagonal of the A matrix (the algorithm throws an appropriate exception otherwise).s4Given 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.tWPartition a matrix into strictly subdiagonal, diagonal and strictly superdiagonal partsuAThe Jacobi preconditioner is just the reciprocal of the diagonal vUsed for Incomplete LU : remove entries in the output matrix corresponding to zero entries in the input matrix (this is called ILU(0) in the preconditioner literature)wSymmetric 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.xGDirect solver based on a triangular factorization of the system matrix.yForward substitution solverzBackward substitution solverT&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`A common optimization involves 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). {ALeast-squares approximation of a rectangular system of equations.|BInterface method to individual linear solvers, do not use directlyU{TODO : if system is poorly conditioned, is it better to warn the user or just switch solvers (e.g. via the pseudoinverse) ?KefghijVWXYZ[\]^_`abcdefghijklQkmlmSnnQ, RopoMax. # of iterationsPrint debug information Operand matrixEigenvalues {_i}p Q, O, {_i}qqLrL, Urstus System matrixr.h.s.Max. # of iterationsQ, Ht/Subdiagonal, diagonal, superdiagonal partitionsuvL, U (with holes)wrelaxation factorLeft, right factorsxLower triangularUpper triangularr.h.s.yLower triangularr.h.szUpper triangularr.h.sTvwxyz{|}{|U~}~]+29;@?GFDECKPONRQSXYZ\ihjmptxz-345L[\]^_`efghijklmnopqrstuvwxyz{|];uvw{xyzopnrqstmkl[]\^`_XY?@CED345L92+ZSQRNOPK\F-Ghi|efghijzxtpmj3efghijVWXYZ[\]^_`abcdefghijklQkmlmSnnopopqqrrstustuvwxyzTvwxyz{|}{|U~}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{ | }~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                      ! " #$%&'()*+,-./01223456789:;<=>?@ABCDEDFGHIJKLMNOPQRSTUUVWXYZ[\]^_`abcdefghiijklmmnopqrrstuvwxxyz{|}~3sparse-linear-algebra-0.2.9.6-PzREfEXR3HC7Ts9A1JMRvNumeric.LinearAlgebra.Sparse Numeric.EpsNumeric.LinearAlgebra.ClassControl.Exception.CommonData.Sparse.SpVectorData.Sparse.SpMatrixData.Sparse.CommonData.Sparse.UtilsData.Sparse.TypesData.Sparse.PPrintData.Sparse.Internal.UtilsData.Sparse.Internal.IntMData.Sparse.Internal.IntMap2Data.Sparse.Internal.CSBControl.Iterative/Numeric.LinearAlgebra.EigenSolvers.Experimental0Numeric.LinearAlgebra.LinearSolvers.Experimental*vector-space-0.10.4-A56L7Qcw0eqD6V31bcyl8HData.VectorSpace<.>EpsilonnearZeronearOneisNz 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.*./cvxdot hilbertDistSq normInftyR normInftyCdotLp reciprocalscaletoC$fNormedComplex$fNormedDouble $fEltComplex $fEltFloat $fEltDoubleprdprd0IterationException 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 oneHotSVUoneHotSVonesSVzerosSVconstv fromVectortoVector toVectorDenseinsertSpVectorinsertSpVectorSafe fromListSVcreatevvrvctoListSV 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 fromRowsL fromColsLtoRowsLtoColsL fromColsV fromRowsV$fPrintDenseSpMatrix$fPrintDenseSpVector$fLinearVectorSpaceSpVector$fLinearVectorSpaceSpVector0LinSolveMethodGMRES_CGNE_BCG_CGS_ BICGSTAB_conditionNumberSMhhReflgivensqreigsQR eigsArnoldicholluarnoldidiagPartitions jacobiPreilu0PremSsorPreluSolve triLowerSolve triUpperSolvepinv linSolve0$fLinearSystemSpVector$fLinearSystemSpVector0$fShowBICGSTAB $fShowCGS $fShowBCG $fShowCGNE$fEqCGNE$fEqBCG$fEqCGS $fEqBICGSTAB$fEqLinSolveMethod$fShowLinSolveMethodbaseGHC.Numabsghc-prim GHC.Classes<= withDefault with2DefaultsW3harnessmaxTupminTupindexedindexed2foldrMap foldlStrictifoldrUBLBindexed'inBounds inBounds2 inBounds0 inBounds02head'tail'initW3pushW3fstW3sndW3thirdW3 withInitW3 withTailW3initSafeLexOrd RowsFirst ColsFirstLexIxIxColIxRowColsRows PPrintOptionsprepDprepCprintDNprintCNPPOpts pprintInt pprintDec PrintDensenewlineprdefcommasreaimStreamcsrPtrV 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 CsbMatrixCSBcsbNrowscsbNcolscsbVal csbRowPtrcsbRowIxcsbColIx modifyUntil' onRangeSparseonRangeSparseMcombxdiffSqLrelTolSunS1unS2ConvergenceStatusBufferNotReady Converging Converged Diverging NotConverged modifyUntilM' unfoldZipM0 unfoldZipMqdiverg norm2DiffliftS1s0ic1$fShowIterationConfigGHC.ListtakedropresizeSV mapKeysSVvecMatSDmatVecSDshowNz toDenseRowtoDenseRowClip printDenseSM printDenseSM0toDenseListClip printDenseSV printDenseSV0 eigRayleigh gklBidiagTFQMR_xTfq_wTfq_uTfq_vTfq_dTfq_mTfq_tauTfq _thetaTfq_etaTfq_rhoTfq _alphaTfq tfqmrInit tfqmrStep $fShowTFQMRNum'* givensCoefgmresaa4BICGSTAB _xBicgstab _rBicgstab _pBicgstabCGS_x_r_p_uBCG_xBcg_rBcg_rHatBcg_pBcg_pHatBcgCGNE_xCgne_rCgne_pCgnehhMathypotqr'tm2hhVlu'tmc4tvc4tmc5cgneInitcgneStepbcgInitbcgStepcgsInitcgsStep bicgsInit bicgstabStepaa4c