aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/cra.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/cra.spad.pamphlet')
-rw-r--r--src/algebra/cra.spad.pamphlet28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/algebra/cra.spad.pamphlet b/src/algebra/cra.spad.pamphlet
index b5bb6378..8b50ae68 100644
--- a/src/algebra/cra.spad.pamphlet
+++ b/src/algebra/cra.spad.pamphlet
@@ -37,31 +37,31 @@ CRApackage(R:EuclideanDomain): Exports == Implementation where
-- Definition for modular reduction mapping with several moduli
modTree(a,lm) ==
t := balancedBinaryTree(#lm, 0$R)
- setleaves_!(t,lm)
- mapUp_!(t,"*")
- leaves mapDown_!(t, a, "rem")
+ setleaves!(t,lm)
+ mapUp!(t,"*")
+ leaves mapDown!(t, a, "rem")
chineseRemainder(lv:List(R), lm:List(R)):R ==
#lm ~= #lv => error "lists of moduli and values not of same length"
x := balancedBinaryTree(#lm, 0$R)
- x := setleaves_!(x, lm)
- mapUp_!(x,"*")
+ x := setleaves!(x, lm)
+ mapUp!(x,"*")
y := balancedBinaryTree(#lm, 1$R)
- y := mapUp_!(copy y,x,#1 * #4 + #2 * #3)
+ y := mapUp!(copy y,x,#1 * #4 + #2 * #3)
(u := extendedEuclidean(value y, value x,1)) case "failed" =>
error "moduli not relatively prime"
inv := u . coef1
linv := modTree(inv, lm)
l := [(u*v) rem m for v in lv for u in linv for m in lm]
- y := setleaves_!(y,l)
- value(mapUp_!(y, x, #1 * #4 + #2 * #3)) rem value(x)
+ y := setleaves!(y,l)
+ value(mapUp!(y, x, #1 * #4 + #2 * #3)) rem value(x)
chineseRemainder(llv:List List(R), lm:List(R)):List(R) ==
x := balancedBinaryTree(#lm, 0$R)
- x := setleaves_!(x, lm)
- mapUp_!(x,"*")
+ x := setleaves!(x, lm)
+ mapUp!(x,"*")
y := balancedBinaryTree(#lm, 1$R)
- y := mapUp_!(copy y,x,#1 * #4 + #2 * #3)
+ y := mapUp!(copy y,x,#1 * #4 + #2 * #3)
(u := extendedEuclidean(value y, value x,1)) case "failed" =>
error "moduli not relatively prime"
inv := u . coef1
@@ -81,9 +81,9 @@ CRApackage(R:EuclideanDomain): Exports == Implementation where
multiEuclideanTree(fl, rhs) ==
x := balancedBinaryTree(#fl, rhs)
- x := setleaves_!(x, fl)
- mapUp_!(x,"*")
- leaves mapDown_!(x, rhs, extEuclidean)
+ x := setleaves!(x, fl)
+ mapUp!(x,"*")
+ leaves mapDown!(x, rhs, extEuclidean)
@
\section{License}