diff options
Diffstat (limited to 'packages/base/src')
-rw-r--r-- | packages/base/src/Internal/Modular.hs (renamed from packages/base/src/Numeric/LinearAlgebra/Util/Modular.hs) | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/packages/base/src/Numeric/LinearAlgebra/Util/Modular.hs b/packages/base/src/Internal/Modular.hs index ea4a668..1116b96 100644 --- a/packages/base/src/Numeric/LinearAlgebra/Util/Modular.hs +++ b/packages/base/src/Internal/Modular.hs | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | 13 | ||
14 | {- | | 14 | {- | |
15 | Module : Numeric.LinearAlgebra.Util.Modular | 15 | Module : Internal.Modular |
16 | Copyright : (c) Alberto Ruiz 2015 | 16 | Copyright : (c) Alberto Ruiz 2015 |
17 | License : BSD3 | 17 | License : BSD3 |
18 | Stability : experimental | 18 | Stability : experimental |
@@ -21,20 +21,24 @@ Proof of concept of statically checked modular arithmetic. | |||
21 | 21 | ||
22 | -} | 22 | -} |
23 | 23 | ||
24 | module Numeric.LinearAlgebra.Util.Modular( | 24 | module Internal.Modular( |
25 | Mod, F | 25 | Mod, F |
26 | ) where | 26 | ) where |
27 | 27 | ||
28 | import Data.Packed.Numeric | 28 | import Internal.Vector |
29 | import Numeric.LinearAlgebra.Util(Indexable(..),gaussElim) | 29 | import Internal.Matrix hiding (mat,size) |
30 | import Internal.Numeric | ||
31 | import Internal.Element | ||
32 | import Internal.Tools | ||
33 | import Internal.Container | ||
34 | import Internal.Util(Indexable(..),gaussElim) | ||
30 | import GHC.TypeLits | 35 | import GHC.TypeLits |
31 | import Data.Proxy(Proxy) | 36 | import Data.Proxy(Proxy) |
32 | import Foreign.ForeignPtr(castForeignPtr) | 37 | import Foreign.ForeignPtr(castForeignPtr) |
33 | import Data.Vector.Storable(unsafeToForeignPtr, unsafeFromForeignPtr) | 38 | import Data.Vector.Storable(fromList,unsafeToForeignPtr, unsafeFromForeignPtr) |
34 | import Foreign.Storable | 39 | import Foreign.Storable |
35 | import Data.Ratio | 40 | import Data.Ratio |
36 | import Data.Packed.Internal.Matrix hiding (mat,size) | 41 | |
37 | import Data.Packed.Internal.Numeric | ||
38 | 42 | ||
39 | 43 | ||
40 | -- | Wrapper with a phantom integer for statically checked modular arithmetic. | 44 | -- | Wrapper with a phantom integer for statically checked modular arithmetic. |
@@ -149,7 +153,6 @@ instance forall m . KnownNat m => Container Vector (F m) | |||
149 | find' = findV | 153 | find' = findV |
150 | assoc' = assocV | 154 | assoc' = assocV |
151 | accum' = accumV | 155 | accum' = accumV |
152 | cond' x y l e g = cselect (ccompare x y) l e g | ||
153 | ccompare' a b = ccompare (toInt a) (toInt b) | 156 | ccompare' a b = ccompare (toInt a) (toInt b) |
154 | cselect' c l e g = i2f $ cselect c (toInt l) (toInt e) (toInt g) | 157 | cselect' c l e g = i2f $ cselect c (toInt l) (toInt e) (toInt g) |
155 | scaleRecip s x = scale' s (cmap recip x) | 158 | scaleRecip s x = scale' s (cmap recip x) |