comp.lang.ada
 help / color / mirror / Atom feed
From: jpwoodruff@gmail.com
Subject: Re: Permutation generator in ada library
Date: Fri, 3 Oct 2014 11:50:30 -0700 (PDT)
Date: 2014-10-03T11:50:30-07:00	[thread overview]
Message-ID: <65470b5b-36f7-4289-acd8-114b2590b5da@googlegroups.com> (raw)
In-Reply-To: <5b7788b4-323f-42db-99e9-66c989992abb@googlegroups.com>

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


  parent reply	other threads:[~2014-10-03 18:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03  0:36 Permutation generator in ada library Stribor40
2014-10-03  4:01 ` Stribor40
2014-10-03  4:34   ` AdaMagica
2014-10-03  4:47     ` Stribor40
2014-10-03 19:32       ` Shark8
2014-10-03 20:47         ` Simon Wright
2014-10-04  3:01           ` Shark8
2014-10-04  7:05             ` Simon Wright
2014-10-09 22:29           ` Randy Brukardt
2014-10-03  4:51     ` Stribor40
2014-10-03  6:28       ` Niklas Holsti
2014-10-03 10:10         ` Stribor40
2014-10-03 11:13           ` Simon Wright
2014-10-03  4:36   ` Niklas Holsti
2014-10-03  4:42     ` Stribor40
2014-10-03 11:00   ` Brian Drummond
2014-10-03 16:08     ` Niklas Holsti
2014-10-03 16:57       ` Björn Lundin
2014-10-03 12:54 ` john
2014-10-03 18:50 ` jpwoodruff [this message]
2014-10-04 18:06   ` Dirk Craeynest
2014-10-09 22:37     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox