Skip to content

Commit efde9e4

Browse files
committed
v.0.9.9
* 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
1 parent 70aa4ca commit efde9e4

29 files changed

+881
-740
lines changed

src/js/Abacus.js

+173-51
Large diffs are not rendered by default.

src/js/Abacus.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/combination_subsets.txt

+27-27
Original file line numberDiff line numberDiff line change
@@ -243,38 +243,38 @@ o.order("colex,reversed")
243243
[ 0 ]
244244
[]
245245
o.order("random")
246-
[ 0, 1 ]
247-
[ 1 ]
248246
[ 1 ]
249-
[ 4, 0 ]
250-
[ 2, 4 ]
251-
[ 2 ]
252-
[ 1, 3 ]
253-
[ 2, 3 ]
254-
[ 1, 2, 3 ]
255-
[ 1, 2, 3 ]
256-
[ 2, 1 ]
257-
[ 0, 1, 2 ]
258-
[ 0, 3, 4 ]
259-
[ 3, 4 ]
260-
[ 2, 1 ]
261-
[ 3 ]
262247
[ 0, 2 ]
263248
[ 2, 1 ]
264-
[ 0, 2, 4 ]
265-
[ 0, 2, 4 ]
266-
[ 2, 3 ]
249+
[ 0 ]
250+
[ 0, 1, 2 ]
251+
[ 1 ]
252+
[ 3, 1 ]
253+
[ 1, 4 ]
254+
[ 1, 3 ]
255+
[ 0, 1, 2, 4 ]
256+
[ 1, 0 ]
257+
[ 2 ]
258+
[ 2 ]
259+
[ 0, 1, 4 ]
260+
[ 0, 1, 3, 4 ]
261+
[ 1, 2, 4 ]
267262
[ 0, 1, 2, 3 ]
268-
[ 1, 2, 3, 4 ]
263+
[ 0, 2, 3, 4 ]
264+
[ 1 ]
265+
[ 1, 2 ]
269266
[ 2, 0 ]
270-
[ 2, 3 ]
271-
[ 0, 1, 2, 3, 4 ]
272-
[ 3, 4 ]
273-
[ 0, 1, 4 ]
274-
[ 3, 0 ]
267+
[ 1, 3, 4 ]
268+
[ 0, 3, 4 ]
269+
[ 0, 2, 3, 4 ]
270+
[ 1, 3 ]
271+
[ 0, 1, 3, 4 ]
272+
[ 0, 1 ]
273+
[ 2, 3, 4 ]
274+
[ 0, 1, 2, 4 ]
275+
[ 4, 3 ]
276+
[ 1 ]
275277
[ 0, 1, 2, 4 ]
276-
[ 1, 4 ]
277-
[ 3, 1 ]
278278
o.random()
279-
[ 1, 0 ]
279+
[ 3 ]
280280
o.dispose()

test/combinations.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -159,28 +159,28 @@ o.order("colex,reversed")
159159
[ 0, 1, 3 ]
160160
[ 0, 1, 2 ]
161161
o.order("random")
162-
[ 1, 2, 4 ]
163-
[ 0, 2, 3 ]
164-
[ 1, 3, 4 ]
165-
[ 1, 3, 5 ]
162+
[ 1, 4, 5 ]
166163
[ 0, 2, 4 ]
167-
[ 1, 2, 5 ]
168164
[ 2, 3, 4 ]
165+
[ 1, 2, 5 ]
166+
[ 0, 2, 3 ]
167+
[ 0, 2, 5 ]
168+
[ 0, 3, 4 ]
169169
[ 0, 3, 5 ]
170-
[ 2, 4, 5 ]
171-
[ 3, 4, 5 ]
172-
[ 1, 4, 5 ]
173170
[ 2, 3, 5 ]
174-
[ 1, 2, 3 ]
175-
[ 0, 3, 4 ]
176-
[ 0, 1, 3 ]
177-
[ 0, 2, 5 ]
178-
[ 0, 1, 2 ]
179171
[ 0, 1, 4 ]
172+
[ 1, 2, 3 ]
180173
[ 0, 1, 5 ]
181174
[ 0, 4, 5 ]
175+
[ 2, 4, 5 ]
176+
[ 0, 1, 3 ]
177+
[ 1, 3, 5 ]
178+
[ 1, 3, 4 ]
179+
[ 1, 2, 4 ]
180+
[ 0, 1, 2 ]
181+
[ 3, 4, 5 ]
182182
o.random()
183-
[ 5, 3, 1 ]
183+
[ 2, 3, 4 ]
184184
o.order("colex").range(-5, -1)
185185
[ 2, 3, 5 ]
186186
[ 0, 4, 5 ]

test/combinations_repeats.txt

+45-45
Original file line numberDiff line numberDiff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]
442448
[ 3, 4, 5 ]
443-
[ 2, 3, 5 ]
444-
[ 1, 3, 5 ]
445-
[ 1, 3, 4 ]
446-
[ 0, 3, 3 ]
447449
[ 3, 4, 4 ]
448-
[ 3, 3, 5 ]
449-
[ 2, 2, 4 ]
450-
[ 2, 3, 4 ]
451-
[ 0, 1, 5 ]
452-
[ 1, 1, 1 ]
450+
[ 3, 3, 3 ]
453451
[ 1, 3, 3 ]
454-
[ 0, 3, 4 ]
455-
[ 0, 2, 2 ]
456-
[ 0, 0, 1 ]
452+
[ 0, 1, 5 ]
453+
[ 1, 5, 5 ]
454+
[ 1, 1, 2 ]
455+
[ 3, 5, 5 ]
456+
[ 0, 5, 5 ]
457+
[ 4, 4, 4 ]
458+
[ 1, 4, 4 ]
459+
[ 4, 4, 5 ]
460+
[ 0, 2, 5 ]
457461
[ 0, 0, 2 ]
458-
[ 0, 1, 3 ]
462+
[ 0, 1, 4 ]
463+
[ 1, 3, 5 ]
459464
[ 0, 4, 4 ]
460-
[ 1, 2, 5 ]
461-
[ 0, 0, 5 ]
462-
[ 1, 2, 4 ]
463-
[ 1, 2, 3 ]
464-
[ 1, 2, 2 ]
465-
[ 0, 2, 3 ]
466-
[ 0, 1, 1 ]
465+
[ 5, 5, 5 ]
466+
[ 0, 1, 2 ]
467+
[ 0, 0, 0 ]
468+
[ 0, 3, 5 ]
467469
[ 0, 2, 4 ]
468-
[ 1, 1, 3 ]
469-
[ 1, 1, 5 ]
470470
o.random()
471-
[ 0, 3, 4 ]
471+
[ 4, 4, 4 ]
472472
o.order("colex").range(-5, -1)
473473
[ 1, 5, 5 ]
474474
[ 2, 5, 5 ]

test/compositions.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ o.order("colex,reflected")
278278
o.order("colex,reversed")
279279
[ 7 ]
280280
o.random()
281-
[ 1, 3, 1, 2 ]
281+
[ 1, 2, 1, 3 ]
282282
o.dispose()
283283
o = Abacus.Partition(8,{type:"composition"})
284284
o.total()
@@ -808,7 +808,7 @@ o.order("lex,reversed")
808808
[ 1, 1, 1, 1, 1, 1, 2 ]
809809
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
810810
o.random()
811-
[ 1, 1, 2, 1, 1, 1, 1 ]
811+
[ 1, 3, 2, 2 ]
812812
o.dispose()
813813
o = Abacus.Partition(10,{type:"composition"})
814814
o.dimension()
@@ -2876,5 +2876,5 @@ o.order("lex,reversed")
28762876
[ 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
28772877
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
28782878
o.random()
2879-
[ 1, 2, 2, 2, 1, 1, 1 ]
2879+
[ 2, 1, 2, 1, 2, 1, 1 ]
28802880
o.dispose()

test/conditional_permutations_algebraic.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ o.rewind(-1)
6565
[ 0, 1, 4, 5, 2, 3 ]
6666
[ 0, 3, 4, 5, 1, 2 ]
6767
o.random()
68-
[ 0, 1, 4, 5, 2, 3 ]
68+
[ 2, 5, 3, 4, 0, 1 ]
6969
o.dispose()
7070

7171
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))
@@ -96,7 +96,7 @@ o.rewind(-1)
9696
[ 0, 1, 2, 6, 5, 4, 3 ]
9797
[ 0, 1, 2, 5, 4, 3, 6 ]
9898
o.random()
99-
[ 0, 1, 2, 6, 5, 4, 3 ]
99+
[ 3, 4, 5, 2, 1, 0, 6 ]
100100
o.dispose()
101101
Abacus.Tensor(6,{type:"partial",data:{0:"{0..4}",1:"[0]+1",2:"[0]+[1]"},ordering:"<>"}).completeWith(Abacus.Permutation(6-3))
102102
o.total()
@@ -129,7 +129,7 @@ o.rewind(-1)
129129
[ 2, 3, 5, 0, 1, 4 ]
130130
[ 1, 2, 3, 0, 4, 5 ]
131131
o.random()
132-
[ 2, 3, 5, 4, 1, 0 ]
132+
[ 2, 3, 5, 1, 0, 4 ]
133133
o.dispose()
134134
Abacus.Tensor(6,{type:"partial",data:{0:"{0..4}",1:"[0]+1",2:"[0]+[1]",3:"5"},ordering:"<>"}).completeWith(Abacus.Permutation(6-4))
135135
o.total()
@@ -142,5 +142,5 @@ o.rewind(-1)
142142
[ 1, 2, 3, 5, 4, 0 ]
143143
[ 1, 2, 3, 5, 0, 4 ]
144144
o.random()
145-
[ 1, 2, 3, 5, 0, 4 ]
145+
[ 1, 2, 3, 5, 4, 0 ]
146146
o.dispose()

test/conditional_permutations_boolean.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ o.rewind(-1)
449449
[ 0, 1, 3, 4, 2, 5 ]
450450
[ 0, 2, 3, 4, 1, 5 ]
451451
o.random()
452-
[ 0, 3, 1, 5, 2, 4 ]
452+
[ 2, 3, 4, 5, 1, 0 ]
453453
o.dispose()
454454
6,4-Combinations where values in 0th position ARE (0,1) and in 1st position [0]+1
455455
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("<"))
@@ -490,5 +490,5 @@ o.order("revlex|revlex")
490490
[ 0, 1, 2, 4 ]
491491
[ 0, 1, 2, 3 ]
492492
o.random()
493-
[ 0, 1, 3, 4 ]
493+
[ 1, 2, 3, 4 ]
494494
o.dispose()

test/connected_permutations.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ o = Abacus.Permutation(3,{type:"connected"})
99
o.total()
1010
2
1111
o.random()
12-
[ 2, 0, 1 ]
12+
[ 1, 2, 0 ]
1313
o = Abacus.Permutation(4,{type:"connected"})
1414
o.total()
1515
6
1616
o.random()
17-
[ 2, 3, 1, 0 ]
17+
[ 1, 3, 0, 2 ]
1818
o = Abacus.Permutation(5,{type:"connected"})
1919
o.total()
2020
24
2121
o.random()
22-
[ 3, 2, 0, 4, 1 ]
22+
[ 3, 4, 0, 1, 2 ]
2323
o = Abacus.Permutation(6,{type:"connected"})
2424
o.total()
2525
120
2626
o.random()
27-
[ 1, 5, 3, 4, 0, 2 ]
27+
[ 5, 3, 0, 2, 1, 4 ]

test/cyclic_permutations.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ o.order("colex,reversed")
4747
[ 2, 3, 0, 1 ]
4848
[ 1, 2, 3, 0 ]
4949
o.order("random")
50-
[ 2, 3, 0, 1 ]
5150
[ 0, 1, 2, 3 ]
5251
[ 3, 0, 1, 2 ]
52+
[ 2, 3, 0, 1 ]
5353
[ 1, 2, 3, 0 ]
5454
o.random()
55-
[ 2, 3, 0, 1 ]
55+
[ 3, 0, 1, 2 ]
5656
o.order("colex").range(-3, -1)
5757
[ 2, 3, 0, 1 ]
5858
[ 3, 0, 1, 2 ]

0 commit comments

Comments
 (0)