[Home]
[
prev
] [
up
] [
next
] ((test/poly/istruc.as))
31.2
Test SparseFiniteMonoidRing
742a
⟨
test one
742a
⟩
≡
(
733
743
749
)
744a
⊳
testOne1():
()
==
{
x:
P
:=
1;
assertTrue(one?
x);
assertEquals(P,
[1,
1],
x);
}
742b
⟨
test times
742b
⟩
≡
(
733
743
749
)
744b
⊳
testTimes1():
()
==
{
x:
P
:=
[3,
3];
y:
P
:=
[7,
2];
z:
P
:=
[1,
-1];
t:
P
:=
[2,
1];
assertEquals(P,
[21,
6],
x*y);
assertEquals(P,
[3,
-3],
x*z);
assertEquals(P,
x*x
+
t*x*y
+
y*y,
(x+y)*(x+y));
assertEquals(P,
[9,9]+[42,6]+[49,4],
(x+y)*(x+y));
assertTrue(one?(z*z));
}
[Home]
[
prev
] [
up
] [
next
] ((test/poly/istruc.as))