This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: [PATCH] Adding multiset functionality atop GSL 1.13
- From: Brian Gough <bjg at gnu dot org>
- To: Rhys Ulerich <rhys dot ulerich at gmail dot com>
- Cc: gsl-discuss at sourceware dot org
- Date: Wed, 23 Sep 2009 17:47:21 +0100
- Subject: Re: [PATCH] Adding multiset functionality atop GSL 1.13
- References: <4a00655d0909211838i5a1feacfq9bd4ddcad8f27206@mail.gmail.com>
At Mon, 21 Sep 2009 20:38:31 -0500,
Rhys Ulerich wrote:
> Attached is a patch that adds multiset functionality atop GSL 1.13.
> Multisets are like combinations but with replacement-- a single item
> may appear multiple times. Element order is insignificant and
> enumeration uses lexicographical ordering.
>
> The patch builds very, very, very heavily on the existing combinations
> code. Documentation, an example, and unit tests are included.
> Please consider it for inclusion in the next feature release.
Nice work... I've committed the patch.
> P.S. One weakness in the patch the amount of code duplication relative
> to combinations. The underlying data structures are the same, and
> only the _init_first, _init_last, _valid, _next, and _prev functions
> differ in a non-trivial way. With some thought to naming, multisets
> could be a combinations-with-replacement flag. If you accept the
> patch, please consider adding a TODO to both directories to merge the
> functionality.
Done.