Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Implift/trees_of_vectors.ads, Revision 1.1.1.1
1.1 maekawa 1: with Generic_Lists;
2: with Standard_Integer_Vectors; use Standard_Integer_Vectors;
3:
4: package Trees_of_Vectors is
5:
6: -- DESCRIPTION :
7: -- This package provides a data abstraction for working
8: -- with trees of vectors.
9:
10: -- THE DATA STRUCTURES :
11:
12: type Tree_of_Vectors;
13: type Link_to_Tree_of_Vectors is access Tree_of_Vectors;
14:
15: type node is record
16: d : Link_to_Vector;
17: ltv : Link_to_Tree_of_Vectors;
18: end record;
19:
20: package Link_to_Vector_Trees is new Generic_Lists(node);
21: type Tree_of_Vectors is new Link_to_Vector_Trees.List;
22:
23: -- SELECTORS :
24:
25: function Is_In ( tv : Tree_of_Vectors; v : Vector ) return boolean;
26: function Is_In ( tv : Tree_of_Vectors; v : Link_to_Vector ) return boolean;
27:
28: -- DESCRIPTION :
29: -- returns true if v belongs to the top level of the tree.
30:
31: generic
32:
33: with procedure Process ( nd : in node; continue : out boolean );
34:
35: procedure Iterator ( tv : in Tree_of_Vectors );
36:
37: -- DESCRIPTION :
38: -- A walk through the tree will be made, left branch first.
39:
40: -- DESTRUCTORS :
41:
42: procedure Clear ( nd : in out node );
43: procedure Clear ( tv : in out Tree_of_Vectors );
44: procedure Clear ( ltv : in out Link_to_Tree_of_Vectors );
45:
46: -- DESCRIPTION :
47: -- All allocated memory space will be freed.
48:
49: end Trees_of_Vectors;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>