-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Numerical computation in native Haskell -- -- Currently it provides iterative linear solvers, matrix decompositions, -- eigenvalue computations and related utilities. Please see README.md -- for details @package sparse-linear-algebra @version 0.2.0.2 module Numeric.LinearAlgebra.Sparse.IntMap -- |
=== IntMap-of-IntMap (IM2) stuff
insertIM2 :: Key -> Key -> a -> IntMap (IntMap a) -> IntMap (IntMap a) lookupIM2 :: Key -> Key -> IntMap (IntMap a) -> Maybe a fromListIM2 :: Foldable t => t (Key, Key, a) -> IntMap (IntMap a) -> IntMap (IntMap a) -- | folding ifoldlIM2' :: (Key -> Key -> a -> b -> b) -> b -> IntMap (IntMap a) -> b ifoldlIM2 :: (Key -> Key -> t -> IntMap a -> IntMap a) -> IntMap (IntMap t) -> IntMap a foldlIM2 :: (a -> b -> b) -> b -> IntMap (IntMap a) -> b transposeIM2 :: IntMap (IntMap a) -> IntMap (IntMap a) -- | filtering ifilterIM2 :: (Key -> Key -> a -> Bool) -> IntMap (IntMap a) -> IntMap (IntMap a) filterSubdiag :: IntMap (IntMap a) -> IntMap (IntMap a) countSubdiagonalNZ :: IntMap (IntMap a) -> Int subdiagIndices :: IntMap (IntMap a) -> [(Key, Key)] rpairs :: (a, [b]) -> [(a, b)] -- | mapping mapIM2 :: (a -> b) -> IntMap (IntMap a) -> IntMap (IntMap b) imapIM2 :: (Key -> Key -> a -> b) -> IntMap (IntMap a) -> IntMap (IntMap b) mapKeysIM2 :: (Key -> Key) -> (Key -> Key) -> IntMap (IntMap a) -> IntMap (IntMap a) mapColumnIM2 :: (b -> b) -> IntMap (IntMap b) -> Int -> IntMap (IntMap b) module Numeric.LinearAlgebra.Sparse class Functor f => Additive f -- | Ring zero element zero :: (Additive f, Num a) => f a -- | Ring + (^+^) :: (Additive f, Num a) => f a -> f a -> f a -- | negate the values in a functor negated :: (Num a, Functor f) => f a -> f a -- | subtract two Additive objects (^-^) :: (Additive f, Num a) => f a -> f a -> f a class Additive f => VectorSpace f -- | multiplication by a scalar (.*) :: (VectorSpace f, Num a) => a -> f a -> f a -- | linear interpolation lerp :: (VectorSpace f, Num a) => a -> f a -> f a -> f a class VectorSpace f => Hilbert f -- | inner product dot :: (Hilbert f, Num a) => f a -> f a -> a class Hilbert f => Normed f norm :: (Normed f, Floating a, Eq a) => a -> f a -> a -- | Squared 2-norm normSq :: (Hilbert f, Num a) => f a -> a -- | L1 norm norm1 :: (Foldable t, Num a, Functor t) => t a -> a -- | Euclidean norm norm2 :: (Hilbert f, Floating a) => f a -> a -- | Lp norm (p > 0) normP :: (Foldable t, Functor t, Floating a) => a -> t a -> a -- | Infinity-norm normInfty :: (Foldable t, Ord a) => t a -> a -- | Normalize w.r.t. p-norm (p finite) normalize :: (Normed f, Floating a, Eq a) => a -> f a -> f a -- | Lp inner product (p > 0) dotLp :: (Set t, Foldable t, Floating a) => a -> t a -> t a -> a -- | Reciprocal reciprocal :: (Functor f, Fractional b) => f b -> f b -- | Scale scale :: (Num b, Functor f) => b -> f b -> f b class Additive f => FiniteDim f where type FDSize f :: * where { type family FDSize f :: *; } dim :: FiniteDim f => f a -> FDSize f -- | unary dimension-checking bracket withDim :: (FiniteDim f, Show e) => f a -> (FDSize f -> f a -> Bool) -> (f a -> c) -> String -> (f a -> e) -> c -- | binary dimension-checking bracket withDim2 :: (FiniteDim f, FiniteDim g, Show e) => f a -> g b -> (FDSize f -> FDSize g -> f a -> g b -> Bool) -> (f a -> g b -> c) -> String -> (f a -> g b -> e) -> c class Additive f => HasData f a where type HDData f a :: * where { type family HDData f a :: *; } dat :: HasData f a => f a -> HDData f a class (FiniteDim f, HasData f a) => Sparse f a spy :: (Sparse f a, Fractional b) => f a -> b class Functor f => Set f -- | union binary lift : apply function on _union_ of two Sets liftU2 :: Set f => (a -> a -> a) -> f a -> f a -> f a -- | intersection binary lift : apply function on _intersection_ of two -- Sets liftI2 :: Set f => (a -> b -> c) -> f a -> f b -> f c data SpVector a SV :: Int -> IntMap a -> SpVector a [svDim] :: SpVector a -> Int [svData] :: SpVector a -> IntMap a -- | SpVector sparsity spySV :: Fractional b => SpVector a -> b -- | empty sparse vector (length n, no entries) zeroSV :: Int -> SpVector a -- | singleton sparse vector (length 1) singletonSV :: a -> SpVector a -- | create a sparse vector from an association list while discarding all -- zero entries mkSpVector :: (Num a, Eq a) => Int -> IntMap a -> SpVector a -- | ", from logically dense array (consecutive indices) mkSpVectorD :: (Num a, Eq a) => Int -> [a] -> SpVector a mkSpVector1 :: Int -> IntMap a -> SpVector a -- | Create new sparse vector, assumin 0-based, contiguous indexing fromListDenseSV :: Int -> [a] -> SpVector a -- | DENSE vector of `1`s onesSV :: Num a => Int -> SpVector a -- | DENSE vector of `0`s zerosSV :: Num a => Int -> SpVector a -- | insert element x at index i in a preexisting -- SpVector insertSpVector :: Int -> a -> SpVector a -> SpVector a fromListSV :: Int -> [(Int, a)] -> SpVector a toListSV :: SpVector a -> [(Key, a)] -- | To dense list (default = 0) toDenseListSV :: Num b => SpVector b -> [b] -- | lookup an index in a SpVector (returns 0 if lookup fails) lookupDenseSV :: Num a => Key -> SpVector a -> a -- | Tail elements tailSV :: SpVector a -> SpVector a -- | Head element headSV :: Num a => SpVector a -> a -- | concatenate two sparse vectors concatSV :: SpVector a -> SpVector a -> SpVector a -- | promote a SV to SM svToSM :: SpVector a -> SpMatrix a outerProdSV :: Num a => SpVector a -> SpVector a -> SpMatrix a (><) :: Num a => SpVector a -> SpVector a -> SpMatrix a data SpMatrix a SM :: (Rows, Cols) -> IntMap (IntMap a) -> SpMatrix a [smDim] :: SpMatrix a -> (Rows, Cols) [smData] :: SpMatrix a -> IntMap (IntMap a) -- | Componentwise tuple operations TODO : use semilattice properties -- instead maxTup :: Ord t => (t, t) -> (t, t) -> (t, t) -- | Componentwise tuple operations TODO : use semilattice properties -- instead minTup :: Ord t => (t, t) -> (t, t) -> (t, t) -- | Empty matrix of size d emptySpMatrix :: (Int, Int) -> SpMatrix a -- | Zero SpMatrix of size (m, n) zeroSM :: Int -> Int -> SpMatrix a mkDiagonal :: Int -> [a] -> SpMatrix a eye :: Num a => Int -> SpMatrix a mkSubDiagonal :: Int -> Int -> [a] -> SpMatrix a -- | Add to existing SpMatrix using data from list (row, col, value) fromListSM' :: Foldable t => t (IxRow, IxCol, a) -> SpMatrix a -> SpMatrix a -- | Create new SpMatrix using data from list (row, col, value) fromListSM :: Foldable t => (Int, Int) -> t (IxRow, IxCol, a) -> SpMatrix a -- | Create new SpMatrix assuming contiguous, 0-based indexing of elements fromListDenseSM :: Int -> [a] -> SpMatrix a -- | Populate list with SpMatrix contents and populate missing entries with -- 0 toDenseListSM :: Num t => SpMatrix t -> [(IxRow, IxCol, t)] -- | Insert an element in a preexisting Spmatrix at the specified indices insertSpMatrix :: IxRow -> IxCol -> a -> SpMatrix a -> SpMatrix a lookupSM :: SpMatrix a -> IxRow -> IxCol -> Maybe a -- | Looks up an element in the matrix with a default (if the element is -- not found, zero is returned) lookupWD_SM :: Num a => SpMatrix a -> (IxRow, IxCol) -> a -- | Zero-default lookup, infix form -- -- Looks up an element in the matrix with a default (if the element is -- not found, zero is returned) (@@) :: Num a => SpMatrix a -> (IxRow, IxCol) -> a lookupWD_IM :: Num a => IntMap (IntMap a) -> (IxRow, IxCol) -> a matScale :: Num a => a -> SpMatrix a -> SpMatrix a normFrobenius :: SpMatrix Double -> Double type Rows = Int type Cols = Int type IxRow = Int type IxCol = Int -- | Are the supplied indices within matrix bounds? validIxSM :: SpMatrix a -> (Int, Int) -> Bool -- | Is the matrix square? isSquareSM :: SpMatrix a -> Bool -- | Is the matrix diagonal? isDiagonalSM :: SpMatrix a -> Bool -- | is the matrix orthogonal? i.e. Q^t ## Q == I isOrthogonalSM :: SpMatrix Double -> Bool -- | Data in internal representation (do not export) immSM :: SpMatrix t -> IntMap (IntMap t) -- | (Number of rows, Number of columns) dimSM :: SpMatrix t -> (Rows, Cols) -- | Number of rows times number of columns nelSM :: SpMatrix t -> Int -- | Number of rows nrows :: SpMatrix a -> Rows -- | Number of columns ncols :: SpMatrix a -> Cols data SMInfo SMInfo :: Int -> Double -> SMInfo [smNz] :: SMInfo -> Int [smSpy] :: SMInfo -> Double infoSM :: SpMatrix a -> SMInfo nzSM :: SpMatrix a -> Int spySM :: Fractional b => SpMatrix a -> b nzRow :: SpMatrix a -> Key -> Int bwMinSM :: SpMatrix a -> Int bwMaxSM :: SpMatrix a -> Int bwBoundsSM :: SpMatrix a -> (Int, Int) -- | Extract a submatrix given the specified index bounds extractSubmatrixSM :: SpMatrix a -> (IxRow, IxCol) -> (IxRow, IxCol) -> SpMatrix a -- | Demote (n x 1) or (1 x n) SpMatrix to SpVector toSV :: SpMatrix a -> SpVector a extractColSM :: SpMatrix a -> IxCol -> SpMatrix a -- | ", and place into SpVector extractCol :: SpMatrix a -> IxCol -> SpVector a extractRowSM :: SpMatrix a -> IxRow -> SpMatrix a -- | ", and place into SpVector extractRow :: SpMatrix a -> IxRow -> SpVector a -- | Vertical stacking vertStackSM :: SpMatrix a -> SpMatrix a -> SpMatrix a -- | Vertical stacking (-=-) :: SpMatrix a -> SpMatrix a -> SpMatrix a -- | Horizontal stacking horizStackSM :: SpMatrix a -> SpMatrix a -> SpMatrix a -- | Horizontal stacking (-||-) :: SpMatrix a -> SpMatrix a -> SpMatrix a -- | Left fold over SpMatrix foldlSM :: (a -> b -> b) -> b -> SpMatrix a -> b -- | Indexed left fold over SpMatrix ifoldlSM :: (Key -> Key -> a -> b -> b) -> b -> SpMatrix a -> b -- | Count sub-diagonal nonzeros countSubdiagonalNZSM :: SpMatrix a -> Int -- | Extract the diagonal as a SpVector (with default 0) extractDiagonalDSM :: Num a => SpMatrix a -> SpVector a -- | Filter the index subset that lies below the diagonal (used in the QR -- decomposition, for example) subdiagIndicesSM :: SpMatrix a -> [(Key, Key)] sparsifyIM2 :: IntMap (IntMap Double) -> IntMap (IntMap Double) sparsifySM :: SpMatrix Double -> SpMatrix Double -- | Round almost-0 and almost-1 to 0 and 1 respectively roundZeroOneSM :: SpMatrix Double -> SpMatrix Double -- | transposeSM, (#^) : Matrix transpose transposeSM :: SpMatrix a -> SpMatrix a -- | transposeSM, (#^) : Matrix transpose (#^) :: SpMatrix a -> SpMatrix a -- | Matrix-on-vector matVec :: Num a => SpMatrix a -> SpVector a -> SpVector a -- | Matrix-on-vector (#>) :: Num a => SpMatrix a -> SpVector a -> SpVector a -- | Vector-on-matrix (FIXME : transposes matrix: more costly than -- matVec, I think) vecMat :: Num a => SpVector a -> SpMatrix a -> SpVector a -- | Vector-on-matrix (FIXME : transposes matrix: more costly than -- matVec, I think) (<#) :: Num a => SpVector a -> SpMatrix a -> SpVector a matMat :: Num a => SpMatrix a -> SpMatrix a -> SpMatrix a (##) :: Num a => SpMatrix a -> SpMatrix a -> SpMatrix a -- | Removes all elements x for which `| x | <= eps`) matMatSparsified :: SpMatrix Double -> SpMatrix Double -> SpMatrix Double -- | Removes all elements x for which `| x | <= eps`) (#~#) :: SpMatrix Double -> SpMatrix Double -> SpMatrix Double -- | A^T B (#^#) :: SpMatrix Double -> SpMatrix Double -> SpMatrix Double -- | A B^T (##^) :: SpMatrix Double -> SpMatrix Double -> SpMatrix Double -- | uses the R matrix from the QR factorization conditionNumberSM :: SpMatrix Double -> Double hhMat :: Num a => a -> SpVector a -> SpMatrix a -- | a vector x uniquely defines an orthogonal plane; the -- Householder operator reflects any point v with respect to -- this plane: v' = (I - 2 x >< x) v hhRefl :: SpVector Double -> SpMatrix Double hypot :: Floating a => a -> a -> a sign :: (Ord a, Num a) => a -> a -- | Givens coefficients (using stable algorithm shown in Anderson, Edward -- (4 December 2000). "Discontinuous Plane Rotations and the Symmetric -- Eigenvalue Problem". LAPACK Working Note) givensCoef :: (Ord a, Floating a) => a -> a -> (a, a, a) -- | Givens method, row version: choose other row index i' s.t. i' is : * -- below the diagonal * corresponding element is nonzero -- -- QR.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. givens :: SpMatrix Double -> IxRow -> IxCol -> SpMatrix Double -- | Is the kth the first nonzero column in the row? firstNonZeroColumn :: IntMap a -> IxRow -> Bool -- | Returns a set of rows {k} that satisfy QR.C1 candidateRows :: IntMap (IntMap a) -> IxRow -> IxCol -> Maybe [Key] -- | Applies Givens rotation iteratively to zero out sub-diagonal elements qr :: SpMatrix Double -> (SpMatrix Double, SpMatrix Double) -- | Givens matrices in order [G1, G2, .. , G_N ] gmats :: SpMatrix Double -> [SpMatrix Double] eigsQR :: Int -> SpMatrix Double -> SpVector Double -- | Cubic-order convergence, but it requires a mildly educated guess on -- the initial eigenpair rayleighStep :: SpMatrix Double -> (SpVector Double, Double) -> (SpVector Double, Double) eigRayleigh :: Int -> SpMatrix Double -> (SpVector Double, Double) -> (SpVector Double, Double) hhV :: SpVector Double -> (SpVector Double, Double) -- | numerical tolerance for e.g. solution convergence eps :: Double -- | residual of candidate solution x0 residual :: Num a => SpMatrix a -> SpVector a -> SpVector a -> SpVector a converged :: SpMatrix Double -> SpVector Double -> SpVector Double -> Bool -- | one step of CGS cgsStep :: SpMatrix Double -> SpVector Double -> CGS -> CGS data CGS CGS :: SpVector Double -> SpVector Double -> SpVector Double -> SpVector Double -> CGS [_x] :: CGS -> SpVector Double [_r] :: CGS -> SpVector Double [_p] :: CGS -> SpVector Double [_u] :: CGS -> SpVector Double -- | iterate solver until convergence or until max # of iterations is -- reached cgs :: SpMatrix Double -> SpVector Double -> SpVector Double -> SpVector Double -> CGS -- | one step of BiCGSTAB bicgstabStep :: SpMatrix Double -> SpVector Double -> BICGSTAB -> BICGSTAB data BICGSTAB BICGSTAB :: SpVector Double -> SpVector Double -> SpVector Double -> BICGSTAB [_xBicgstab] :: BICGSTAB -> SpVector Double [_rBicgstab] :: BICGSTAB -> SpVector Double [_pBicgstab] :: BICGSTAB -> SpVector Double -- | iterate solver until convergence or until max # of iterations is -- reached bicgstab :: SpMatrix Double -> SpVector Double -> SpVector Double -> SpVector Double -> BICGSTAB data LinSolveMethod CGS_ :: LinSolveMethod BICGSTAB_ :: LinSolveMethod -- | Linear solve with _random_ starting vector linSolveM :: PrimMonad m => LinSolveMethod -> SpMatrix Double -> SpVector Double -> m (SpVector Double) -- | Linear solve with _deterministic_ starting vector (every component at -- 0.1) linSolve :: LinSolveMethod -> SpMatrix Double -> SpVector Double -> SpVector Double -- | <> : linSolve using BiCGSTAB method and by default (<\>) :: SpMatrix Double -> SpVector Double -> SpVector Double -- | transform state until a condition is met modifyUntil :: MonadState s m => (s -> Bool) -> (s -> s) -> m s -- | Keep 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 loopUntilAcc :: Int -> ([t] -> Bool) -> (t -> t) -> t -> t -- | Keep 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 (runs in State monad) modifyInspectN :: MonadState s m => Int -> ([s] -> Bool) -> (s -> s) -> m s meanl :: (Foldable t, Fractional a) => t a -> a norm2l :: (Foldable t, Functor t, Floating a) => t a -> a diffSqL :: Floating a => [a] -> a -- | iterate until convergence is verified or we run out of a fixed -- iteration budget untilConverged :: MonadState a m => (a -> SpVector Double) -> (a -> a) -> m a -- | convergence check (FIXME) normDiffConverged :: (Foldable t, Functor t) => (a -> SpVector Double) -> t a -> Bool -- | 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 runAppendN :: ([t] -> Bool) -> (t -> t) -> Int -> t -> [t] -- | ", NO convergence check runAppendN' :: (t -> t) -> Int -> t -> [t] -- | Rounding rule almostZero :: Double -> Bool -- | Rounding rule almostOne :: Double -> Bool withDefault :: (t -> Bool) -> t -> t -> t roundZero :: Double -> Double roundOne :: Double -> Double with2Defaults :: (t -> Bool) -> (t -> Bool) -> t -> t -> t -> t -- | Round to respectively 0 or 1 within some predefined numerical -- precision eps roundZeroOne :: Double -> Double -- | Dense SpMatrix randMat :: PrimMonad m => Int -> m (SpMatrix Double) -- | Dense SpVector randVec :: PrimMonad m => Int -> m (SpVector Double) -- | Sparse SpMatrix randSpMat :: Int -> Int -> IO (SpMatrix Double) -- | Sparse SpVector randSpVec :: Int -> Int -> IO (SpVector Double) sizeStr :: SpMatrix a -> String showNonZero :: (Show a, Num a, Eq a) => a -> String toDenseRow :: Num a => SpMatrix a -> Key -> [a] toDenseRowClip :: (Show a, Num a) => SpMatrix a -> Key -> Int -> String newline :: IO () printDenseSM :: (Show t, Num t) => SpMatrix t -> IO () toDenseListClip :: (Show a, Num a) => SpVector a -> Int -> String printDenseSV :: (Show t, Num t) => SpVector t -> IO () class PrintDense a prd :: PrintDense a => a -> IO () -- | integer-indexed ziplist denseIxArray :: [b] -> [(Int, b)] -- | ", 2d arrays denseIxArray2 :: Int -> [c] -> [(Int, Int, c)] -- | foldr over the results of a fmap foldrMap :: (Foldable t, Functor t) => (a -> b) -> (b -> c -> c) -> c -> t a -> c -- | strict left fold foldlStrict :: (a -> b -> a) -> a -> [b] -> a -- | indexed right fold ifoldr :: Num i => (a -> b -> b) -> b -> (i -> c -> d -> a) -> c -> [d] -> b type LB = Int type UB = Int inBounds :: LB -> UB -> Int -> Bool inBounds2 :: (LB, UB) -> (Int, Int) -> Bool inBounds0 :: UB -> Int -> Bool inBounds02 :: (UB, UB) -> (Int, Int) -> Bool instance GHC.Show.Show Numeric.LinearAlgebra.Sparse.LinSolveMethod instance GHC.Classes.Eq Numeric.LinearAlgebra.Sparse.LinSolveMethod instance GHC.Classes.Eq Numeric.LinearAlgebra.Sparse.BICGSTAB instance GHC.Classes.Eq Numeric.LinearAlgebra.Sparse.CGS instance GHC.Show.Show Numeric.LinearAlgebra.Sparse.SMInfo instance GHC.Classes.Eq Numeric.LinearAlgebra.Sparse.SMInfo instance GHC.Classes.Eq a => GHC.Classes.Eq (Numeric.LinearAlgebra.Sparse.SpMatrix a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Numeric.LinearAlgebra.Sparse.SpVector a) instance Numeric.LinearAlgebra.Sparse.Set Data.IntMap.Base.IntMap instance Numeric.LinearAlgebra.Sparse.Additive Data.IntMap.Base.IntMap instance Numeric.LinearAlgebra.Sparse.VectorSpace Data.IntMap.Base.IntMap instance Numeric.LinearAlgebra.Sparse.Hilbert Data.IntMap.Base.IntMap instance Numeric.LinearAlgebra.Sparse.Normed Data.IntMap.Base.IntMap instance GHC.Base.Functor Numeric.LinearAlgebra.Sparse.SpVector instance Numeric.LinearAlgebra.Sparse.Set Numeric.LinearAlgebra.Sparse.SpVector instance Data.Foldable.Foldable Numeric.LinearAlgebra.Sparse.SpVector instance Numeric.LinearAlgebra.Sparse.Additive Numeric.LinearAlgebra.Sparse.SpVector instance Numeric.LinearAlgebra.Sparse.VectorSpace Numeric.LinearAlgebra.Sparse.SpVector instance Numeric.LinearAlgebra.Sparse.FiniteDim Numeric.LinearAlgebra.Sparse.SpVector instance Numeric.LinearAlgebra.Sparse.HasData Numeric.LinearAlgebra.Sparse.SpVector a instance Numeric.LinearAlgebra.Sparse.Sparse Numeric.LinearAlgebra.Sparse.SpVector a instance Numeric.LinearAlgebra.Sparse.Hilbert Numeric.LinearAlgebra.Sparse.SpVector instance Numeric.LinearAlgebra.Sparse.Normed Numeric.LinearAlgebra.Sparse.SpVector instance GHC.Show.Show a => GHC.Show.Show (Numeric.LinearAlgebra.Sparse.SpVector a) instance GHC.Show.Show a => GHC.Show.Show (Numeric.LinearAlgebra.Sparse.SpMatrix a) instance GHC.Base.Functor Numeric.LinearAlgebra.Sparse.SpMatrix instance Numeric.LinearAlgebra.Sparse.Set Numeric.LinearAlgebra.Sparse.SpMatrix instance Numeric.LinearAlgebra.Sparse.Additive Numeric.LinearAlgebra.Sparse.SpMatrix instance Numeric.LinearAlgebra.Sparse.FiniteDim Numeric.LinearAlgebra.Sparse.SpMatrix instance Numeric.LinearAlgebra.Sparse.HasData Numeric.LinearAlgebra.Sparse.SpMatrix a instance Numeric.LinearAlgebra.Sparse.Sparse Numeric.LinearAlgebra.Sparse.SpMatrix a instance GHC.Show.Show Numeric.LinearAlgebra.Sparse.CGS instance GHC.Show.Show Numeric.LinearAlgebra.Sparse.BICGSTAB instance (GHC.Show.Show a, GHC.Num.Num a) => Numeric.LinearAlgebra.Sparse.PrintDense (Numeric.LinearAlgebra.Sparse.SpVector a) instance (GHC.Show.Show a, GHC.Num.Num a) => Numeric.LinearAlgebra.Sparse.PrintDense (Numeric.LinearAlgebra.Sparse.SpMatrix a)