Skip to content

Commit

Permalink
v.0.9.9
Browse files Browse the repository at this point in the history
* Polynomial.fromString can parse a polynomial string/tex representation into a polynomial as best as possible
* Fix Polynomial/Expr/Term gt/gte/lt/lte methods to be as compatible as possible
* Minor adjustments
* update examples and tests
  • Loading branch information
foo123 committed Jan 19, 2020
1 parent 70aa4ca commit efde9e4
Show file tree
Hide file tree
Showing 29 changed files with 881 additions and 740 deletions.
224 changes: 173 additions & 51 deletions src/js/Abacus.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/Abacus.min.js

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions test/combination_subsets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,38 +243,38 @@ o.order("colex,reversed")
[ 0 ]
[]
o.order("random")
[ 0, 1 ]
[ 1 ]
[ 1 ]
[ 4, 0 ]
[ 2, 4 ]
[ 2 ]
[ 1, 3 ]
[ 2, 3 ]
[ 1, 2, 3 ]
[ 1, 2, 3 ]
[ 2, 1 ]
[ 0, 1, 2 ]
[ 0, 3, 4 ]
[ 3, 4 ]
[ 2, 1 ]
[ 3 ]
[ 0, 2 ]
[ 2, 1 ]
[ 0, 2, 4 ]
[ 0, 2, 4 ]
[ 2, 3 ]
[ 0 ]
[ 0, 1, 2 ]
[ 1 ]
[ 3, 1 ]
[ 1, 4 ]
[ 1, 3 ]
[ 0, 1, 2, 4 ]
[ 1, 0 ]
[ 2 ]
[ 2 ]
[ 0, 1, 4 ]
[ 0, 1, 3, 4 ]
[ 1, 2, 4 ]
[ 0, 1, 2, 3 ]
[ 1, 2, 3, 4 ]
[ 0, 2, 3, 4 ]
[ 1 ]
[ 1, 2 ]
[ 2, 0 ]
[ 2, 3 ]
[ 0, 1, 2, 3, 4 ]
[ 3, 4 ]
[ 0, 1, 4 ]
[ 3, 0 ]
[ 1, 3, 4 ]
[ 0, 3, 4 ]
[ 0, 2, 3, 4 ]
[ 1, 3 ]
[ 0, 1, 3, 4 ]
[ 0, 1 ]
[ 2, 3, 4 ]
[ 0, 1, 2, 4 ]
[ 4, 3 ]
[ 1 ]
[ 0, 1, 2, 4 ]
[ 1, 4 ]
[ 3, 1 ]
o.random()
[ 1, 0 ]
[ 3 ]
o.dispose()
28 changes: 14 additions & 14 deletions test/combinations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,28 +159,28 @@ o.order("colex,reversed")
[ 0, 1, 3 ]
[ 0, 1, 2 ]
o.order("random")
[ 1, 2, 4 ]
[ 0, 2, 3 ]
[ 1, 3, 4 ]
[ 1, 3, 5 ]
[ 1, 4, 5 ]
[ 0, 2, 4 ]
[ 1, 2, 5 ]
[ 2, 3, 4 ]
[ 1, 2, 5 ]
[ 0, 2, 3 ]
[ 0, 2, 5 ]
[ 0, 3, 4 ]
[ 0, 3, 5 ]
[ 2, 4, 5 ]
[ 3, 4, 5 ]
[ 1, 4, 5 ]
[ 2, 3, 5 ]
[ 1, 2, 3 ]
[ 0, 3, 4 ]
[ 0, 1, 3 ]
[ 0, 2, 5 ]
[ 0, 1, 2 ]
[ 0, 1, 4 ]
[ 1, 2, 3 ]
[ 0, 1, 5 ]
[ 0, 4, 5 ]
[ 2, 4, 5 ]
[ 0, 1, 3 ]
[ 1, 3, 5 ]
[ 1, 3, 4 ]
[ 1, 2, 4 ]
[ 0, 1, 2 ]
[ 3, 4, 5 ]
o.random()
[ 5, 3, 1 ]
[ 2, 3, 4 ]
o.order("colex").range(-5, -1)
[ 2, 3, 5 ]
[ 0, 4, 5 ]
Expand Down
90 changes: 45 additions & 45 deletions test/combinations_repeats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,64 +411,64 @@ o.order("colex,reversed")
[ 0, 0, 1 ]
[ 0, 0, 0 ]
o.order("random")
[ 2, 2, 5 ]
[ 4, 4, 4 ]
[ 2, 3, 5 ]
[ 2, 3, 3 ]
[ 3, 3, 3 ]
[ 4, 4, 5 ]
[ 0, 0, 0 ]
[ 0, 2, 5 ]
[ 4, 5, 5 ]
[ 3, 3, 4 ]
[ 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 1, 4 ]
[ 1, 3, 5 ]
[ 0, 4, 4 ]
[ 1, 2, 5 ]
[ 0, 0, 5 ]
[ 1, 2, 4 ]
[ 1, 2, 3 ]
[ 1, 2, 2 ]
[ 0, 2, 3 ]
[ 0, 1, 1 ]
[ 5, 5, 5 ]
[ 0, 1, 2 ]
[ 0, 0, 0 ]
[ 0, 3, 5 ]
[ 0, 2, 4 ]
[ 1, 1, 3 ]
[ 1, 1, 5 ]
o.random()
[ 0, 3, 4 ]
[ 4, 4, 4 ]
o.order("colex").range(-5, -1)
[ 1, 5, 5 ]
[ 2, 5, 5 ]
Expand Down
6 changes: 3 additions & 3 deletions test/compositions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ o.order("colex,reflected")
o.order("colex,reversed")
[ 7 ]
o.random()
[ 1, 3, 1, 2 ]
[ 1, 2, 1, 3 ]
o.dispose()
o = Abacus.Partition(8,{type:"composition"})
o.total()
Expand Down Expand Up @@ -808,7 +808,7 @@ o.order("lex,reversed")
[ 1, 1, 1, 1, 1, 1, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
o.random()
[ 1, 1, 2, 1, 1, 1, 1 ]
[ 1, 3, 2, 2 ]
o.dispose()
o = Abacus.Partition(10,{type:"composition"})
o.dimension()
Expand Down Expand Up @@ -2876,5 +2876,5 @@ o.order("lex,reversed")
[ 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
o.random()
[ 1, 2, 2, 2, 1, 1, 1 ]
[ 2, 1, 2, 1, 2, 1, 1 ]
o.dispose()
8 changes: 4 additions & 4 deletions test/conditional_permutations_algebraic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ o.rewind(-1)
[ 0, 1, 4, 5, 2, 3 ]
[ 0, 3, 4, 5, 1, 2 ]
o.random()
[ 0, 1, 4, 5, 2, 3 ]
[ 2, 5, 3, 4, 0, 1 ]
o.dispose()

o = Abacus.Tensor(7,{type:"partial",data:["{0..4}","[0]+1","[1]+1","[3]-1","[4]-1"],ordering:"<>",position:[0,1,2,4,5]}).completeWith(Abacus.Permutation(7-5))
Expand Down Expand Up @@ -96,7 +96,7 @@ o.rewind(-1)
[ 0, 1, 2, 6, 5, 4, 3 ]
[ 0, 1, 2, 5, 4, 3, 6 ]
o.random()
[ 0, 1, 2, 6, 5, 4, 3 ]
[ 3, 4, 5, 2, 1, 0, 6 ]
o.dispose()
Abacus.Tensor(6,{type:"partial",data:{0:"{0..4}",1:"[0]+1",2:"[0]+[1]"},ordering:"<>"}).completeWith(Abacus.Permutation(6-3))
o.total()
Expand Down Expand Up @@ -129,7 +129,7 @@ o.rewind(-1)
[ 2, 3, 5, 0, 1, 4 ]
[ 1, 2, 3, 0, 4, 5 ]
o.random()
[ 2, 3, 5, 4, 1, 0 ]
[ 2, 3, 5, 1, 0, 4 ]
o.dispose()
Abacus.Tensor(6,{type:"partial",data:{0:"{0..4}",1:"[0]+1",2:"[0]+[1]",3:"5"},ordering:"<>"}).completeWith(Abacus.Permutation(6-4))
o.total()
Expand All @@ -142,5 +142,5 @@ o.rewind(-1)
[ 1, 2, 3, 5, 4, 0 ]
[ 1, 2, 3, 5, 0, 4 ]
o.random()
[ 1, 2, 3, 5, 0, 4 ]
[ 1, 2, 3, 5, 4, 0 ]
o.dispose()
4 changes: 2 additions & 2 deletions test/conditional_permutations_boolean.txt
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ o.rewind(-1)
[ 0, 1, 3, 4, 2, 5 ]
[ 0, 2, 3, 4, 1, 5 ]
o.random()
[ 0, 3, 1, 5, 2, 4 ]
[ 2, 3, 4, 5, 1, 0 ]
o.dispose()
6,4-Combinations where values in 0th position ARE (0,1) and in 1st position [0]+1
o = Abacus.Tensor(6,{type:"partial",data:["{0,1}","[0]+1"],ordering:"<",position:[0,1]}).completeWith(Abacus.Combination(6-2,4-2)).filterBy(Abacus.Filter.SORTED("<"))
Expand Down Expand Up @@ -490,5 +490,5 @@ o.order("revlex|revlex")
[ 0, 1, 2, 4 ]
[ 0, 1, 2, 3 ]
o.random()
[ 0, 1, 3, 4 ]
[ 1, 2, 3, 4 ]
o.dispose()
8 changes: 4 additions & 4 deletions test/connected_permutations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ o = Abacus.Permutation(3,{type:"connected"})
o.total()
2
o.random()
[ 2, 0, 1 ]
[ 1, 2, 0 ]
o = Abacus.Permutation(4,{type:"connected"})
o.total()
6
o.random()
[ 2, 3, 1, 0 ]
[ 1, 3, 0, 2 ]
o = Abacus.Permutation(5,{type:"connected"})
o.total()
24
o.random()
[ 3, 2, 0, 4, 1 ]
[ 3, 4, 0, 1, 2 ]
o = Abacus.Permutation(6,{type:"connected"})
o.total()
120
o.random()
[ 1, 5, 3, 4, 0, 2 ]
[ 5, 3, 0, 2, 1, 4 ]
4 changes: 2 additions & 2 deletions test/cyclic_permutations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ o.order("colex,reversed")
[ 2, 3, 0, 1 ]
[ 1, 2, 3, 0 ]
o.order("random")
[ 2, 3, 0, 1 ]
[ 0, 1, 2, 3 ]
[ 3, 0, 1, 2 ]
[ 2, 3, 0, 1 ]
[ 1, 2, 3, 0 ]
o.random()
[ 2, 3, 0, 1 ]
[ 3, 0, 1, 2 ]
o.order("colex").range(-3, -1)
[ 2, 3, 0, 1 ]
[ 3, 0, 1, 2 ]
Expand Down
Loading

0 comments on commit efde9e4

Please sign in to comment.