summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Modular.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Modular.hs')
-rw-r--r--packages/base/src/Internal/Modular.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/base/src/Internal/Modular.hs b/packages/base/src/Internal/Modular.hs
index 64ed2bb..a3421a8 100644
--- a/packages/base/src/Internal/Modular.hs
+++ b/packages/base/src/Internal/Modular.hs
@@ -33,7 +33,7 @@ import Internal.Element
33import Internal.Container 33import Internal.Container
34import Internal.Vectorized (prodI,sumI,prodL,sumL) 34import Internal.Vectorized (prodI,sumI,prodL,sumL)
35import Internal.LAPACK (multiplyI, multiplyL) 35import Internal.LAPACK (multiplyI, multiplyL)
36import Internal.Algorithms(luFact) 36import Internal.Algorithms(luFact,LU(..))
37import Internal.Util(Normed(..),Indexable(..), 37import Internal.Util(Normed(..),Indexable(..),
38 gaussElim, gaussElim_1, gaussElim_2, 38 gaussElim, gaussElim_1, gaussElim_2,
39 luST, luSolve', luPacked', magnit, invershur) 39 luST, luSolve', luPacked', magnit, invershur)
@@ -169,7 +169,7 @@ instance forall m . KnownNat m => Container Vector (Mod m I)
169 size' = dim 169 size' = dim
170 scale' s x = vmod (scale (unMod s) (f2i x)) 170 scale' s x = vmod (scale (unMod s) (f2i x))
171 addConstant c x = vmod (addConstant (unMod c) (f2i x)) 171 addConstant c x = vmod (addConstant (unMod c) (f2i x))
172 add a b = vmod (add (f2i a) (f2i b)) 172 add' a b = vmod (add' (f2i a) (f2i b))
173 sub a b = vmod (sub (f2i a) (f2i b)) 173 sub a b = vmod (sub (f2i a) (f2i b))
174 mul a b = vmod (mul (f2i a) (f2i b)) 174 mul a b = vmod (mul (f2i a) (f2i b))
175 equal u v = equal (f2i u) (f2i v) 175 equal u v = equal (f2i u) (f2i v)
@@ -209,7 +209,7 @@ instance forall m . KnownNat m => Container Vector (Mod m Z)
209 size' = dim 209 size' = dim
210 scale' s x = vmod (scale (unMod s) (f2i x)) 210 scale' s x = vmod (scale (unMod s) (f2i x))
211 addConstant c x = vmod (addConstant (unMod c) (f2i x)) 211 addConstant c x = vmod (addConstant (unMod c) (f2i x))
212 add a b = vmod (add (f2i a) (f2i b)) 212 add' a b = vmod (add' (f2i a) (f2i b))
213 sub a b = vmod (sub (f2i a) (f2i b)) 213 sub a b = vmod (sub (f2i a) (f2i b))
214 mul a b = vmod (mul (f2i a) (f2i b)) 214 mul a b = vmod (mul (f2i a) (f2i b))
215 equal u v = equal (f2i u) (f2i v) 215 equal u v = equal (f2i u) (f2i v)
@@ -371,7 +371,9 @@ test = (ok, info)
371 371
372 checkLU okf t = norm_Inf $ flatten (l <> u <> p - t) 372 checkLU okf t = norm_Inf $ flatten (l <> u <> p - t)
373 where 373 where
374 (l,u,p,_ :: Int) = luFact $ mutable (luST okf) t 374 (l,u,p,_ :: Int) = luFact (LU x' p')
375 where
376 (x',p') = mutable (luST okf) t
375 377
376 checkSolve aa = norm_Inf $ flatten (aa <> x - bb) 378 checkSolve aa = norm_Inf $ flatten (aa <> x - bb)
377 where 379 where