[BACK]Return to partitions_of_sets_of_unknowns.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Product

File: [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Product / partitions_of_sets_of_unknowns.ads (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:29 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with Sets_of_Unknowns;                   use Sets_of_Unknowns;

package Partitions_of_Sets_of_Unknowns is

-- DESCRIPTION :
--   This package provides a data abstraction for enumerating all
--   partitions of a given set of unknowns.

  type partition is array ( positive range <> ) of Set;

-- CREATORS :

  procedure Create ( p : in out Partition; n : in natural );

  -- DESCRIPTION :
  --   Creates all sets in the partition, to be ready to contain
  --   at most n unknowns.

  function Create ( p : Partition ) return Partition;
 
  -- DESCRIPTION :
  --   Returns a new partition which is an exact copy of the given one.

-- CONSTRUCTORS :

  generic 
    with procedure Process ( p : in Partition; continue : out boolean );
  procedure Generate_Partitions ( s : in Set );

  -- DESCRIPTION :
  --   Generates all partitions of a given set of unknowns.
  --   The procedure Process is invoked each time a new partition is
  --   generated.  The generation can be stopped by setting
  --   continue to false.  Otherwise, when continue is set to true,
  --   the generation continues.

  -- NOTE :
  --   While processing the partition, it might be needed to copy
  --   the resulting partition, as sharing occurs.

-- SELECTOR :

  function Number_of_Partitions ( n : natural ) return natural;

  -- DESCRIPTION :
  --   Returns the number of partitions of a set of n unknowns.

-- DESTRUCTOR :

  procedure Clear ( p : in out Partition );

  -- DESCRIPTION :
  --   Deallocates the occupied memory.

end Partitions_of_Sets_of_Unknowns;