[BACK]Return to integer_faces_of_polytope.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Supports

Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Supports/integer_faces_of_polytope.ads, Revision 1.1.1.1

1.1       maekawa     1: with Generic_Lists;
                      2: with Standard_Integer_Vectors;           use Standard_Integer_Vectors;
                      3: with Standard_Integer_VecVecs;           use Standard_Integer_VecVecs;
                      4: with Lists_of_Integer_Vectors;           use Lists_of_Integer_Vectors;
                      5:
                      6: package Integer_Faces_of_Polytope is
                      7:
                      8: -- DESCRIPTION :
                      9: --   This package offers an abstraction for manipulating the k-faces
                     10: --   of an n-dimensional polytope.
                     11:
                     12: -- DATA STRUCTURES :
                     13:
                     14:   type Face is new Link_to_VecVec;
                     15:     -- points that span the face, range 0..k, with k = dimension of face
                     16:
                     17:   type Face_Array is array ( integer range <> ) of Face;
                     18:
                     19:   package Lists_of_Faces is new Generic_Lists(Face);
                     20:   type Faces is new Lists_of_Faces.List;
                     21:
                     22:   type Array_of_Faces is array ( integer range <> ) of Faces;
                     23:
                     24: -- CONSTRUCTORS :
                     25:
                     26:   function Create ( k,n : positive; p : List ) return Faces;
                     27:   function Create ( k,n : positive; p : List; x : Vector ) return Faces;
                     28:
                     29:   -- DESCRIPTION :
                     30:   --   The input for this routine is a list of points, defining a polytope
                     31:   --   in n-dimensional space.  On return, a list of lists of points will be
                     32:   --   given, defining k-faces of the polytope, each spanned by k+1 points.
                     33:   --   When x is provided, then only those k-faces will be returned that
                     34:   --   contain the vector x.  In the latter case, x must belong to p.
                     35:
                     36:   function Create_Lower ( k,n : positive; p : List ) return Faces;
                     37:   function Create_Lower ( k,n : positive; p : List; x : Vector ) return Faces;
                     38:
                     39:   -- DESCRIPTION :
                     40:   --   Only the k-faces of the lower hull will be generated.
                     41:   --   When x is added as parameter, only the k-faces that contain x
                     42:   --   will be returned.  In the latter case, x must belong to p.
                     43:
                     44:   procedure Construct ( first : in out Faces; fs : in Faces );
                     45:
                     46:   -- DESCRIPTION :
                     47:   --   All the faces in fs will be constructed to the front of first.
                     48:
                     49:   procedure Copy ( f1 : in Face; f2 : in out Face );
                     50:
                     51:   -- DESCRIPTION :
                     52:   --   Copies the face f1 to the face f2, after clearing f2.
                     53:
                     54:   procedure Deep_Copy ( f1 : in Faces; f2 : in out Faces );
                     55:
                     56:   -- DESCRIPTION :
                     57:   --   Makes a deep copy from the list f1 to the list f2.
                     58:
                     59: -- SELECTORS :
                     60:
                     61:   function Is_Equal ( f1,f2 : Face ) return boolean;
                     62:
                     63:   -- DESCRIPTION :
                     64:   --   Returns true if both faces are spanned by the same vertices.
                     65:   --   Note that the order of the vertices in the vector do not matter.
                     66:
                     67:   function Is_In ( f : Face; x : Vector ) return boolean;
                     68:
                     69:   -- DESCRIPTION :
                     70:   --   Returns true if the face contains the vector x.
                     71:
                     72:   function Is_In ( fs : Faces; f : Face ) return boolean;
                     73:
                     74:   -- DESCRIPTION :
                     75:   --   Returns true if the face already belongs to the list of faces.
                     76:
                     77:   function Extract_Faces ( fs : Faces; x : Vector ) return Faces;
                     78:
                     79:   -- DESCRIPTION :
                     80:   --   Returns a list of faces that contain x.
                     81:   --   The list on return shares the faces with the original list fs.
                     82:
                     83: -- DESTRUCTORS :
                     84:
                     85:   procedure Deep_Clear ( f : in out Face );
                     86:   procedure Deep_Clear ( fa : in out Face_Array );
                     87:   procedure Deep_Clear ( fs : in out Faces );
                     88:   procedure Deep_Clear ( afs : in out Array_of_Faces );
                     89:   procedure Shallow_Clear ( f : in out Face );
                     90:   procedure Shallow_Clear ( fa : in out Face_Array );
                     91:   procedure Shallow_Clear ( fs : in out Faces );
                     92:   procedure Shallow_Clear ( afs : in out Array_of_Faces );
                     93:
                     94:   -- DESCRIPTION :
                     95:   --   All allocated memory space will be freed.  A deep clear destroys the
                     96:   --   whole structure, while a shallow clear only destroys the structures
                     97:   --   especially set up for the faces.
                     98:
                     99: end Integer_Faces_of_Polytope;

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