aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog5
-rw-r--r--src/algebra/indexedp.spad.pamphlet11
2 files changed, 16 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 84799853..09658cac 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-11 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * algebra/indexedp.spad.pamphlet
+ (IndexedDirectProductAbelianMonoid) [opposite?]: Implement.
+
2013-05-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
* algebra/matrix.spad.pamphlet (IndexedMatrix): Remove as unused.
diff --git a/src/algebra/indexedp.spad.pamphlet b/src/algebra/indexedp.spad.pamphlet
index ad4ae9c8..1f3e6151 100644
--- a/src/algebra/indexedp.spad.pamphlet
+++ b/src/algebra/indexedp.spad.pamphlet
@@ -238,6 +238,17 @@ IndexedDirectProductAbelianMonoid(A:AbelianMonoid,S:OrderedType):
null terms x => 0
coefficient terms(x).first
+ opposite?(x,y) ==
+ u := terms x
+ v := terms y
+ repeat
+ empty? u => return empty? v
+ empty? v => return empty? u
+ index u.first ~= index v.first => return false
+ not opposite?(coefficient u.first,coefficient v.first) => return false
+ u := rest u
+ v := rest v
+
@
\section{domain IDPOAM IndexedDirectProductOrderedAbelianMonoid}
<<domain IDPOAM IndexedDirectProductOrderedAbelianMonoid>>=