Closed varosi closed 9 years ago
I have added fix for Windows. Actually Windows compilation works with FreeBSD and OSX versions.
@albertoruiz, did you thought about to use some Haskell library for random numbers generation, like: http://hackage.haskell.org/package/AC-Random or http://hackage.haskell.org/package/tf-random which are not dependent on external C functions?
@varosi Did you manage to get it built with stack also?
See this: https://github.com/commercialhaskell/stack/issues/983 Currently hmatrix has no stack.yaml configuration for building with Stack. I could make it in another pull request.
@varosi Thank you for reply, I posted the yaml config on that issue. Nothing that I tried managed to detect the required libs during build.
This works fine for building latest hmatrix. Did you by any chance happen to build subhask also? It is another dependency needed for HLearn that needs hmatrix 0.16.1.5 and it fails to build when applying your build/stack related patches over hmatrix 0.16.1.5. More details in: https://github.com/mikeizbicki/subhask/issues/22
Thanks! @varosi: In relation to the random numbers, there is of course no problem using other packages. I would like to have a simple and fast reentrant method to get big random arrays, but it is difficult to have something simple and portable in C. I will take a look at those packages, looking for a fast way to fill a vector.
Great! AC-Random looks good. If Vector could be Foldable it will be easy.
There is also mwc-random, which also looks very good. It can obtain directly (uniform) vectors, and the elements can also be filled using safe mutation in the ST monad:
import System.Random.MWC
import qualified System.Random.MWC.Distributions as D
import Numeric.LinearAlgebra
import Numeric.LinearAlgebra.Devel
rvec :: Vector Double
rvec = runSTVector $ do
v <- newUndefinedVector 10
g <- initialize (fromList [4, 8, 15, 16, 23, 42])
mapM_ (\k -> writeVector v k =<< D.standard g) [0..9]
return v
We just need a simple way to supply the seed.
Is it possible to upload latest hmatrix version (with Windows support) to Hackage? I would like packages like SubHask to use that version.
Yes, I will upload them very shortly.
Great!
I was not wrote it well last time.