summaryrefslogtreecommitdiff
path: root/packages/base/src/Numeric/Sparse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Numeric/Sparse.hs')
-rw-r--r--packages/base/src/Numeric/Sparse.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/base/src/Numeric/Sparse.hs b/packages/base/src/Numeric/Sparse.hs
index 3c19c93..1b8a7b3 100644
--- a/packages/base/src/Numeric/Sparse.hs
+++ b/packages/base/src/Numeric/Sparse.hs
@@ -3,7 +3,7 @@
3{-# LANGUAGE FlexibleInstances #-} 3{-# LANGUAGE FlexibleInstances #-}
4 4
5module Numeric.Sparse( 5module Numeric.Sparse(
6 GMatrix, CSR(..), mkCSR, 6 GMatrix(..), CSR(..), mkCSR, fromCSR,
7 mkSparse, mkDiagR, mkDense, 7 mkSparse, mkDiagR, mkDense,
8 AssocMatrix, 8 AssocMatrix,
9 toDense, 9 toDense,
@@ -95,9 +95,11 @@ mkDense m = Dense{..}
95 nRows = rows m 95 nRows = rows m
96 nCols = cols m 96 nCols = cols m
97 97
98mkSparse :: AssocMatrix -> GMatrix
99mkSparse = fromCSR . mkCSR
98 100
99mkSparse :: CSR -> GMatrix 101fromCSR :: CSR -> GMatrix
100mkSparse csr = SparseR {..} 102fromCSR csr = SparseR {..}
101 where 103 where
102 gmCSR @ CSR {..} = csr 104 gmCSR @ CSR {..} = csr
103 nRows = csrNRows 105 nRows = csrNRows
@@ -149,11 +151,6 @@ infixr 8 !#>
149(!#>) :: GMatrix -> Vector Double -> Vector Double 151(!#>) :: GMatrix -> Vector Double -> Vector Double
150(!#>) = gmXv 152(!#>) = gmXv
151 153
152
153instance Contraction GMatrix (Vector Double) (Vector Double)
154 where
155 contraction = gmXv
156
157-------------------------------------------------------------------------------- 154--------------------------------------------------------------------------------
158 155
159foreign import ccall unsafe "smXv" 156foreign import ccall unsafe "smXv"