summaryrefslogtreecommitdiff
path: root/packages/sparse/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sparse/src')
-rw-r--r--packages/sparse/src/Numeric/LinearAlgebra/Sparse.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/sparse/src/Numeric/LinearAlgebra/Sparse.hs b/packages/sparse/src/Numeric/LinearAlgebra/Sparse.hs
index 8608394..d75fec2 100644
--- a/packages/sparse/src/Numeric/LinearAlgebra/Sparse.hs
+++ b/packages/sparse/src/Numeric/LinearAlgebra/Sparse.hs
@@ -13,8 +13,11 @@ import System.IO.Unsafe(unsafePerformIO)
13import Foreign(Ptr) 13import Foreign(Ptr)
14import Numeric.LinearAlgebra.HMatrix 14import Numeric.LinearAlgebra.HMatrix
15import Text.Printf 15import Text.Printf
16import Numeric.LinearAlgebra.Util((~!~)) 16import Control.Monad(when)
17 17
18(???) :: Bool -> String -> IO ()
19infixl 0 ???
20c ??? msg = when c (error msg)
18 21
19type IV t = CInt -> Ptr CInt -> t 22type IV t = CInt -> Ptr CInt -> t
20type V t = CInt -> Ptr Double -> t 23type V t = CInt -> Ptr Double -> t
@@ -22,7 +25,7 @@ type SMxV = V (IV (IV (V (V (IO CInt)))))
22 25
23dss :: CSR -> Vector Double -> Vector Double 26dss :: CSR -> Vector Double -> Vector Double
24dss CSR{..} b = unsafePerformIO $ do 27dss CSR{..} b = unsafePerformIO $ do
25 size b /= csrNRows ~!~ printf "dss: incorrect sizes: (%d,%d) x %d" csrNRows csrNCols (size b) 28 size b /= csrNRows ??? printf "dss: incorrect sizes: (%d,%d) x %d" csrNRows csrNCols (size b)
26 r <- createVector csrNCols 29 r <- createVector csrNCols
27 app5 c_dss vec csrVals vec csrCols vec csrRows vec b vec r "dss" 30 app5 c_dss vec csrVals vec csrCols vec csrRows vec b vec r "dss"
28 return r 31 return r