Polymake Template Library (PTL): pm::Set< E, Comparator > Class Template Reference
pm::Set< E, Comparator > Class Template Reference

An associative container based on a balanced binary search (AVL) tree. Comparator is a functor defining a total ordering on the element value domain. In most cases, the default choice (lexicographical order) will suffice for your needs. More...

Inheritance diagram for pm::Set< E, Comparator >:
Collaboration diagram for pm::Set< E, Comparator >:

Public Types

typedef E element_type
 element types
 
typedef Comparator element_comparator
 functor type for comparing elements
 
typedef GenericSet generic_type
 generic type
 

Public Member Functions

 Set ()
 Create an empty set.
 
 Set (const Comparator &cmp_arg)
 Create an empty set with a non-default Comparator.
 
template<typename Iterator >
 Set (Iterator &&src, Iterator &&end, typename std::enable_if< assess_iterator_value< Iterator, can_initialize, E >::value, void ** >::type=nullptr)
 Create a Set from an iterator.
 
 Set (const GenericSet< Set, E, Comparator > &s)
 Copy of a disguised Set object.
 
template<typename Set2 >
 Set (const GenericSet< Set2, E, Comparator > &s)
 Copy of an abstract set of the same element type.
 
template<typename Set2 , typename E2 , typename Comparator2 >
 Set (const GenericSet< Set2, E2, Comparator2 > &s)
 Copy of an abstract set with element conversion.
 
 Set (typename function_argument< E >::type x)
 One-element set.
 
void clear ()
 Make the set empty.
 
void resize (int)
 For compatibility with common::boost_dynamic_bitset, add a trivial method.
 
void reset (void)
 For compatibility with common::boost_dynamic_bitset, add a trivial method.
 
void swap (Set &s)
 Swap the content with another Set. More...
 
template<typename Permutation >
Set copy_permuted (const Permutation &perm) const
 Return the (pointwise) image of this under a permutation.
 
template<typename Permutation >
Set copy_permuted_inv (const Permutation &perm) const
 Return the (pointwise) image of this under the inverse of a given permutation.
 
top_type & operator+= (const Right &x)
 Set union
 
bool collect (const Right &x)
 Add to the set, report true if existed formerly.
 
top_type & operator-= (const Right &x)
 Set difference
 
top_type & operator*= (const GenericSet< TSet2, E2, Comparator > &s)
 Set intersection
 
top_type & operator^= (const Right &x)
 Symmetrical difference.
 
Set< E, Comparator > extract_symdif (const GenericSet< TSet2, E2, Comparator > &s)
 Compute the symmetrical difference and make *this equal to s.
 

Protected Member Functions

template<typename Iterator >
void insert_from (Iterator &&src)
 Insert elements from a sequence, coming in any order.
 

Detailed Description

template<typename E, typename Comparator>
class pm::Set< E, Comparator >

An associative container based on a balanced binary search (AVL) tree. Comparator is a functor defining a total ordering on the element value domain. In most cases, the default choice (lexicographical order) will suffice for your needs.

The data tree is attached to the Set object via a smart pointer. Arithmetic operations for sets are listed at operations.
The following standard functions for sets are also implemented:
contains(); empty(); size();

Member Function Documentation

template<typename E, typename Comparator>
void pm::Set< E, Comparator >::swap ( Set< E, Comparator > &  s)
inline

Swap the content with another Set.

Parameters
sthe other Set

The documentation for this class was generated from the following files: