)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( Safe eps = 1e-8  Rounding rule Rounding ruleKRound to respectively 0 or 1 within some predefined numerical precision epsSafe IComponentwise tuple operations TODO : use semilattice properties instead IComponentwise tuple operations TODO : use semilattice properties instead integer-indexed ziplist  ", 2d arrays foldr over the results of a fmapstrict left foldindexed right fold        SafeSafe<=DR#9union binary lift : apply function on _union_ of two Sets$Gintersection binary lift : apply function on _intersection_ of two Sets0 inner product2multiplication by a scalar4Ring zero element5Ring +6negate the values in a functor7subtract two Additive objects8linear interpolation9#`hilbertDistSq x y = || x - y ||^2`:Squared 2-norm;L1 norm<Euclidean norm=Lp norm (p > 0)> Infinity-norm?"Normalize w.r.t. p-norm (p finite)@Lp inner product (p > 0)A ReciprocalBScaleC unary dimension-checking bracketD!binary dimension-checking bracket, !"#$%&'()*+,-./0123456789:;<=>?@ABCD, !"#$%&'()*+,-./0123456789:;<=>?@ABCD,34567128/09-.:;<=>?@AB*+,CD'()%&"#$ ! !"#$%&'()*+,-./0123456789:;<=>?@ABCDSafeE === IntMap-of-IntMap (IM2) stuffHfoldingL filteringQmappingEFGHIJKLMNOPQRSTUVWXYEFGHIJKLMNOPQRSTYXWVUEFGHIJKLMNOPQRSTEFGHIJKLMNOPQRSTUVWXYSafe9;<=DR^SpVector sparsity_*empty sparse vector (length n, no entries)`"singleton sparse vector (length 1)aQcreate a sparse vector from an association list while discarding all zero entriesb3", from logically dense array (consecutive indices)d>Create new sparse vector, assumin 0-based, contiguous indexinge_one-hot encoding : `oneHotSV n k` produces a SpVector of length n having 1 at the k-th positiongDENSE vector of `1`shDENSE vector of `0`siinsert element x at index i in a preexisting SpVectorlTo dense list (default = 0)mLookup an index in a SpVectorn7Lookup an index, return a default value if lookup failso8Lookup an index in a SpVector, returns 0 if lookup failsp Tail elementsq Head elementrConcatenate two sparse vectorssFiltertIndexed filteru*Generate an arbitrary (not random) vector u such that `v dot u = 0`'Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Z[\]^_`abcdefghijklmnopqrstu'Z[\]^~}|{zyxw_`abcdefghijklvmnopqrstu$Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Safe9;<=DR(,`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,1xPermutation matrix from a (possibly incomplete) list of row pair swaps e.g. `permutPairs 5 [(2,4)]` swaps rows (2, 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 elementsHPopulate 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)Zero-default lookup, infix form`Looks up an element in the matrix with a default (if the element is not found, zero is returned)4Extract a submatrix given the specified index bounds.Are the supplied indices within matrix bounds?Is the matrix square?Is the matrix diagonal?,is the matrix orthogonal? i.e. Q^t ## Q == I/Data in internal representation (do not export)#(Number of rows, Number of columns)&Number of rows times number of columnsNumber of rowsNumber of columnsVertical stackingVertical stackingHorizontal stackingHorizontal stackingLeft 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 respectively0swap two rows of a SpMatrix (bounds not checked).swap two rows of a SpMatrix (bounds checked) $transposeSM, (#^) : Matrix transpose$transposeSM, (#^) : Matrix transposeRemoves all elements x for which `| x | <= eps`)Removes all elements x for which `| x | <= eps`)A^T BA B^TIBICSafe promote a SV to SM.Demote (n x 1) or (1 x n) SpMatrix to SpVector+Extract jth column, and place into SpVector(Extract ith row, and place into SpVector3Extract the diagonal as a SpVector (with default 0)Matrix-on-vectorMatrix-on-vector>Vector-on-matrix (FIXME : transposes matrix: more costly than  , I think)>Vector-on-matrix (FIXME : transposes matrix: more costly than  , I think)   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTZ[\]^_`abcdefghijklmnopqrstu None 9:;<=DRSparsify an SpVector+uses the R matrix from the QR factorization 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) vGivens coefficients (using stable algorithm shown in Anderson, Edward (4 December 2000). "Discontinuous Plane Rotations and the Symmetric Eigenvalue Problem". LAPACK Working Note)zGivens 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.Is the k'th the first nonzero column in the row?,Returns a set of rows {k} that satisfy QR.C1EApplies Givens rotation iteratively to zero out sub-diagonal elements,Givens matrices in order [G1, G2, .. , G_N ]`eigsQR n mm` performs n* iterations of the QR algorithm on matrix mm `eigsRayleigh n mm` performs n0 iterations of the Rayleigh algorithm on matrix mm[. Cubic-order convergence, but it requires a mildly educated guess on the initial eigenpairone step of BCGone step of CGSHiterate solver until convergence or until max # of iterations is reachedone step of BiCGSTABHiterate solver until convergence or until max # of iterations is reachedGLeast-squares approximation of a rectangular system of equaitons. Uses  \ for the linear solveKLinear solve with _deterministic_ starting vector (every component at 0.1)   \0 : linSolve using the BiCGSTAB method as default (transform state until a condition is met 0Keep a moving window buffer (length 2) of state xw to assess convergence, stop when either a condition on that list is satisfied or when max # of iterations is reached  0Keep a moving window buffer (length 2) of state x to assess convergence, stop when either a condition on that list is satisfied or when max # of iterations is reached (i.e. same thing as  & but this one runs in the State monad)Oiterate until convergence is verified or we run out of a fixed iteration budgetconvergence check (FIXME)run niter! iterations and append the state x to a list xs, stop when either the xs satisfies a predicate q or when the counter reaches 0", NO convergence check Dense SpMatrixDense SpVector Sparse SpMatrixSparse SpVectorK      !"#F     K#"!      8      !"#)     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                             ! " # $ % & ' ( ) * + , - ./4sparse-linear-algebra-0.2.0.5-7Ge4u09xnaS3eqRrUXSovK Numeric.EpsData.Sparse.UtilsNumeric.LinearAlgebra.DataNumeric.LinearAlgebra.Class#Numeric.LinearAlgebra.Sparse.IntMapData.Sparse.SpVectorData.Sparse.SpMatrixData.Sparse.CommonNumeric.LinearAlgebra.Sparseeps almostZero almostOne withDefault roundZeroroundOne with2Defaults roundZeroOneUBLBmaxTupminTup denseIxArray denseIxArray2foldrMap foldlStrictifoldrinBounds inBounds2 inBounds0 inBounds02IxColIxRowColsRows IxContainerIx ixcLookupixcLookupDefault ixcFilter ixcIfilter ixcInsert ixcFromList ixcToListSetliftU2liftI2SparsespyHasDataHDDatadat FiniteDimFDSizedimNormednormHilbertdot VectorSpace.*Additivezero^+^negated^-^lerp hilbertDistSqnormSqnorm1norm2normP normInfty normalizedotLp reciprocalscalewithDimwithDim2 insertIM2 lookupIM2 fromListIM2 ifoldlIM2' ifoldlIM2foldlIM2 transposeIM2 ifilterIM2 filterSubdiagcountSubdiagonalNZsubdiagIndicesrpairsmapIM2imapIM2 mapKeysIM2 mapColumnIM2$fNormedIntMap$fHilbertIntMap$fVectorSpaceIntMap$fAdditiveIntMap $fSetIntMapSpVectorSVsvDimsvDataspySVzeroSV singletonSV mkSpVector mkSpVectorD mkSpVector1fromListDenseSV oneHotSVUoneHotSVonesSVzerosSVinsertSpVector fromListSVtoListSV toDenseListSVlookupSVlookupDefaultSV lookupDenseSVtailSVheadSVconcatSVfilterSV ifilterSV orthogonalSV$fShowSpVector$fNormedSpVector$fHilbertSpVector$fSparseSpVectora$fHasDataSpVectora$fFiniteDimSpVector$fVectorSpaceSpVector$fAdditiveSpVector$fFoldableSpVector $fSetSpVector$fFunctorSpVector $fEqSpVectorSMInfosmNzsmSpySpMatrixSMsmDimsmDatasizeStrzeroSM mkDiagonaleye permutationSM permutPairsSM mkSubDiagonalinsertSpMatrix fromListSM' fromListSMfromListDenseSM toDenseListSMlookupSM lookupWD_SM lookupWD_IM@@extractSubmatrixSM extractColSM extractRowSM validIxSM isSquareSM isDiagonalSMisOrthogonalSMimmSMdimSMnelSMnrowsncolsinfoSMnzSMspySMnzRowbwMinSMbwMaxSM bwBoundsSM vertStackSM-=- horizStackSM-||-foldlSMifoldlSMcountSubdiagonalNZSMsubdiagIndicesSM sparsifyIM2 sparsifySMroundZeroOneSMswapRows swapRowsSafe transposeSM#^matScale normFrobeniusmatMat##matMatSparsified#~##^###^$fSparseSpMatrixa$fHasDataSpMatrixa$fFiniteDimSpMatrix$fAdditiveSpMatrix $fSetSpMatrix$fFunctorSpMatrix$fShowSpMatrix $fEqSpMatrix $fEqSMInfo $fShowSMInfosvToSM outerProdSV><toSV extractCol extractRowextractDiagonalDSMmatVec#>vecMat<# PrintDenseprdLinSolveMethodBCG_CGS_ BICGSTAB_BICGSTAB _xBicgstab _rBicgstab _pBicgstabCGS_x_r_p_uBCG_xBcg_rBcg_rHatBcg_pBcg_pHatBcg sparsifySVconditionNumberSMhhMathhReflhypotsign givensCoefgivensfirstNonZeroColumn candidateRowsqrgmatseigsQR eigRayleighhhVpermutAAbcgStepbcgcgsStepcgs bicgstabStepbicgstabpinvlinSolve<\> modifyUntil loopUntilAccmodifyInspectNmeanlnorm2ldiffSqLuntilConvergednormDiffConverged runAppendN runAppendN'randMatrandVec randSpMat randSpVec showNonZero toDenseRowtoDenseRowClipnewline printDenseSMtoDenseListClip printDenseSV$fPrintDenseSpMatrix$fPrintDenseSpVector$fShowBICGSTAB $fShowCGS $fShowBCG$fEqBCG$fEqCGS $fEqBICGSTAB$fEqLinSolveMethod$fShowLinSolveMethod