carl  24.04
Computer ARithmetic Library
carl::covering::TypedSetCover< Set > Class Template Reference

Represents a set cover problem where a set is represented by some type. More...

#include <TypedSetCover.h>

Collaboration diagram for carl::covering::TypedSetCover< Set >:

Public Member Functions

void set (const Set &s, std::size_t element)
 States that s covers the given element. More...
 
void set (const Set &s, const Bitset &elements)
 States that s covers the given elements. More...
 
const Set & get_set (std::size_t sid) const
 
 operator const SetCover & () const
 Returns the underlying set cover. More...
 
const auto & set_cover () const
 Returns the underlying set cover. More...
 
auto & set_cover ()
 Returns the underlying set cover. More...
 
template<typename F >
std::vector< Set > get_cover (F &&heuristic)
 Convenience function to run the given heuristic on this set cover. More...
 

Private Member Functions

std::size_t get_set_id (const Set &s)
 Gets id for a set, creates a new id if necessary. More...
 

Private Attributes

SetCover mSetCover
 The actual set cover. More...
 
std::vector< Set > mSets
 Maps id to set. More...
 
std::map< Set, std::size_t > mSetMap
 Maps set to id. More...
 

Friends

template<typename T >
std::ostream & operator<< (std::ostream &os, const TypedSetCover< T > &tsc)
 Print the typed set cover to os. More...
 

Detailed Description

template<typename Set>
class carl::covering::TypedSetCover< Set >

Represents a set cover problem where a set is represented by some type.

It actually wraps a SetCover class and takes care of mapping the custom set type to an id type.

Definition at line 16 of file TypedSetCover.h.

Member Function Documentation

◆ get_cover()

template<typename Set >
template<typename F >
std::vector<Set> carl::covering::TypedSetCover< Set >::get_cover ( F &&  heuristic)
inline

Convenience function to run the given heuristic on this set cover.

Definition at line 67 of file TypedSetCover.h.

◆ get_set()

template<typename Set >
const Set& carl::covering::TypedSetCover< Set >::get_set ( std::size_t  sid) const
inline

Definition at line 47 of file TypedSetCover.h.

Here is the caller graph for this function:

◆ get_set_id()

template<typename Set >
std::size_t carl::covering::TypedSetCover< Set >::get_set_id ( const Set &  s)
inlineprivate

Gets id for a set, creates a new id if necessary.

Definition at line 29 of file TypedSetCover.h.

Here is the caller graph for this function:

◆ operator const SetCover &()

template<typename Set >
carl::covering::TypedSetCover< Set >::operator const SetCover & ( ) const
inlineexplicit

Returns the underlying set cover.

Definition at line 53 of file TypedSetCover.h.

◆ set() [1/2]

template<typename Set >
void carl::covering::TypedSetCover< Set >::set ( const Set &  s,
const Bitset elements 
)
inline

States that s covers the given elements.

Definition at line 43 of file TypedSetCover.h.

Here is the call graph for this function:

◆ set() [2/2]

template<typename Set >
void carl::covering::TypedSetCover< Set >::set ( const Set &  s,
std::size_t  element 
)
inline

States that s covers the given element.

Definition at line 39 of file TypedSetCover.h.

Here is the call graph for this function:

◆ set_cover() [1/2]

template<typename Set >
auto& carl::covering::TypedSetCover< Set >::set_cover ( )
inline

Returns the underlying set cover.

Definition at line 61 of file TypedSetCover.h.

◆ set_cover() [2/2]

template<typename Set >
const auto& carl::covering::TypedSetCover< Set >::set_cover ( ) const
inline

Returns the underlying set cover.

Definition at line 57 of file TypedSetCover.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

template<typename Set >
template<typename T >
std::ostream& operator<< ( std::ostream &  os,
const TypedSetCover< T > &  tsc 
)
friend

Print the typed set cover to os.

Definition at line 78 of file TypedSetCover.h.

Field Documentation

◆ mSetCover

template<typename Set >
SetCover carl::covering::TypedSetCover< Set >::mSetCover
private

The actual set cover.

Definition at line 22 of file TypedSetCover.h.

◆ mSetMap

template<typename Set >
std::map<Set, std::size_t> carl::covering::TypedSetCover< Set >::mSetMap
private

Maps set to id.

Definition at line 26 of file TypedSetCover.h.

◆ mSets

template<typename Set >
std::vector<Set> carl::covering::TypedSetCover< Set >::mSets
private

Maps id to set.

Definition at line 24 of file TypedSetCover.h.


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