Package: Sequence        GrAL: Packages | Concepts | Homepage

Set Algorithms
[Algorithms on Sequences and Sets]

Collaboration diagram for Set Algorithms:

Classes

class  GrAL::is_element_of_pred< It >
 Predicate class for testing if $ t \in [b,e) $

Template parameters:

  • It : ForwardIterator.
More...
class  GrAL::set_traits< S >
 empty frame for generic access to functionality of representations of sets.

This has to be specialized for user classes. Many classes may be seen a sets in different ways, so this opens the door to use generic set predicates on them, without having to change the classes themselves. More...


Functions

template<class It , class S2 >
bool GrAL::is_subset (It beg, It end, const S2 &s2)
 Tests a sequence [b,e) for inclusion in the set s2.

is_subset(b,e,s2) == true $ \iff [b,e) \subset s2 $.

template<class It >
is_element_of_pred< It > GrAL::is_element_of_pred::is_element_of (It b, It e)
 creator function for is_element_of_pred<It,T>
template<class Cont >
is_element_of_pred< typename
Cont::const_iterator > 
GrAL::is_element_of_pred::is_element_of (const Cont &c)
 creator function for is_element_of_pred<It,T>

Detailed Description

This module collects routines related to set operations.

Function Documentation

template<class It , class S2 >
bool GrAL::is_subset ( It  beg,
It  end,
const S2 &  s2 
) [inline]

Tests a sequence [b,e) for inclusion in the set s2.

is_subset(b,e,s2) == true $ \iff [b,e) \subset s2 $.

Template parameters:

  • It is a Forward Iterator
  • S2 is a set with a membership testing fct:
    • bool is_member(const It::value_type x)
    • is_member(x) = true $ \iff x \in S2 $

Preconditions:

  • end must be reachable from beg, i.e. $ \exists n \geq 0: beg+n = end $

Todo:
Enable set_traits.

Definition at line 57 of file set-primitives.h.


©  Guntram Berti 1997-2009. See the GrAL Homepage for up-to-date information.

Generated on Tue Mar 31 18:53:25 2009 for Sequence by doxygen 1.5.8