diff options
Diffstat (limited to 'packages/base/src/Numeric/Sparse.hs')
-rw-r--r-- | packages/base/src/Numeric/Sparse.hs | 13 |
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 | ||
5 | module Numeric.Sparse( | 5 | module 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 | ||
98 | mkSparse :: AssocMatrix -> GMatrix | ||
99 | mkSparse = fromCSR . mkCSR | ||
98 | 100 | ||
99 | mkSparse :: CSR -> GMatrix | 101 | fromCSR :: CSR -> GMatrix |
100 | mkSparse csr = SparseR {..} | 102 | fromCSR 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 | |||
153 | instance Contraction GMatrix (Vector Double) (Vector Double) | ||
154 | where | ||
155 | contraction = gmXv | ||
156 | |||
157 | -------------------------------------------------------------------------------- | 154 | -------------------------------------------------------------------------------- |
158 | 155 | ||
159 | foreign import ccall unsafe "smXv" | 156 | foreign import ccall unsafe "smXv" |