Sage-ST ä

Newsets

Documentation

CondInclude EmptySet Exclude GetBitPosition
HighIndex In Include Included
SetDifference SetIntersect SetIntersection SetPopulation
SetSize SetSymmetricDifference SetToCompliment SetToEmpty
SetToFull SetUnion




  PROCEDURE SetSize
             (CONST totalElements : CARDINAL) : CARDINAL;

  (**
      SetSize - Return number of bitsets required for a set.


      This routine returns the number of bitsets required to contain
      a set with the specified number of elements.

      CALLING SEQUENCE -

        numberOfBitsets := SetSize (maxElement);

      ENTRY -

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        numberOfBitsets : CARDINAL
          The number of bitsets required for this set.
  *)




  PROCEDURE HighIndex
             (CONST totalElements : CARDINAL) : CARDINAL;

  (**
      HighIndex - Return the highest index number for a set;.


      This routine returns index number of the higest bitset for
      a set containing the specified number of elements.

      CALLING SEQUENCE -

        highIndex := SetSize (maxElement);

      ENTRY -

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        highIndex : CARDINAL
          The high index of this set.
  *)




  PROCEDURE GetBitPosition
             (CONST Pos     : CARDINAL;
              VAR   TheWord : CARDINAL;
              VAR   bit     : CARDINAL);

  (**
      GetBitPosition - Return the word and bit of a set element.


      This routine returns the word and bit position of a specified
      set element.

      CALLING SEQUENCE -

        GetBitPosition (Pos, TheWord, Bit)

      ENTRY -

        Pos : CARDINAL
          The set element to be located.

      EXIT -

        TheWord : CARDINAL
          The word position of the specified set element.

        Bit : CARDINAL
          The bit position of the word containing the
          specified element.
  *)




  PROCEDURE In
             (CONST TheSet  : ARRAY OF ModSys.BitSet;
              CONST TheWord : CARDINAL;
              CONST bit     : CARDINAL) : BOOLEAN;

  (**
      In - Check to see if a bit is in a bitset.


      This routine checks to see if a bit is in a particular word of
      an array of BitSet.

      CALLING SEQUENCE -

        Test := In (S, Bit, TheWord)

      ENTRY -

        TheSet : ARRAY OF BitSet
          An array of bitsets representing the elements of a set.

        TheWord : CARDINAL
          The Word of the set S to be tested.

        Bit : CARDINAL
          The bit of the word in the set S to be tested.

      EXIT -

        Test : BOOLEAN
          TRUE if the element is in the set.
  *)




  PROCEDURE Included
             (CONST TheSet : ARRAY OF ModSys.BitSet;
              CONST bit    : CARDINAL) : BOOLEAN;

  (**
      Included - Check to see if an element is in a set.


      This routine performs the equivalent of an "IN" set operation
      for a general set of bitsets.

      CALLING SEQUENCE -

        Test := Included (S, Bit)

      ENTRY -

        S : ARRAY OF BitSet
          An array of bitsets representing the elements of a set.

        Bit : CARDINAL
          The set element to be tested in the set S.

      EXIT -

        Test : BOOLEAN
          TRUE if the element is in the set.
  *)




  PROCEDURE Include
             (VAR   TheSet : ARRAY OF ModSys.BitSet;
              CONST bit    : CARDINAL);

  (**
      Include - Include an element in a set.


      This routine performs the equivalent of an "INCL" set operation
      for a general set of bitsets.  This adds the element to the set.

      CALLING SEQUENCE -

        Include (S, Bit)

      ENTRY -

        S : ARRAY OF BitSet
          An array of bitsets representing the elements of a set.

        Bit : CARDINAL
          The set element to be included in the set S.

      EXIT -

        S : ARRAY OF BitSet
          An array of bitsets representing the updated set.
  *)




  PROCEDURE CondInclude
             (VAR   TheSet : ARRAY OF ModSys.BitSet;
              CONST bit    : CARDINAL;
              VAR   SetIt  : BOOLEAN);

  (**
      CondInclude - Conditionally include an element in a set.


      This routine performs the equivalent of an "INCL" set operation
      for a general set of bitsets.  This adds the element to the set
      only if the bit is not currently set.  A flag is returned FALSE
      if the bit was already set.

      CALLING SEQUENCE -

        CondInclude (S, Bit, SetIt)

      ENTRY -

        S : ARRAY OF BitSet
          An array of bitsets representing the elements of a set.

        Bit : CARDINAL
          The set element to be included in the set S.

      EXIT -

        S : ARRAY OF BitSet
          An array of bitsets representing the updated set.

        SetIt : BOOLEAN
          TRUE if the bit was not previously set.
  *)




  PROCEDURE Exclude
             (VAR   TheSet : ARRAY OF ModSys.BitSet;
              CONST bit    : CARDINAL);

  (**
      Exclude - Exclude an element from a set.


      This routine performs the equivalent of an "EXCL" set operation
      for a general set of bitsets.  This removes the element from the set.

      CALLING SEQUENCE -

        Exclude (S, Bit)

      ENTRY -

        S : ARRAY OF BitSet
          An array of bitsets representing the elements of a set.

        Bit : CARDINAL
          The set element to be excluded from the set S.

      EXIT -

        S : ARRAY OF BitSet
          An array of bitsets representing the updated set.
  *)




  PROCEDURE SetToEmpty
             (VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetToEmpty - Generate an empty set.


      This routine clears a set represented by an array of BitSetS
      to the empty set.

      CALLING SEQUENCE -

        SetToEmpty (R, totalElements)

      ENTRY -

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF BitSet
          An array of bitsets representing the empty set;
  *)




  PROCEDURE SetToFull
             (VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetToFull - Generate a full set.


      This routine fills a set represented by an array of BitSetS.

      CALLING SEQUENCE -

        SetToFull (R, totalElements)

      ENTRY -

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF BitSet
          An array of bitsets representing the universe set;
  *)




  PROCEDURE SetToCompliment
             (CONST TheSetIn      : ARRAY OF ModSys.BitSet;
              VAR   TheSetOut     : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetToCompliment - Set a set to the compliment of another.


      This routine compliments a set represented by an array
      of BitSetS.

      CALLING SEQUENCE -

        SetToCompliment (S, R, totalElements)

      ENTRY -

        S : ARRAY OF BitSet
          The set to be complimented.

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF BitSet
          An array of bitsets representing the complimented set;
  *)




  PROCEDURE EmptySet
             (CONST TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL) : BOOLEAN;

  (**
      EmptySet - Test for an empty set.


      This routine tests a set to see if it is empty.

      CALLING SEQUENCE -

        Test := EmptySet (R, totalElements)

      ENTRY -

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the empty set;
  *)




  PROCEDURE SetPopulation
             (VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL) : CARDINAL;

  (**
      SetPopulation - Count the number of elements in a set.


      This routine returns the number of elements in a set.  If the
      set is empty then this routine returns zero.

      CALLING SEQUENCE -

        Knt := SetPopulation (R, totalElements)

      ENTRY -

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the empty set;

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        Knt : CARDINAL
          The number of elements in the set.
  *)




  PROCEDURE SetUnion
             (CONST S1            : ARRAY OF ModSys.BitSet;
              CONST S2            : ARRAY OF ModSys.BitSet;
              VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetUnion - Perform the union of two sets.


      This routine performs the equivalent of a union set operation
      for a general set of bitsets.  An element x is IN the set
      (S1 Union S2) iff (x IN S1) OR (x IN S2)

      CALLING SEQUENCE -

        SetUnion (S1, S2, R, totalElements)

      ENTRY -

        S1 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        S2 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the set (S1 Union S2).
  *)




  PROCEDURE SetDifference
             (CONST S1            : ARRAY OF ModSys.BitSet;
              CONST S2            : ARRAY OF ModSys.BitSet;
              VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetDifference - Perform the difference of two sets.


      This routine performs the equivalent of a difference set operation
      for a general set of bitsets.  An element x is IN the set
      (S1 Difference S2) iff (x IN S1) AND NOT (x IN S2)

      CALLING SEQUENCE -

        SetDifference (S1, S2, R, totalElements)

      ENTRY -

        S1 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        S2 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the set (S1 Difference S2).
  *)




  PROCEDURE SetIntersection
             (CONST S1            : ARRAY OF ModSys.BitSet;
              CONST S2            : ARRAY OF ModSys.BitSet;
              VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetIntersection - Perform the intersection of two sets.


      This routine performs the equivalent of a intersection set operation
      for a general set of bitsets.  An element x is IN the set
      (S1 Intersection S2) iff (x IN S1) AND (x IN S2)

      CALLING SEQUENCE -

        SetIntersection (S1, S2, R, totalElements)

      ENTRY -

        S1 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        S2 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the set (S1 Intersection S2).
  *)




  PROCEDURE SetSymmetricDifference
             (CONST S1            : ARRAY OF ModSys.BitSet;
              CONST S2            : ARRAY OF ModSys.BitSet;
              VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL);

  (**
      SetSymmetricDifference - Perform the symmetric difference of two sets.


      This routine performs the equivalent of a symmetric difference set
      operation for a general set of bitsets.  An element x is IN the set
      (S1 SymmetricDifference S2) iff (x IN S1) # (x IN S2)

      CALLING SEQUENCE -

        SetSymmetricDifference (S1, S2, R, totalElements)

      ENTRY -

        S1 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        S2 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the set
          (S1 SymmetricDifference S2).
  *)




  PROCEDURE SetIntersect
             (CONST S1            : ARRAY OF ModSys.BitSet;
              CONST S2            : ARRAY OF ModSys.BitSet;
              VAR   TheSet        : ARRAY OF ModSys.BitSet;
              CONST totalElements : CARDINAL) : BOOLEAN;

  (**
      SetIntersect - Perform the intersection of two sets.


      This routine performs the equivalent of a intersection set operation
      for a general set of bitsets.  An element x is IN the set
      (S1 Intersection S2) iff (x IN S1) AND (x IN S2)
      This routine also returns a flag if the resulting set is empty.

      CALLING SEQUENCE -

        tst := SetIntersect (S1, S2, R, totalElements)

      ENTRY -

        S1 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        S2 : ARRAY OF ModSys.BitSet
          An array of bitsets representing the elements of a set.

        totalElements : CARDINAL
          The total number of elements in the set.

      EXIT -

        tst : BOOLEAN
          A flag set to TRUE if R is the empty set.

        R : ARRAY OF ModSys.BitSet
          An array of bitsets representing the set (S1 Intersection S2).
  *)




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance