packages feed

hmatrix-svdlibc 0.1.0.0 → 0.2.0.0

raw patch · 4 files changed

+12/−2 lines, 4 files

Files

Numeric/LinearAlgebra/SVD/SVDLIBC.hs view
@@ -38,6 +38,8 @@ foreign import ccall unsafe "get_dmat_cols" getCols :: Ptr DenseMatrix -> IO CLong foreign import ccall unsafe "get_dmat_buffer" getBuffer :: Ptr DenseMatrix -> IO (Ptr Double) +foreign import ccall unsafe "set_verbosity" setVerbosity :: CLong -> IO ()+ -- Our approach to memory management for dmats isn't entirely future-proof as we currently -- free the library's data structures directly, keeping the underlying -- buffers around for our own purposes@@ -96,4 +98,4 @@ -- This function handles the conversion to svdlibc's sparse representation. svd :: Int -> P.Matrix Double -> (P.Matrix Double, P.Vector Double, P.Matrix Double) svd rank m = unsafePerformIO $ do-    matrixToDMatrix m >>= dMatrixToSMatrix >>= runSvd rank >>= unpackSvdRec+    setVerbosity 0 >> matrixToDMatrix m >>= dMatrixToSMatrix >>= runSvd rank >>= unpackSvdRec
cbits/glue.c view
@@ -15,3 +15,5 @@   free(d->value);   free(d); }++void set_verbosity(long v) { SVDVerbosity = v; }
hmatrix-svdlibc.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                hmatrix-svdlibc-version:             0.1.0.0+version:             0.2.0.0 synopsis:            SVDLIBC bindings for HMatrix description:   Bindings for the sparse singular value decomposition@@ -17,6 +17,10 @@ build-type:          Simple cabal-version:       >=1.8 extra-source-files:  cbits/*.c, include/*.h, svdlibc/*.c, svdlibc/*.h, svdlibc/README.md++source-repository head+  type:                git+  location:            git://github.com/bgamari/gmatrix-svdlibc.git  library   exposed-modules:     Numeric.LinearAlgebra.SVD.SVDLIBC
include/glue.h view
@@ -10,3 +10,5 @@ double *get_dmat_buffer(DMat d);  void free_dmat(DMat d);++void set_verbosity(long v);