The code by Doug Bryan, that John mentions at the end of his posting,
was included in the "Ada and Software Engineering Library Version 2
(ASE2)".
Numerous versions of the ASE library were put together by Richard
Conn, the last one in October 2000. They were typically distributed
on CDROM at the time, among others at various Ada events such as ACM
SIGAda and Ada-Belgium conferences.
The last ASE2 version is still available on the Ada-Belgium site:
ftp://ftp.cs.kuleuven.be/pub/Ada-Belgium/ase/index.htm
The s.c. "asset" that includes the Permutations_Class package is at:
ftp://ftp.cs.kuleuven.be/pub/Ada-Belgium/ase/support/cardcatx/csparts.htm
The relevant source code is included in the files CSPARTS.SRC and
CSPARTB2.SRC in the csparts.zip archive, retrievable via the above URL.
Enjoy... ;-)
Dirk
***@cs.kuleuven.be (for Ada-Belgium/Ada-Europe/SIGAda/WG9)
*** 20th Intl.Conf.on Reliable Software Technologies - Ada-Europe'2015
*** June 22-26, 2015 **** Madrid, Spain **** http://www.ada-europe.org
= Newsgroups: comp.lang.ada
= Date: Fri, 3 Oct 2014 11:50:30 -0700 (PDT)
= Subject: Re: Permutation generator in ada library
= From: ***@gmail.com
=
[...]
=
= I can address the original issue about permutation-generating Ada.
= >From my pack-rat days, I'm aware of three implementations that might
= serve.
=
[...]
=
= 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. ***@gmail.com
=
=
= -- Unit name : Permutations_Class
= -- Version : 1.0
= -- Author : Doug Bryan
= -- : Computer Systems Lab
= -- : Stanford University
= -- : Stanford CA, 94305
= -- DDN Address : ***@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