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

File: [local] / OpenXM_contrib / PHC / Ada / Root_Counts / Stalift / floating_mixed_subdivisions.ads (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:30 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 Generic_Lists;
with Standard_Floating_Numbers;          use Standard_Floating_Numbers;
with Standard_Floating_Vectors;          use Standard_Floating_Vectors;
with Lists_of_Floating_Vectors;          use Lists_of_Floating_Vectors;
with Arrays_of_Floating_Vector_Lists;    use Arrays_of_Floating_Vector_Lists;

package Floating_Mixed_Subdivisions is

-- DESCRIPTION :
--   This package enables working with regular mixed subdivisions.

-- DATA STRUCTURES :

  type Mixed_Subdivision;              -- list of mixed cells
  type Link_to_Mixed_Subdivision is access Mixed_Subdivision;

  type Mixed_Cell is record
    nor : Link_to_Vector;              -- inner normal to the facet
    pts : Link_to_Array_of_Lists;      -- points that span the cell
    sub : Link_to_Mixed_Subdivision;   -- subdivision of the cell
  end record;

  package Lists_of_Mixed_Cells is new Generic_Lists(Mixed_Cell);
  type Mixed_Subdivision is new Lists_of_Mixed_Cells.List;

-- CREATORS :

  function Create ( pts : Array_of_Lists; nor : Vector; tol : double_float )
                  return Mixed_Cell;
  function Create ( pts : Array_of_Lists; nors : List; tol : double_float )
                  return Mixed_Subdivision;

  -- DESCRIPTION :
  --   Creates the mixed cell(s) of those points whose inner product
  --   with the given normal(s) is minimal.
  --   The parameter tol is the tolerance on the precision.

  function Create ( pts : Array_of_Lists; mixsub : Mixed_Subdivision;
                    tol : double_float ) return Mixed_Subdivision;

  -- DESCRIPTION :
  --   Takes the normals of the cells in the given mixed subdivision
  --   and creates the mixed cells by selecting the points whose inner
  --   product with the normals are minimal.

  procedure Update ( pts : in Array_of_Lists; nor : in Vector;
                     mixsub,mixsub_last : in out Mixed_Subdivision );

  -- DESCRIPTION :
  --   Given a tuple of points and a normal, the mixed subdivision will
  --   be updated: either an existing cell will get additional points,
  --   if the normal already occurs in the subdivision, or otherwise,
  --   a new cell will be created and appended to the mixed subdivision.

-- CONSTRUCTORS :

  procedure Copy ( mic1 : in Mixed_Cell; mic2 : in out Mixed_Cell );
  procedure Copy ( mixsub1 : in Mixed_Subdivision; 
                   mixsub2 : in out Mixed_Subdivision );

  -- DESCRIPTION :
  --   Makes a deep copy of the cells and the subdivisions.

  procedure Append_Diff ( first,last : in out Mixed_Subdivision;
                          mic : in Mixed_Cell );

  -- DESCRIPTION :
  --   Appends a mixed cell to the list of cells first, where
  --   last points to the last element of the list first.
  --   The suffix _Diff means that only when the cell does not already
  --   belong to the list first, it will be appended.

  procedure Concat_Diff ( first,last : in out Mixed_Subdivision;
                          mixsub : in Mixed_Subdivision );

  -- DESCRIPTION :
  --   Concatenates all cells in mixsub to the list of cells first,
  --   last is a pointer to the last cell in first.
  --   The suffix _Diff means that only when those cells that do not already
  --   belong to the list first will be appended.

  procedure Construct ( mixsub : in Mixed_Subdivision;
                        first : in out Mixed_Subdivision );
  procedure Construct_Diff ( mixsub : in Mixed_Subdivision;
                             first : in out Mixed_Subdivision );

  -- DESCRIPTION :
  --   Constructs all cells in the mixed subdivision to the front of
  --   the list first.
  --   The suffix _Diff means that only when those cells that do not already
  --   belong to the list first will be constructed to first.

-- SELECTORS :

  function Equal ( mic1,mic2 : Mixed_Cell ) return boolean;
  function Equal ( mixsub1,mixsub2 : Mixed_Subdivision ) return boolean;
  function Equal ( mixsub1,mixsub2 : Link_to_Mixed_Subdivision )
                 return boolean;

  -- DESCRIPTION :
  --   Returns true when two mixed cells and mixed subdivisions are equal.

  function Is_In ( mixsub : Mixed_Subdivision; normal : Vector ) return boolean;
  function Is_In ( mixsub : Mixed_Subdivision; mic : Mixed_Cell )
                 return boolean;

  -- DESCRIPTION :
  --   Returns true if normal or cell belongs to the mixed subdivision,
  --   otherwise false is returned.  When the whole mixed cell is given,
  --   then not only the normal, but also the points will be checked.

-- DESTRUCTORS :

  procedure Deep_Clear ( mic : in out Mixed_Cell );
  procedure Deep_Clear ( mixsub : in out Mixed_Subdivision );
  procedure Deep_Clear ( mixsub : in out Link_to_Mixed_Subdivision );
  procedure Shallow_Clear ( mic : in out Mixed_Cell );
  procedure Shallow_Clear ( mixsub : in out Mixed_Subdivision );
  procedure Shallow_Clear ( mixsub : in out Link_to_Mixed_Subdivision );

  -- DESCRIPTION :
  --   The memory space allocated will be freed.
  --   A shallow clear only destroys the list structures,
  --   while with a deep clear, also the contents of the lists are freed.

end Floating_Mixed_Subdivisions;