diff options
Diffstat (limited to 'packages/gsl/src/Numeric/GSL/Polynomials.hs')
-rw-r--r-- | packages/gsl/src/Numeric/GSL/Polynomials.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/gsl/src/Numeric/GSL/Polynomials.hs b/packages/gsl/src/Numeric/GSL/Polynomials.hs index b1be85d..246e301 100644 --- a/packages/gsl/src/Numeric/GSL/Polynomials.hs +++ b/packages/gsl/src/Numeric/GSL/Polynomials.hs | |||
@@ -16,9 +16,8 @@ module Numeric.GSL.Polynomials ( | |||
16 | polySolve | 16 | polySolve |
17 | ) where | 17 | ) where |
18 | 18 | ||
19 | import Data.Packed | 19 | import Numeric.LinearAlgebra.HMatrix |
20 | import Numeric.GSL.Internal | 20 | import Numeric.GSL.Internal |
21 | import Data.Complex | ||
22 | import System.IO.Unsafe (unsafePerformIO) | 21 | import System.IO.Unsafe (unsafePerformIO) |
23 | 22 | ||
24 | #if __GLASGOW_HASKELL__ >= 704 | 23 | #if __GLASGOW_HASKELL__ >= 704 |
@@ -47,8 +46,8 @@ polySolve :: [Double] -> [Complex Double] | |||
47 | polySolve = toList . polySolve' . fromList | 46 | polySolve = toList . polySolve' . fromList |
48 | 47 | ||
49 | polySolve' :: Vector Double -> Vector (Complex Double) | 48 | polySolve' :: Vector Double -> Vector (Complex Double) |
50 | polySolve' v | dim v > 1 = unsafePerformIO $ do | 49 | polySolve' v | size v > 1 = unsafePerformIO $ do |
51 | r <- createVector (dim v-1) | 50 | r <- createVector (size v-1) |
52 | app2 c_polySolve vec v vec r "polySolve" | 51 | app2 c_polySolve vec v vec r "polySolve" |
53 | return r | 52 | return r |
54 | | otherwise = error "polySolve on a polynomial of degree zero" | 53 | | otherwise = error "polySolve on a polynomial of degree zero" |