summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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{- |
15Module : Numeric.LinearAlgebra.Util.Modular 15Module : Internal.Modular
16Copyright : (c) Alberto Ruiz 2015 16Copyright : (c) Alberto Ruiz 2015
17License : BSD3 17License : BSD3
18Stability : experimental 18Stability : experimental
@@ -21,20 +21,24 @@ Proof of concept of statically checked modular arithmetic.
21 21
22-} 22-}
23 23
24module Numeric.LinearAlgebra.Util.Modular( 24module Internal.Modular(
25 Mod, F 25 Mod, F
26) where 26) where
27 27
28import Data.Packed.Numeric 28import Internal.Vector
29import Numeric.LinearAlgebra.Util(Indexable(..),gaussElim) 29import Internal.Matrix hiding (mat,size)
30import Internal.Numeric
31import Internal.Element
32import Internal.Tools
33import Internal.Container
34import Internal.Util(Indexable(..),gaussElim)
30import GHC.TypeLits 35import GHC.TypeLits
31import Data.Proxy(Proxy) 36import Data.Proxy(Proxy)
32import Foreign.ForeignPtr(castForeignPtr) 37import Foreign.ForeignPtr(castForeignPtr)
33import Data.Vector.Storable(unsafeToForeignPtr, unsafeFromForeignPtr) 38import Data.Vector.Storable(fromList,unsafeToForeignPtr, unsafeFromForeignPtr)
34import Foreign.Storable 39import Foreign.Storable
35import Data.Ratio 40import Data.Ratio
36import Data.Packed.Internal.Matrix hiding (mat,size) 41
37import 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)