19 | | #. Make {{{CartesianProduct}}} an alias for {{{cartesian_product}}}, |
20 | | and possibly deprecated it. |
| 19 | 1. Make {{{CartesianProduct}}} an alias for {{{cartesian_product}}}, and possibly deprecated it. The missing features at this point are: |
| 20 | - Accepting any iterable as input. This probably requires turning |
| 21 | them into parents (e.g. with {{{FiniteEnumeratedSet}}}). The overhead |
| 22 | is probably negligible in most cases, but one would need to double |
| 23 | check that we don't have spots where {{{CartesianProduct}}} is used |
| 24 | intensively for very small calculations. #14224 can be closed once this is fixed. |
| 25 | - Some features of {{{CartesianProduct}}} still need to be lifted to {{{Sets.Finite.CartesianProducts}}} or {{{EnumeratedSets.CartesianProducts}}}. For example, cardinality is currently calculated from the iterator (gasp): |
| 26 | {{{ |
| 27 | sage: F = Permutations(10) |
| 28 | sage: C = cartesian_product([F,F]) |
| 29 | sage: C.cardinality() |
| 30 | *hangs forever* |
| 31 | }}} |
| 32 | Done by #16269/#10963 for cardinality and `__iter__`. Needs double checking for the infinite and zero cases. |
24 | | - Accepting any iterable as input. This probably requires turning them |
25 | | into parents (e.g. with FiniteEnumeratedSet). The overhead is |
26 | | probably negligible in most cases, but one would need to double |
27 | | check that we don't have spots where CartesianProduct is used |
28 | | intensively for very small calculations. |
29 | | |
30 | | #14224 can be closed once this is fixed. |
31 | | |
32 | | - Some features of CartesianProduct still need to be lifted to |
33 | | Sets.Finite.CartesianProducts or EnumeratedSets.CartesianProducts. |
34 | | For example, cardinality is currently calculated from the iterator (gasp): |
35 | | {{{ |
36 | | sage: F = Permutations(10) |
37 | | sage: C = cartesian_product([F,F]) |
38 | | sage: C.cardinality() |
39 | | *hangs forever* |
40 | | }}} |
41 | | |
42 | | Done by #16269/#10963 for cardinality and `__iter__`. Needs |
43 | | double checking for the infinite cases. |
44 | | |
45 | | #. Remove cartesian_product_iterator from the global name space, and |
46 | | deprecate it altogether if, after checking, it turns out to be |
47 | | really just a duplicated of itertools.product. |
48 | | |
49 | | #. #16289: Fix bug in cartesian_product (reported by Vincent Delecroix [1]): |
| 36 | 3. #16289: Fix bug in cartesian_product (reported by Vincent Delecroix in [https://groups.google.com/forum/#!topic/sage-combinat-devel/8Aw63kro_0M this thread]): |
117 | | #. Many features could be further added, like for example making the |
118 | | cartesian product of an additive magma into an additive magma, and |
119 | | so on. A good step was done with #16269. Another step needs to be |
120 | | done after #10963 to ventilate the features in the appropriate |
121 | | axiom categories, and add Distributive.CartesianProducts. |
122 | | |
123 | | [1] https://groups.google.com/forum/#!topic/sage-combinat-devel/8Aw63kro_0M |
124 | | [2] https://groups.google.com/forum/#!msg/sage-devel/tyAxhqxk3ZI/rff7pTrGIQ4J |
| 104 | 7. Many features could be further added, like for example making the cartesian product of an additive magma into an additive magma, and so on. A good step was done with #16269. Another step needs to be done after #10963 to ventilate the features in the appropriate axiom categories, and add {{{Distributive.CartesianProducts}}}. |