`R#"      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !Safe === IntMap-of-IntMap (IM2) stufffolding filtering mapping    None 9:;<=DRQ=== LINEAR SOLVERS INTERFACE)=== MATRIX METADATA*1=================================================.1================================================= Sparse Vector3union binary lift4intersection binary lift5Sparse : sparse datastructures7.HasData : accessing inner data (do not export):&FiniteDim : finite-dimensional objects?Hilbert space (inner product)@ inner productA Vector spaceBmultiplication by a scalarC!=== CLASSES and common operationsAdditive ring D zero elementEcomponentwise operationsGnegate the values in a functorIlinear interpolationX(empty sparse vector (size n, no entries)ZQcreate a sparse vector from an association list while discarding all zero entries[3", from logically dense array (consecutive indices)^DENSE vector of `1`s_DENSE vector of `0`sdlookupfSV manipulationhconcatenate SpVectoripromote a SV to SMjouter vector productkouter vector productl)TODO : use semilattice properties insteadm)TODO : use semilattice properties insteadnempty matrix of size dwnrows, ncols : size accessorsxnrows, ncols : size accessors~bandwidth bounds (min, max)=== SPARSE MATRIX BUILDERSfrom list (row, col, value)to List=== SUB-MATRICES=== MATRIX STACKING=== MATRIX STACKING === LOOKUPBLooks up an element in the matrix (if not found, zero is returned)BLooks up an element in the matrix (if not found, zero is returned)=== MISC SpMatrix OPERATIONSmapping folding filteringsparsify : remove 0s (!!!)ROUNDING operations (!!!)"=== ALGEBRAIC PRIMITIVE OPERATIONS transpose"=== ALGEBRAIC PRIMITIVE OPERATIONS transposeA^T BA B^Tmatrix action on a vectormatrix action on a vectormatrix-matrix product6sparsified matrix-matrix product (prunes all elements x for which `abs x <= eps`)6sparsified matrix-matrix product (prunes all elements x for which `abs x <= eps`)=== predicates=== condition number=== Householder transformation=== Givens rotation matrix=== QR algorithm=== Eigenvalues, using QR)=== Eigenvalues, using Rayleigh iteration4=== Householder vector (G & VL Alg. 5.1.1, function house)=== SVD1=================================================LINEAR SOLVERS : solve A x = b1numerical tolerance for e.g. solution convergence!residual of candidate solution x0CGSone step of CGSBiCSSTABone step of BiCGSTAB{TODO : if system is poorly conditioned, is it better to warn the user or just switch solvers (e.g. via the pseudoinverse) ?=== PRETTY PRINTING*Show details and contents of sparse matrix=rounding to 0 or 1 within some predefined numerical precision=rounding to 0 or 1 within some predefined numerical precision(transform state until a condition is metrandom matrices and vectors misc utilsinteger-indexed ziplistJterminate after n iterations or when q becomes true, whichever comes firstinstances for SpMatrix instances for SpVectorIntMap implementation1=================================================  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0124356789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ CDEFGHABI?@=>JKLMNOPQR:;<ST78956234./01UVW     XYZ[\]^_`abcdefghijk*+,-lmnop)('&qrstuvwx"#$%yz{|}~ ! !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     Safe!Add two " values.!leftrightsum!!!#      !"#$$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&4sparse-linear-algebra-0.1.0.0-3Utf0EzOizACEOiaTyY6BfMath.Linear.Sparse.IntMapMath.Linear.SparseLib insertIM2 lookupIM2 fromListIM2 ifoldlIM2' ifoldlIM2foldlIM2 transposeIM2 ifilterIM2 filterSubdiagcountSubdiagonalNZsubdiagIndicesrpairsmapIM2imapIM2 mapKeysIM2 mapColumnIM2UBLB PrintDenseprdLinSolveMethodCGS_ BICGSTAB_BICGSTAB _xBicgstab _rBicgstab _pBicgstabCGS_x_r_p_uSMInfosmNzsmSpyIxColIxRowColsRowsSpMatrixSMsmDimsmDataSpVectorSVsvDimsvDataSetliftU2liftI2SparsespyHasDataHDDatadat FiniteDimFDSizedimNormednormHilbertdot VectorSpace.*Additivezero^+^^-^negatedminuslerpnormSqnorm1norm2normP normInfty normalizedotLp reciprocalscalewithDimwithDim2dimSVspySVimSVzeroSV singletonSV mkSpVector mkSpVectorD mkSpVector1 mkSpVector1DonesSVzerosSVinsertSpVector fromListSVtoListSV toDenseListSV lookupDenseSVfindWithDefault0IMtailSVheadSVconcatSVsvToSM outerProdSV><maxTupminTup emptySpMatrixmatScale normFrobenius validIxSM isSquareSM isDiagonalSMimmSMdimSMnelSMnrowsncolsinfoSMnzSMspySMnzRowUnzRowbwMinSMbwMaxSM bwBoundsSMzeroSMinsertSpMatrix fromListSM' fromListSMfromListDenseSM toDenseListSM mkDiagonaleyeones mkSubDiagonalencodedecodeextractSubmatrixSM extractRowSM extractColSMtoSV extractCol extractRow vertStackSM-=- horizStackSM-||-lookupSM lookupWD_SM lookupWD_IM@@foldlSMifoldlSMcountSubdiagonalNZSMextractDiagonalDSMsubdiagIndicesSM sparsifyIM2 sparsifySMroundZeroOneSM transposeSM#^#^###^matVec#>vecMat<#matMatUmatMat##matMatSparsified#~#isOrthogonalSMconditionNumberSMhhMathhReflhypotsign givensCoefgivensfirstNonZeroColumn candidateRowsqrgmatseigsQR rayleighStep eigRayleighhhVepsresidual convergedcgsStepcgs bicgstabStepbicgstab linSolveMlinSolve<\>sizeStr showNonZero toDenseRowtoDenseRowClipnewline printDenseSMtoDenseListClip printDenseSV almostZero almostOne withDefault roundZeroroundOne with2Defaults roundZeroOne modifyUntil loopUntilAccmodifyInspectNmeanlnorm2ldiffSqLuntilConvergednormDiffConverged runAppendN runAppendN'randMatrandVec randSpMat randSpVec denseIxArray denseIxArray2foldrMap foldlStrictifoldrinBounds inBounds2 inBounds0 inBounds02tm0tv0tv1tm1tm1g1tm1a2tm1g2tm1a3tm1qtm2tm3tm3g1tm4untilC$fPrintDenseSpMatrix$fPrintDenseSpVector$fShowBICGSTAB $fShowCGS$fAdditiveSpMatrix $fSetSpMatrix$fFunctorSpMatrix$fShowSpMatrix$fShowSpVector$fNormedSpVector$fHilbertSpVector$fVectorSpaceSpVector$fAdditiveSpVector$fFoldableSpVector $fSetSpVector$fFunctorSpVector$fNormedIntMap$fHilbertIntMap$fVectorSpaceIntMap$fAdditiveIntMap $fSetIntMap$fSparseSpMatrixa$fSparseSpVectora$fHasDataSpMatrixa$fHasDataSpVectora$fFiniteDimSpMatrix$fFiniteDimSpVector $fEqSpVector $fEqSpMatrix $fEqSMInfo $fShowSMInfo$fEqCGS $fEqBICGSTAB$fEqLinSolveMethod$fShowLinSolveMethodourAddghc-prim GHC.TypesInt