Annotation of OpenXM_contrib/PHC/Ada/Root_Counts/Symmetry/permutations.ads, Revision 1.1.1.1
1.1 maekawa 1: with Standard_Integer_Vectors;
2:
3: package Permutations is
4:
5: -- DESCRIPTION :
6: -- This package defines the type Permutation.
7:
8: type Permutation is new Standard_Integer_Vectors.Vector;
9: type Link_to_Permutation is new Standard_Integer_Vectors.Link_to_Vector;
10:
11: -- DESCRIPTION :
12: -- A permutation p defines the image of i -> p(i).
13: -- As also negative entries are alowed, sign permutations
14: -- will be modelled as follows:
15: -- let perm = (1 3 -2), applied to F=(f1,f2,f3):
16: -- perm*F = (f1,f3,-f2).
17:
18: function Is_Permutation ( p : Permutation ) return boolean;
19:
20: -- DESCRIPTION :
21: -- Checks whether the vector p models a permutation:
22: -- p(i) /= p(j) and p(i) /= -p(j), for all i /= j and
23: -- -p'last <= p(i) <= p'last.
24:
25: function Equal ( p1,p2 : Permutation ) return boolean;
26:
27: -- DESCRIPTION :
28: -- Returns true if both permutations are equal.
29:
30: function "*" ( p1,p2 : Permutation ) return Permutation;
31:
32: -- DESCRIPTION :
33: -- returns p1 `after' p2
34: -- (1 3 -2) * (2 -1 3) = (3 -1 -2)
35: -- REQUIRED :
36: -- p1'range = p2'range
37:
38: function inv ( p : Permutation ) return Permutation;
39:
40: -- DESCRIPTION :
41: -- inv(p)*p = p*inv(p) = the identical transformation
42:
43: end Permutations;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>