From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.134.137 with SMTP id pk9mr391593igb.0.1412362230606; Fri, 03 Oct 2014 11:50:30 -0700 (PDT) X-Received: by 10.50.142.104 with SMTP id rv8mr5667igb.11.1412362230491; Fri, 03 Oct 2014 11:50:30 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!h18no1261600igc.0!news-out.google.com!bc9ni13481igb.0!nntp.google.com!h18no1261590igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 3 Oct 2014 11:50:30 -0700 (PDT) In-Reply-To: <5b7788b4-323f-42db-99e9-66c989992abb@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=50.184.41.76; posting-account=eLk0BgoAAAA-yA75xm1L7heSizMaESVg NNTP-Posting-Host: 50.184.41.76 References: <5b7788b4-323f-42db-99e9-66c989992abb@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <65470b5b-36f7-4289-acd8-114b2590b5da@googlegroups.com> Subject: Re: Permutation generator in ada library From: jpwoodruff@gmail.com Injection-Date: Fri, 03 Oct 2014 18:50:30 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 3741 X-Received-Body-CRC: 702338882 Xref: news.eternal-september.org comp.lang.ada:22049 Date: 2014-10-03T11:50:30-07:00 List-Id: On Thursday, October 2, 2014 5:36:29 PM UTC-7, Stribor40 wrote: > Does ada have built in function that guven integer N creates all possible permutations. > > I found this code http://rosettacode.org/wiki/Permutations#The_generic_package_Generic_Perm > > but was wondering if i can just call Ada built in function? I can address the original issue about permutation-generating Ada. >From my pack-rat days, I'm aware of three implementations that might serve. One is contained in the library Charles built by Matthew Heany http://home.earthlink.net/~matthewjheaney/charles/index.html His last update was in 2004. The materials are at http://charles.tigris.org/source/browse/charles/src/ -- The second is by Mats Weber. My copy carries dates to 1990. Mats Weber's Ada Component Library, version 2.0 http://mats.weber.org/ada/mw_components.html His document says Copyright (c) 1999 Mats Weber, Ch. du Grillon 10, 1007 Lausanne, Switzerland. These components were originally developed by Mats Weber at EPFL (Swiss Federal Institute of Technology, Computer Science Theory Laboratory and Software Engineering Laboratory) from 1985 to 1990 They carry the GNU General Public License -- My oldest holding is an archeological remnant from Simtel 20, built by Doug Bryan. "This software is released to the Public Domain" but I don't know where there is a public copy. I'd be happy to share with anyone interested. jpwoodruff@gmail.com -- Unit name : Permutations_Class -- Version : 1.0 -- Author : Doug Bryan -- : Computer Systems Lab -- : Stanford University -- : Stanford CA, 94305 -- DDN Address : bryan@su-sierra -- Copyright : (c) -none- -- Date created : 15 April 1985 -- Release date : 15 April 1985 -- Last update : 15 April 1985 -- Machine/System Compiled/Run on : DG MV/10000 ADE 2.2 generic type Item_Type is private; type Index_Type is (<>); type List_Type is array (Index_Type range <>) of Item_Type; package Permutations_Class is generic with procedure Process (A_Permutation : List_Type); procedure Iterate_Through_Length_Factorial_Permutations (Of_Items : List_Type); -- For an actual parameter for Of_Items of length n, n! (n factorial) -- permutations will be produced. -- The procedure permutes the elements in the array ITEMS. -- actually it permutes their indicies and re-arranges the items -- within the list. The procedure does not care of any or all -- of the items in the list are equal (the same). end Permutations_Class; John