Annotation of OpenXM_contrib/PHC/Ada/Schubert/bracket_monomials.ads, Revision 1.1
1.1 ! maekawa 1: with Brackets,Generic_Lists; use Brackets;
! 2:
! 3: package Bracket_Monomials is
! 4:
! 5: -- DESCRIPTION :
! 6: -- This package provides a data abstraction to deal with
! 7: -- bracket monomials as well as operations to manipulate them.
! 8:
! 9: type Bracket_Monomial is private;
! 10:
! 11: -- CONSTRUCTORS : a bracket monomial is the product of brackets.
! 12:
! 13: function Create ( b : Bracket ) return Bracket_Monomial;
! 14:
! 15: -- DESCRIPTION :
! 16: -- Creates a bracket monomial, consisting out of one single bracket.
! 17:
! 18: procedure Multiply ( bm : in out Bracket_Monomial; b : in Bracket );
! 19:
! 20: -- DESCRIPTION :
! 21: -- The bracket monomial is extended with another bracket.
! 22:
! 23: procedure Copy ( bm1 : in Bracket_Monomial; bm2 : in out Bracket_Monomial );
! 24:
! 25: -- DESCRIPTION :
! 26: -- Copies the first bracket monomial to the second one.
! 27: -- Note that bm2 := bm1 leads to sharing data and side effects.
! 28:
! 29: -- OPERATIONS :
! 30:
! 31: function "*" ( b1,b2 : Bracket ) return Bracket_Monomial;
! 32:
! 33: -- DESCRIPTION :
! 34: -- The resulting bracket monomial is the product of b1 and b2.
! 35:
! 36: function "*" ( bm : Bracket_Monomial; b : Bracket ) return Bracket_Monomial;
! 37: function "*" ( b : Bracket; bm : Bracket_Monomial ) return Bracket_Monomial;
! 38:
! 39: -- DESCRIPTION :
! 40: -- Multiplies a bracket monomial with a bracket.
! 41:
! 42: function "*" ( bm1,bm2 : Bracket_Monomial ) return Bracket_Monomial;
! 43: procedure Multiply ( bm1 : in out Bracket_Monomial;
! 44: bm2 : in Bracket_Monomial );
! 45:
! 46: -- DESCRIPTION :
! 47: -- Multiplication of two bracket monomials.
! 48:
! 49: function Is_Equal ( bm1,bm2 : Bracket_Monomial ) return boolean;
! 50:
! 51: -- DESCRIPTION :
! 52: -- Returns true when both monomials contains the same brackets.
! 53:
! 54: function "<" ( bm1,bm2 : Bracket_Monomial ) return boolean;
! 55:
! 56: -- DESCRIPTION :
! 57: -- Let bm1 = b11*b12*..*b1k and bm2 = b21*b22*..*b2l.
! 58: -- Then bm1 < bm2 if b1i < b2i, for some i.
! 59:
! 60: function ">" ( bm1,bm2 : Bracket_Monomial ) return boolean;
! 61:
! 62: -- DESCRIPTION :
! 63: -- Let bm1 = b11*b12*..*b1k and bm2 = b21*b22*..*b2l.
! 64: -- Then bm1 > bm2 if b1i > b2i, for some i.
! 65:
! 66: function Divisible ( bm : Bracket_Monomial; b : Bracket ) return boolean;
! 67:
! 68: -- DESCRIPTION :
! 69: -- Returns true if bm is divisible by b, i.e.: if b occurs in bm.
! 70:
! 71: -- ITERATORS OVER THE BRACKETS :
! 72:
! 73: function Number_of_Brackets ( bm : Bracket_Monomial ) return natural;
! 74:
! 75: -- DESCRIPTION :
! 76: -- Returns the number of brackets in the monomial bm,
! 77: -- or equivalently the degree of the bracket monomial.
! 78:
! 79: generic
! 80: with procedure Process ( b : in Bracket; continue : out boolean );
! 81: procedure Enumerate_Brackets ( bm : in Bracket_Monomial );
! 82:
! 83: -- DESCRIPTION :
! 84: -- Enumerate the brackets in the bracket monomial.
! 85: -- The brackets appear lexicographically in ascending order
! 86: -- as argument of the procedure Process.
! 87: -- Enumeration stops when continue is set to false.
! 88:
! 89: -- DESTRUCTOR :
! 90:
! 91: procedure Clear ( bm : in out Bracket_Monomial );
! 92:
! 93: -- DESCRIPTION :
! 94: -- Deallocates the occupied memory space.
! 95:
! 96: private
! 97:
! 98: package Lists_of_Brackets is new Generic_Lists(Link_to_Bracket);
! 99: type Bracket_Monomial is new Lists_of_Brackets.List;
! 100:
! 101: end Bracket_Monomials;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>