Polymake Template Library (PTL)  3.6
Public Types | Public Member Functions | Protected Member Functions | List of all members
pm::PowerSet< E, Comparator > Class Template Reference

A Set with elements of type Set<E>, providing methods for adding elements while preserving subset or superset independence. Comparator is a functor defining a total ordering on Set<E>. More...

Inheritance diagram for pm::PowerSet< E, Comparator >:
Inheritance graph
[legend]
Collaboration diagram for pm::PowerSet< E, Comparator >:
Collaboration graph
[legend]

Public Types

using element_type = Set< E, Comparator >
 element types
 
using element_comparator = Comparator
 functor type for comparing elements
 
using generic_type = GenericSet
 generic type
 
using top_type = typename Generic< Set< Set< E, Comparator >, Comparator > >::top_type
 top type
 

Public Member Functions

 PowerSet ()
 Create as empty.
 
template<typename Top >
 PowerSet (const GenericSet< Top, Set< E, Comparator >> &S)
 Create from a Set of Sets.
 
template<typename Iterator >
 PowerSet (Iterator first, Iterator last)
 Reads subsets from an input sequence. They must be sorted lexicographically.
 
template<typename Iterator >
 PowerSet (Iterator &&src, typename std::enable_if< assess_iterator< Iterator, check_iterator_feature, end_sensitive >::value &&assess_iterator_value< Iterator, isomorphic_types, Set< E >>::value, void ** >::type=nullptr)
 Create from an iterator.
 
template<typename TSet2 >
PowerSetoperator= (const GenericSet< TSet2, Set< E, Comparator >> &S)
 Compare two PowerSets.
 
template<typename TSet2 >
int insertMax (const GenericSet< TSet2, E, Comparator > &s)
 Adds an independent subset. More...
 
template<typename TSet2 >
int insertMin (const GenericSet< TSet2, E, Comparator > &s)
 Adds an independent subset. More...
 
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...
 
Set copy_permuted (const Permutation &perm) const
 Return the (pointwise) image of this under a permutation.
 
Set copy_permuted_inv (const Permutation &perm) const
 Return the (pointwise) image of this under the inverse of a given permutation.
 
std::enable_if_t< is_compatible_set< Right >::value, top_type & > operator+= (const Right &x)
 Set union
 
std::enable_if_t< is_compatible_element< Right >::value, bool > collect (const Right &x)
 Add to the set, report true if existed formerly.
 
std::enable_if_t< is_compatible_set< Right >::value, top_type & > operator-= (const Right &x)
 Set difference
 
std::enable_if_t< is_compatible_set< Right >::value, top_type & > operator*= (const Right &x)
 Set intersection
 
std::enable_if_t< is_compatible_set< Right >::value, top_type & > operator^= (const Right &x)
 Symmetrical difference.
 
std::enable_if_t< is_compatible_set< Right >::value, Set< Set< E, Comparator >, Comparator > > extract_symdif (const Right &x)
 Compute the symmetrical difference and make *this equal to s.
 
bool operator== (const GenericSet< Set2, Set< E, Comparator >, Comparator > &s) const
 comparison
 
bool operator< (const GenericSet< Set2, Set< E, Comparator >, Comparator > &s) const
 lexicographical comparison
 

Protected Member Functions

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

Detailed Description

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

A Set with elements of type Set<E>, providing methods for adding elements while preserving subset or superset independence. Comparator is a functor defining a total ordering on Set<E>.

Member Function Documentation

◆ insertMax()

template<typename E , typename Comparator >
template<typename TSet2 >
int pm::PowerSet< E, Comparator >::insertMax ( const GenericSet< TSet2, E, Comparator > &  s)
inline

Adds an independent subset.

The new subset will not be added if there already is another subset that includes the given one. All subsets in the PowerSet that are included in the new one are removed.

Returns
1 new subset inserted, smaller subsets possibly deleted.
0 new subset not inserted, because the same subset was already there
-1 new subset not inserted, because there already is a bigger one

◆ insertMin()

template<typename E , typename Comparator >
template<typename TSet2 >
int pm::PowerSet< E, Comparator >::insertMin ( const GenericSet< TSet2, E, Comparator > &  s)
inline

Adds an independent subset.

The new subset will not be added if there already is another subset that is contained in the given one. All subsets in the PowerSet that contain the new one are removed.

Returns
1 new subset inserted, larger subsets possibly deleted
0 new subset not inserted, because the same subset was already there
-1 new subset not inserted, because there already is a smaller one

◆ swap()

void pm::Set< Set< E, Comparator > , Comparator >::swap ( Set< Set< E, Comparator > > &  s)
inlineinherited

Swap the content with another Set.

Parameters
sthe other Set

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