From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20411 invoked by alias); 23 Sep 2009 16:49:11 -0000 Received: (qmail 20344 invoked by uid 22791); 23 Sep 2009 16:49:08 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.network-theory.co.uk (HELO mail.network-theory.co.uk) (66.199.228.187) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Sep 2009 16:47:44 +0000 Date: Wed, 23 Sep 2009 16:49:00 -0000 Message-ID: From: Brian Gough To: Rhys Ulerich Cc: gsl-discuss@sourceware.org Subject: Re: [PATCH] Adding multiset functionality atop GSL 1.13 In-Reply-To: <4a00655d0909211838i5a1feacfq9bd4ddcad8f27206@mail.gmail.com> References: <4a00655d0909211838i5a1feacfq9bd4ddcad8f27206@mail.gmail.com> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/22.2 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Message-Mac: c45af7965345df8a6669005b7f62170b Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00066.txt.bz2 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.