-
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #18290: enhanced sets and cartesian products
We implement several missing features of sets, enumerated sets and their cartesian products. We add methods `is_empty` and `is_finite` to all sets. We implement most of the methods for cartesian products of sets and enumerated sets (cardinality, rank/unrank, iteration). For example, all commands below were hanging {{{ sage: C = cartesian_product([Permutations(7), Permutations(9)]) sage: C.cardinality() 1828915200 sage: C.unrank(143872745) ([1, 5, 3, 6, 2, 4, 7], [5, 3, 2, 4, 7, 8, 9, 6, 1]) sage: C.rank(_) 143872745 sage: C.random_element() # random ([4, 2, 6, 7, 1, 3, 5], [4, 7, 2, 8, 6, 3, 9, 5, 1]) }}} URL: http://trac.sagemath.org/18290 Reported by: vdelecroix Ticket author(s): Vincent Delecroix Reviewer(s): Nicolas Thiéry
- Loading branch information
Showing
10 changed files
with
538 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.