trotter
Class definitions for pseudo-lists that simplify working with structures commonly encountered in combinatorics such as permutations, combinations and subsets.
2.2.2
6.8K downloads/mo
#3450 most downloaded on pub.dev
ram6ler/dart-trotter
What this package is like to depend on
Last release 1 years ago
20 Jul 2025
Ships fairly regularly
a new release about every 11 months
Nearly every release is documented
notes for 19 of 21 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
22 releases · first in 2014
0 releases in the last 12 months
see the full history below
Release timeline
22 releases · Sep 2014 to Jul 2025Releases
latest 22-
2.2.220 Jul 2025Release notes
Open source →- Some typing clarification.
- Removed README generator in favor of using popmark.
-
2.2.120 Jul 2025Release notes
Open source →- Housekeeping.
- Some mistakes in the readme fixed.
- Updated fun-with-trotter-sprites example to work with web.
-
2.2.009 Sep 2023 -
2.1.027 May 2023 -
2.0.009 Sep 2022Nothing published for this version
-
2.0.0-dev.126 Feb 2021 pre-release -
1.2.023 Apr 2020Release notes
Open source →- Added a
Storageclass to wrap other classes; this allows us to add, remove and keep track of arrangements in a memory efficient (one bit per arrangement) way. Can only be used for moderately sized structures. - Updated the fun-with-mastermind example to make use of the storage class.
- Added a
-
1.1.216 Apr 2020Release notes
Open source →- Fixed some minor mistakes in the code.
- Added fun-with-trotter-sprites example.
-
1.1.117 Dec 2019Release notes
Open source →- Followed some of the pub.dev health suggestions.
- Added link to Permutation Products demo.
- Corrected environment requirements (Dart 2.7.0 to support extensions).
-
1.1.013 Dec 2019Release notes
Open source →- Added
extensions toLists andStrings. (Nice Dart 2.7.0 feature!) - Provided functionality for random sampling from the pseudo-lists.
- Added
-
1.0.210 Aug 2018Release notes
Open source →- Cleaned up the type declaration for the iterables.
- Link to Falco-shapes demo.
-
1.0.108 Aug 2018Release notes
Open source →Made the abstract, parent class
Combinatoricsvisible to the user for those cases in which the combinatorics type is not known at the time of declaration. -
1.0.003 Aug 2018Release notes
Open source →- Cleaned up code to be more in line with Dart 2.
- Added
example.dart(and an example output,fun-with-mastermind.md) toexample/.
-
0.9.507 May 2018Release notes
Open source →-
As of Dart 2,
intinstances represent 64 bit, as opposed to arbitrary length, integers. Since trotter often works with very large integers, it needed an overhaul so as to incorporate theBigIntclass. This resulted in several breaking changes, most notably that the base_Combinatoricclass no longer extendsListBase. I have made the class instances callable, however, to address this: code that needs an instance of one of the classes to behave like an iterable just need to call the instance. For example, ifpermsis an instance ofPermutations, we would now use something likefor (var p in perms())(as opposed tofor (var p in perms), which worked in previous versions). The instances can still be thought of as pseudo-lists in that they can be indexed and have several properties and methods that might be expected in a list, such aslengthandindexOf. -
I took advantage of the necessity of making breaking changes mentioned above to make one more: I have renamed the
SelectionsclassCompositions. In combinatorics literature, the term selection is often use as a generic word to mean either combination or permutation. This might have caused confusion in the way I had used the term in previous versions of the library. I think that composition is more appropriate to mean a selection in which order is not important (if a body is composed of materials A, B and C then it is also composed of materials C, B and A) and items are "replaced" (it makes sense to say that a body is composed of two parts A to one part B, for example).
-
-
0.9.110 Dec 2017 -
0.9.007 Dec 2017Release notes
Open source →- Cleaned up and simplified the code so that the structures extend
Lists more naturally. (Structures extendListBasenow instead ofIterable.) - Should be backwards compatible in that code that works in previous versions should also work in this version.
- Structures should now behave better with
Listmethods likemap,where,everyand so on.
- Cleaned up and simplified the code so that the structures extend
-
0.8.513 Jan 2017Release notes
Open source →- Cleaned up the code so that the library may be used in strong mode.
- Added subset of the functionality associated with
Iterables(first,last,any,every,forEachetc.). Some functionality that would be redundant (e.g.isEmpty) or less meaningful/useful (e.g.fold) neglected. Since structures we can represent can "contain" a huge number of arrangements, we need to be careful about using methods that iterate over the structures (likeany,every,forEach).
-
0.8.110 Feb 2016Release notes
Open source →- Added the
Compoundsclass (permutations of unspecified size). - Added the contains method for all classes.
- Corrected
indexOfbehavior for when arrangements that don't exist are passed as arguments; returns -1 if the arrangement is not in the pseudo-list.
- Added the
-
0.8.008 Feb 2016Release notes
Open source →- Added inverses to all the functions so that we can look up arrangements non iteratively (now possible to look up values in arbitrarily large pseudo-lists; this library was incomplete without this functionality!).
- Made the code more readable. Made a few minor tweaks to the existing code.
-
0.5.226 Nov 2014Nothing published for this version
-
0.5.127 Sep 2014 -
0.5.027 Sep 2014Release notes
Open source →First Dart release: support for classes:
- Permutations
- Combinations
- Amalgams (permutations with replacement during arranging)
- Selections (combinations with replacement during arranging)
- Subsets