Polymake Template Library (PTL): Generic Sets
Polymake Template Library (PTL)  4.2
Generic Sets

Functions and operations for GenericSets. More...

Collaboration diagram for Generic Sets:

Namespaces

 pm
 global namespace for all classes from the polymake project
 
 operations
 functors for operations on GenericSet objects
 
 polymake
 namespace to be used for client code
 

Classes

class  pm::Set
 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...
 
class  pm::PowerSet
 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...
 
class  pm::SingleElementSetCmp< ElemRef, Comparator >
 A set consisting of exactly one element. More...
 
class  pm::Complement< SetRef >
 Complement as GenericSet. More...
 
class  pm::GenericSet
 Generic type for ordered sets More...
 
class  pm::Set_with_dim< SetRef >
 Set_with_dim as GenericSet. More...
 

Typedefs

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

Functions

template<typename Set2 >
bool pm::GenericSet::operator== (const GenericSet< Set2, E, Comparator > &s) const
 comparison
 
template<typename Set2 >
bool pm::GenericSet::operator< (const GenericSet< Set2, E, Comparator > &s) const
 lexicographical comparison
 
template<typename Comparator , typename E >
auto pm::scalar2set (E &&x)
 construct an one-element set with explicitly specified comparator type
 
template<typename E >
auto pm::scalar2set (E &&x)
 construct an one-element set with standard (lexicographical) comparator type
 
static bool pm::size_estimator< Set1, Set2, both_have_size >::seek_cheaper_than_sequential (const Set1 &set1, const Set2 &set2)
 
template<typename Set1 , typename Set2 , typename E1 , typename E2 , class Comparator >
Int pm::incl (const GenericSet< Set1, E1, Comparator > &s1, const GenericSet< Set2, E2, Comparator > &s2)
 

Detailed Description

Functions and operations for GenericSets.

Function Documentation

◆ incl()

template<typename Set1 , typename Set2 , typename E1 , typename E2 , class Comparator >
Int pm::incl ( const GenericSet< Set1, E1, Comparator > &  s1,
const GenericSet< Set2, E2, Comparator > &  s2 
)

Analyze the inclusion relation of two sets. @returnval 0 $s1$ and $s2$ are equal @returnval -1 $s1$ is included in $s2$ @returnval 1 $s2$ is included in $s1$ @returnval 2 $s1$ and $s2$ are independent

◆ seek_cheaper_than_sequential()

template<typename Set1 , typename Set2 , bool both_have_size = (iterator_traits<typename Set1::iterator>::is_bidirectional && iterator_traits<typename Set2::iterator>::is_bidirectional)>
static bool pm::size_estimator< Set1, Set2, both_have_size >::seek_cheaper_than_sequential ( const Set1 &  set1,
const Set2 &  set2 
)
inlinestatic

Estimates how the insertion or removal of a sequence of elements could be made faster. Returns true if \n2*log(n1) < n1+n2\, which means that seeking for each element of set2 in set1 would be faster than sequentially comparing element pairs from set1 and set2.