Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test 'randomGaussian' fails (at :~3~:) #333

Open
mpilgrem opened this issue Jul 26, 2020 · 1 comment
Open

Unit test 'randomGaussian' fails (at :~3~:) #333

mpilgrem opened this issue Jul 26, 2020 · 1 comment

Comments

@mpilgrem
Copy link
Contributor

On Windows 10, after the changes made in #332 that allow the repository's packages to build, unit test 'randomGaussian' fails, as follows:

stack --resolver nightly-2020-07-24 ghci --flag hmatrix:openblas
...
>   Numeric.LinearAlgebra.Tests.runTests 20
...
------ some unit tests
### Failure in: 9
...\\\\hmatrix\\\\packages\\\\tests\\\\src\\Numeric\\LinearAlgebra\\Tests.hs:75
randomGaussian
Cases: 52  Tried: 52  Errors: 0  Failures: 1
*** Exception: ExitFailure 1

The unit test in question is:

randomTestGaussian = (unSym c) :~3~: unSym (snd (meanCov dat))
  where
    a = (3><3) [1,2,3,
                2,4,0,
               -2,2,1]
    m = 3 |> [1,2,3]
    c = mTm a
    dat = gaussianSample 7 (10^6) m c

Experimenting in GHCi, the left-hand side evaluates to:

(3><3)
 [ 9.0,  6.0,  1.0
 , 6.0, 24.0,  8.0
 , 1.0,  8.0, 10.0 ]

and the right-hand side evaluates to:

(3><3)
 [  8.988938780040986,   5.98560251630079, 0.9945909287025282
 ,   5.98560251630079, 23.984218859673046,   8.00202383985934
 , 0.9945909287025282,   8.00202383985934, 10.007232034009721 ]

which is not close enough for :~3~:. It is, however, close enough for :~2~: to pass.

@mpilgrem
Copy link
Contributor Author

mpilgrem commented Jul 26, 2020

I closed the issue prematurely - I still have the problem after updating MSYS2 packages (including to mingw-w64-x86_64-openblas 0.3.10-2). The right-hand side now evaluates to:

(3><3)
 [  9.004319638634618, 6.0018136158093975, 0.9978510096653478
 , 6.0018136158093975,    24.037654590196,  8.033168755772563
 , 0.9978510096653478,  8.033168755772563,  10.02595645538819 ]

@mpilgrem mpilgrem reopened this Jul 26, 2020
mpilgrem added a commit to mpilgrem/hmatrix that referenced this issue Sep 9, 2021
This proposal updates INSTALL.md for the following:

* stack comes with `msys2-20200903`
* MSYS2 `pacman -Syu` has further keyring issues which can be overcome (msys2/MSYS2-packages#2058 (comment))
* The incorrect `hmatrix-gsl-0.19.0.1` is still the latest on Hackage (haskell-numerics#312)
* Invoking `stack ghci` in the respository root folder fails, apparently because of a bug in GHC, but `stack ghci` works in the `tests` folder if an appropriate `stack.yaml` is created
* The unit tests actually fail (haskell-numerics#333)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant