Sets
[Algorithms]

Collaboration diagram for Sets:

Algorithms for performing operations on sets. More...

Sets

(OLForwardIterator *) + setDifferenceFrom:to:andFrom:andTo:destination:
 Find the difference of two sets.
(OLForwardIterator *) + setDifferenceFrom:to:andFrom:andTo:destination:predicate:
 Find the difference of two sets.
(OLForwardIterator *) + setIntersectionFrom:to:andFrom:andTo:destination:
 Find the intersection of two sets.
(OLForwardIterator *) + setIntersectionFrom:to:andFrom:andTo:destination:predicate:
 Find the intersection of two sets.
(OLForwardIterator *) + setSymmetricDifferenceFrom:to:andFrom:andTo:destination:
 Find the symmetric difference of two sets.
(OLForwardIterator *) + setSymmetricDifferenceFrom:to:andFrom:andTo:destination:predicate:
 Find the symmetric difference of two sets.
(OLForwardIterator *) + setUnionFrom:to:andFrom:andTo:destination:
 Find the union of two sets.
(OLForwardIterator *) + setUnionFrom:to:andFrom:andTo:destination:predicate:
 Find the union of two sets.

Detailed Description

Algorithms for performing operations on sets.

Basic algorithms from set theory are provided, including difference, intersection, symmetric difference and union.

See also:
OLAlgorithm

Function Documentation

+ (OLForwardIterator*) setDifferenceFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest 

Find the difference of two sets.

This message simply sends the message setDifferenceFrom:to:andFrom:andTo:destination:predicate: using OLLess as the predicate.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setDifferenceFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest
predicate: (id< OLBoolBinaryFunction >)  pred 

Find the difference of two sets.

Compute the difference of the two sets by placing all elements contained in the range [first1, last1) but not in the range [first2, last2) into the range starting at dest. The resulting range starting with the element at dest will be sorted by pred. An iterator pointing to one position beyond the last element copied is returned.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set
pred the function object that defines the sorting order of both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setIntersectionFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest 

Find the intersection of two sets.

This message simply sends the message setIntersectionFrom:to:andFrom:andTo:destination:predicate: using OLLess as the predicate.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setIntersectionFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest
predicate: (id< OLBoolBinaryFunction >)  pred 

Find the intersection of two sets.

Compute the intersection of the two sets by placing all elements contained in both [first1, last1) and in [first2, last2) into the range starting at dest. The resulting range starting with the element at dest will be sorted by pred. An iterator pointing to one position beyond the last element copied is returned.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set
pred the function object that defines the sorting order of both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setSymmetricDifferenceFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest 

Find the symmetric difference of two sets.

This message simply sends the message setSymmetricDifferenceFrom:to:andFrom:andTo:destination:predicate: using OLLess as the predicate.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setSymmetricDifferenceFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest
predicate: (id< OLBoolBinaryFunction >)  pred 

Find the symmetric difference of two sets.

Compute the symmetric difference of the two sets by placing all elements contained in [first1, last1) but not contained in [first2, last2) and all elements contained in [first2, last2) but not contained in [first1, last) into the range starting at dest. The resulting range starting with the element at dest will be sorted by pred. An iterator pointing to one position beyond the last element copied is returned.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set
pred the function object that defines the sorting order of both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setUnionFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest 

Find the union of two sets.

This message simply sends the message setUnionFrom:to:andFrom:andTo:destination:predicate: using OLLess as the predicate.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest

+ (OLForwardIterator*) setUnionFrom: (OLForwardIterator *)  first1
to: (OLForwardIterator *)  last1
andFrom: (OLForwardIterator *)  first2
andTo: (OLForwardIterator *)  last2
destination: (OLForwardIterator *)  dest
predicate: (id< OLBoolBinaryFunction >)  pred 

Find the union of two sets.

Compute the union of the two sets by placing all elements contained in [first1, last1) and all elements contained in [first2, last2) into the range starting at dest. The resulting range starting with the element at dest will be sorted by pred. An iterator pointing to one position beyond the last element copied is returned.

Precondition:
  • [first1, last1) and [first2, last2) must be sorted in the order defined by OLLess.
  • The range starting from dest must either have enough valid elements to hold the result, or dest be a type of insert iterator.
Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
first1 the first in the range of the first set
last1 one position beyond the last in the range of the first set
first2 the first in the range of the second set
last2 one position beyond the last in the range of the second set
dest the first element in the range to which to copy the resulting set
pred the function object that defines the sorting order of both the input sets and the resulting output set
Returns:
an iterator pointing to one position beyond the last element copied to dest


ObjectiveLibGenerated Sun Apr 22 15:18:03 2007, © 2004-2007 Will Mason
SourceForge.net Logo