[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] 20080904.01.tst.patch (add reduce example (Tsikas))
From: |
daly |
Subject: |
[Axiom-developer] 20080904.01.tst.patch (add reduce example (Tsikas)) |
Date: |
Thu, 4 Sep 2008 05:13:37 -0500 |
add an example for reduce to the output of )d op reduce
======================================================================
diff --git a/changelog b/changelog
index 056933f..d6cf2ec 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,4 @@
+20080904 tst src/algebra/aggcat.spad add reduce example
20080901 tpd src/input/Makefile add start of multivar poly tests
20080901 tpd src/input/bini.input add start of multivar poly tests
20080831 tpd src/algebra/algfact.spad graphviz dotfile decoration
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 7212a34..d137a42 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -313,9 +313,14 @@ Collection(S:Type): Category == HomogeneousAggregate(S)
with
if % has finiteAggregate then
reduce: ((S,S)->S,%) -> S
++ reduce(f,u) reduces the binary operation f across u. For example,
- ++ if u is \axiom{[x,y,...,z]} then \axiom{reduce(f,u)} returns
\axiom{f(..f(f(x,y),...),z)}.
+ ++ if u is \axiom{[x,y,...,z]} then \axiom{reduce(f,u)}
+ ++ returns \axiom{f(..f(f(x,y),...),z)}.
++ Note: if u has one element x, \axiom{reduce(f,u)} returns x.
++ Error: if u is empty.
+ ++
+ ++C )clear all
+ ++X reduce(+,[C[i]*x**i for i in 1..5])
+
reduce: ((S,S)->S,%,S) -> S
++ reduce(f,u,x) reduces the binary operation f across u, where x is
++ the identity operation of f.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Axiom-developer] 20080904.01.tst.patch (add reduce example (Tsikas)),
daly <=