summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hmatrix.cabal10
-rw-r--r--lib/Numeric/LinearAlgebra/Algorithms.hs8
2 files changed, 16 insertions, 2 deletions
diff --git a/hmatrix.cabal b/hmatrix.cabal
index aeef52c..cae34a2 100644
--- a/hmatrix.cabal
+++ b/hmatrix.cabal
@@ -33,6 +33,10 @@ flag no-workaround
33 description: Expose the NaN problem 33 description: Expose the NaN problem
34 default: False 34 default: False
35 35
36flag expose-bug
37 description: Expose the NaN problem with debug information
38 default: False
39
36library 40library
37 if flag(splitBase) 41 if flag(splitBase)
38 build-depends: base >= 3, array, QuickCheck, HUnit, storable-complex 42 build-depends: base >= 3, array, QuickCheck, HUnit, storable-complex
@@ -107,9 +111,13 @@ library
107 if flag(unsafe) 111 if flag(unsafe)
108 cpp-options: -DUNSAFE 112 cpp-options: -DUNSAFE
109 113
110 if arch(i386) && !flag(no-workaround) && !flag(mkl) 114 if arch(i386) && !flag(no-workaround) && !flag(expose-bug) && !flag(mkl)
111 cpp-options: -DWORKAROUND 115 cpp-options: -DWORKAROUND
112 116
117 if flag(expose-bug)
118 cpp-options: -DEXPOSEBUG
119
120
113 if flag(mkl) 121 if flag(mkl)
114 if arch(x86_64) 122 if arch(x86_64)
115 extra-libraries: gsl mkl_lapack mkl_intel_lp64 mkl_sequential mkl_core 123 extra-libraries: gsl mkl_lapack mkl_intel_lp64 mkl_sequential mkl_core
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs
index 2c5f44c..00a0ab0 100644
--- a/lib/Numeric/LinearAlgebra/Algorithms.hs
+++ b/lib/Numeric/LinearAlgebra/Algorithms.hs
@@ -143,8 +143,12 @@ instance Field (Complex Double) where
143#if defined(WORKAROUND) 143#if defined(WORKAROUND)
144 multiply = mulCW 144 multiply = mulCW
145#else 145#else
146#if defined(EXPOSEBUG)
147 multiply = multiplyC
148#else
146 multiply = multiplyC3 149 multiply = multiplyC3
147#endif 150#endif
151#endif
148 152
149-- | Eigenvalues and Eigenvectors of a complex hermitian or real symmetric matrix using lapack's dsyev or zheev. 153-- | Eigenvalues and Eigenvectors of a complex hermitian or real symmetric matrix using lapack's dsyev or zheev.
150-- 154--
@@ -664,7 +668,9 @@ cmultiply f st a b
664 = unsafePerformIO $ do 668 = unsafePerformIO $ do
665 s <- createMatrix RowMajor (rows a) (cols b) 669 s <- createMatrix RowMajor (rows a) (cols b)
666 app3 f mat a mat b mat s st 670 app3 f mat a mat b mat s st
667 if toLists s== toLists s then return s else error $ "BRUTAL " ++ (show (toLists s)) 671 if toLists s== toLists s
672 then return s
673 else error $ "NaN FOUND!! " ++ (show (toLists s))
668 -- return s 674 -- return s
669-- | otherwise = error $ st ++ " (matrix product) of nonconformant matrices" 675-- | otherwise = error $ st ++ " (matrix product) of nonconformant matrices"
670 676