diff options
author | dos-reis <gdr@axiomatics.org> | 2011-03-12 17:04:43 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-03-12 17:04:43 +0000 |
commit | 52fddea19454dc2b9bcb54c6edd5a4cd4f5765a9 (patch) | |
tree | 4b13ccc6d57c7c1ee615c83615b246c98eae388a /src/algebra/sgcf.spad.pamphlet | |
parent | 42d38bee45a64edfc12641053e58581c20584363 (diff) | |
download | open-axiom-52fddea19454dc2b9bcb54c6edd5a4cd4f5765a9.tar.gz |
* src/algebra/: Systematically use negative? when comparing for
less than 0.
Diffstat (limited to 'src/algebra/sgcf.spad.pamphlet')
-rw-r--r-- | src/algebra/sgcf.spad.pamphlet | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/algebra/sgcf.spad.pamphlet b/src/algebra/sgcf.spad.pamphlet index b917271f..fda88648 100644 --- a/src/algebra/sgcf.spad.pamphlet +++ b/src/algebra/sgcf.spad.pamphlet @@ -196,7 +196,7 @@ SymmetricGroupCombinatoricFunctions(): public == private where -- definition of exported functions numberOfImproperPartitions(n,m) == - if n < 0 or m < 1 then return 0 + if negative? n or m < 1 then return 0 if m = 1 or n = 0 then return 1 s := 0 for i in 0..n repeat @@ -206,7 +206,7 @@ SymmetricGroupCombinatoricFunctions(): public == private where unrankImproperPartitions0(n,m,k) == l : L I := nil$(L I) - k < 0 => error"counting of partitions is started at 0" + negative? k => error"counting of partitions is started at 0" k >= numberOfImproperPartitions(n,m) => error"there are not so many partitions" for t in 0..(m-2) repeat @@ -234,7 +234,7 @@ SymmetricGroupCombinatoricFunctions(): public == private where -- to be formeded. The remaining positions are filled by zeros. nonZeros : L I := nil$(L I) partition : V I := new(m::NNI,0$I)$(V I) - k < 0 => nonZeros + negative? k => nonZeros k >= numberOfImproperPartitions(n,m) => nonZeros cm : I := m --cm gives the depth of the tree while n ~= 0 repeat @@ -260,7 +260,7 @@ SymmetricGroupCombinatoricFunctions(): public == private where subSet(n,m,k) == - k < 0 or n < 0 or m < 0 or m > n => + negative? k or negative? n or negative? m or m > n => error "improper argument to subSet" bin : I := binomial$ICF (n,m) k >= bin => |