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