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

Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Stalift/integer_mixed_subdivisions.ads, Revision 1.1.1.1

1.1       maekawa     1: with Generic_Lists;
                      2: with Standard_Integer_Vectors;           use Standard_Integer_Vectors;
                      3: with Lists_of_Integer_Vectors;           use Lists_of_Integer_Vectors;
                      4: with Arrays_of_Integer_Vector_Lists;     use Arrays_of_Integer_Vector_Lists;
                      5:
                      6: package Integer_Mixed_Subdivisions is
                      7:
                      8: -- DESCRIPTION :
                      9: --   This package defines regular mixed subdivisions induced by
                     10: --   integer-valued lifting functions.
                     11:
                     12: -- DATA STRUCTURES :
                     13:
                     14:   type Mixed_Subdivision;              -- list of mixed cells
                     15:   type Link_to_Mixed_Subdivision is access Mixed_Subdivision;
                     16:
                     17:   type Mixed_Cell is record
                     18:     nor : Link_to_Vector;              -- inner normal to the facet
                     19:     pts : Link_to_Array_of_Lists;      -- points that span the cell
                     20:     sub : Link_to_Mixed_Subdivision;   -- subdivision of the cell
                     21:   end record;
                     22:
                     23:   package Lists_of_Mixed_Cells is new Generic_Lists(Mixed_Cell);
                     24:   type Mixed_Subdivision is new Lists_of_Mixed_Cells.List;
                     25:
                     26: -- CREATORS :
                     27:
                     28:   procedure Compute_Inner_Normal ( mic : in out Mixed_Cell );
                     29:
                     30:   -- DESCRIPTION :
                     31:   --   Computes the inner normal ortogonal to the points in mic.
                     32:
                     33:   -- REQUIRED : mic.nor /= null, must already be allocated with
                     34:   --            the appropriate size.
                     35:
                     36:   function Create ( pts : Array_of_Lists; nor : Vector ) return Mixed_Cell;
                     37:   function Create ( pts : Array_of_Lists; nors : List )
                     38:                   return Mixed_Subdivision;
                     39:
                     40:   -- DESCRIPTION :
                     41:   --   Creates the mixed cell(s) of those points whose inner product
                     42:   --   with the given normal(s) is minimal.
                     43:
                     44:   function Create ( pts : Array_of_Lists; mixsub : Mixed_Subdivision )
                     45:                   return Mixed_Subdivision;
                     46:
                     47:   -- DESCRIPTION :
                     48:   --   Takes the normals of the cells in the given mixed subdivision
                     49:   --   and creates the mixed cells by selecting the points whose inner
                     50:   --   product with the normals are minimal.
                     51:
                     52:   procedure Update ( pts : in Array_of_Lists; nor : in Vector;
                     53:                      mixsub,mixsub_last : in out Mixed_Subdivision );
                     54:
                     55:   -- DESCRIPTION :
                     56:   --   Given a tuple of points and a normal, the mixed subdivision will
                     57:   --   be updated: either an existing cell will get additional points,
                     58:   --   if the normal already occurs in the subdivision, or otherwise,
                     59:   --   a new cell will be created and appended to the mixed subdivision.
                     60:
                     61:   procedure Update ( mixsub,mixsub_last : in out Mixed_Subdivision;
                     62:                      cells : in Mixed_Subdivision );
                     63:
                     64:   -- DESCRIPTION :
                     65:   --   Applies the other Update to every element in the list cells,
                     66:   --   to augment or modify the mixed subdivision mixsub.
                     67:
                     68: -- CONSTRUCTORS :
                     69:
                     70:   procedure Copy ( mic1 : in Mixed_Cell; mic2 : in out Mixed_Cell );
                     71:   procedure Copy ( mixsub1 : in Mixed_Subdivision;
                     72:                    mixsub2 : in out Mixed_Subdivision );
                     73:
                     74:   -- DESCRIPTION :
                     75:   --   Makes a deep copy of the cells and the subdivisions.
                     76:
                     77:   procedure Append_Diff ( first,last : in out Mixed_Subdivision;
                     78:                           mic : in Mixed_Cell );
                     79:
                     80:   -- DESCRIPTION :
                     81:   --   Appends a mixed cell to the list of cells first, where
                     82:   --   last points to the last element of the list first.
                     83:   --   The suffix _Diff means that only when the cell does not already
                     84:   --   belong to the list first, it will be appended.
                     85:
                     86:   procedure Concat_Diff ( first,last : in out Mixed_Subdivision;
                     87:                           mixsub : in Mixed_Subdivision );
                     88:
                     89:   -- DESCRIPTION :
                     90:   --   Concatenates all cells in mixsub to the list of cells first,
                     91:   --   last is a pointer to the last cell in first.
                     92:   --   The suffix _Diff means that only when those cells that do not already
                     93:   --   belong to the list first will be appended.
                     94:
                     95:   procedure Construct ( mixsub : in Mixed_Subdivision;
                     96:                         first : in out Mixed_Subdivision );
                     97:   procedure Construct_Diff ( mixsub : in Mixed_Subdivision;
                     98:                              first : in out Mixed_Subdivision );
                     99:
                    100:   -- DESCRIPTION :
                    101:   --   Constructs all cells in the mixed subdivision to the front of
                    102:   --   the list first.
                    103:   --   The suffix _Diff means that only when those cells that do not already
                    104:   --   belong to the list first will be constructed to first.
                    105:
                    106: -- SELECTORS :
                    107:
                    108:   function Equal ( mic1,mic2 : Mixed_Cell ) return boolean;
                    109:   function Equal ( mixsub1,mixsub2 : Mixed_Subdivision ) return boolean;
                    110:   function Equal ( mixsub1,mixsub2 : Link_to_Mixed_Subdivision )
                    111:                  return boolean;
                    112:
                    113:   -- DESCRIPTION :
                    114:   --   Returns true when two mixed cells and mixed subdivisions are equal.
                    115:
                    116:   function Is_In ( mixsub : Mixed_Subdivision; normal : Vector ) return boolean;
                    117:   function Is_In ( mixsub : Mixed_Subdivision; mic : Mixed_Cell )
                    118:                  return boolean;
                    119:
                    120:   -- DESCRIPTION :
                    121:   --   Returns true if normal or cell belongs to the mixed subdivision,
                    122:   --   otherwise false is returned.  When the whole mixed cell is given,
                    123:   --   then not only the normal, but also the points will be checked.
                    124:
                    125: -- DESTRUCTORS :
                    126:
                    127:   procedure Deep_Clear ( mic : in out Mixed_Cell );
                    128:   procedure Deep_Clear ( mixsub : in out Mixed_Subdivision );
                    129:   procedure Deep_Clear ( mixsub : in out Link_to_Mixed_Subdivision );
                    130:   procedure Shallow_Clear ( mic : in out Mixed_Cell );
                    131:   procedure Shallow_Clear ( mixsub : in out Mixed_Subdivision );
                    132:   procedure Shallow_Clear ( mixsub : in out Link_to_Mixed_Subdivision );
                    133:
                    134:   -- DESCRIPTION :
                    135:   --   The memory space allocated will be freed.
                    136:   --   A shallow clear only destroys the list structures,
                    137:   --   while with a deep clear, also the contents of the lists are freed.
                    138:
                    139: end Integer_Mixed_Subdivisions;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>