aGrUM  0.13.2
gum::learning::IdSet< Alloc > Class Template Reference

transforms an unordered set of ids into an (increasingly) ordered one More...

#include <idSet.h>

Public Member Functions

Constructors / Destructors
 IdSet ()
 default constructor More...
 
 IdSet (const std::initializer_list< Idx > list)
 initializer list constructor More...
 
template<typename OtherAlloc >
 IdSet (const std::vector< Idx, OtherAlloc > &ids, Size sz)
 default constructor More...
 
 IdSet (const IdSet< Alloc > &from)
 copy constructor More...
 
template<typename OtherAlloc >
 IdSet (const IdSet< OtherAlloc > &from)
 generalized copy constructor More...
 
 IdSet (IdSet< Alloc > &&from)
 move constructor More...
 
 ~IdSet ()
 destructor More...
 
Operators
IdSet< Alloc > & operator= (const IdSet< Alloc > &from)
 copy operator More...
 
template<typename OtherAlloc >
IdSet< Alloc > & operator= (const IdSet< OtherAlloc > &from)
 generalized copy operator More...
 
IdSet< Alloc > & operator= (IdSet< Alloc > &&from)
 move operator More...
 
Idx operator[] (Idx index) const noexcept
 returns the id stored at a given index More...
 
IdSet< Alloc > & operator<< (Idx id)
 inserts a new element into the set (assuming it is a Boolean) More...
 
template<typename OtherAlloc >
bool operator== (const IdSet< OtherAlloc > &from) const noexcept
 returns true if both sets are equal More...
 
template<typename OtherAlloc >
bool operator!= (const IdSet< OtherAlloc > &from) const noexcept
 returns true if the sets differ More...
 
Accessors / Modifiers
const std::vector< Idx, Alloc > & ids () const noexcept
 returns the set of ids contained in the object More...
 
Size size () const noexcept
 returns the domain size of the id set More...
 
void setSize (Idx) noexcept
 sets the domain size of the set More...
 
std::string toString () const noexcept
 returns the content of the set as a string More...
 
template<typename OtherAlloc >
bool isSubset (const IdSet< OtherAlloc > &otherset) const noexcept
 indicates wether the current object is a subset of 'otherset' More...
 

Detailed Description

template<typename Alloc = std::allocator< Idx >>
class gum::learning::IdSet< Alloc >

transforms an unordered set of ids into an (increasingly) ordered one

IdSets are used by RecordCounters to detect which sets of variables are included in other sets. With this knowledge, RecordCounters only parse the database for counting the number of observations of non-included sets of variables and they subsequently deduce from these counts those for the included sets.

Definition at line 57 of file idSet.h.

Constructor & Destructor Documentation

template<typename Alloc = std::allocator< Idx >>
gum::learning::IdSet< Alloc >::IdSet ( )

default constructor

template<typename Alloc = std::allocator< Idx >>
gum::learning::IdSet< Alloc >::IdSet ( const std::initializer_list< Idx list)

initializer list constructor

template<typename Alloc = std::allocator< Idx >>
template<typename OtherAlloc >
gum::learning::IdSet< Alloc >::IdSet ( const std::vector< Idx, OtherAlloc > &  ids,
Size  sz 
)

default constructor

template<typename Alloc = std::allocator< Idx >>
gum::learning::IdSet< Alloc >::IdSet ( const IdSet< Alloc > &  from)

copy constructor

template<typename Alloc = std::allocator< Idx >>
template<typename OtherAlloc >
gum::learning::IdSet< Alloc >::IdSet ( const IdSet< OtherAlloc > &  from)

generalized copy constructor

template<typename Alloc = std::allocator< Idx >>
gum::learning::IdSet< Alloc >::IdSet ( IdSet< Alloc > &&  from)

move constructor

template<typename Alloc = std::allocator< Idx >>
gum::learning::IdSet< Alloc >::~IdSet ( )

destructor

Member Function Documentation

template<typename Alloc = std::allocator< Idx >>
const std::vector< Idx, Alloc >& gum::learning::IdSet< Alloc >::ids ( ) const
noexcept

returns the set of ids contained in the object

template<typename Alloc = std::allocator< Idx >>
template<typename OtherAlloc >
bool gum::learning::IdSet< Alloc >::isSubset ( const IdSet< OtherAlloc > &  otherset) const
noexcept

indicates wether the current object is a subset of 'otherset'

template<typename Alloc = std::allocator< Idx >>
template<typename OtherAlloc >
bool gum::learning::IdSet< Alloc >::operator!= ( const IdSet< OtherAlloc > &  from) const
noexcept

returns true if the sets differ

template<typename Alloc = std::allocator< Idx >>
IdSet< Alloc >& gum::learning::IdSet< Alloc >::operator<< ( Idx  id)

inserts a new element into the set (assuming it is a Boolean)

template<typename Alloc = std::allocator< Idx >>
IdSet< Alloc >& gum::learning::IdSet< Alloc >::operator= ( const IdSet< Alloc > &  from)

copy operator

template<typename Alloc = std::allocator< Idx >>
template<typename OtherAlloc >
IdSet< Alloc >& gum::learning::IdSet< Alloc >::operator= ( const IdSet< OtherAlloc > &  from)

generalized copy operator

template<typename Alloc = std::allocator< Idx >>
IdSet< Alloc >& gum::learning::IdSet< Alloc >::operator= ( IdSet< Alloc > &&  from)

move operator

template<typename Alloc = std::allocator< Idx >>
template<typename OtherAlloc >
bool gum::learning::IdSet< Alloc >::operator== ( const IdSet< OtherAlloc > &  from) const
noexcept

returns true if both sets are equal

template<typename Alloc = std::allocator< Idx >>
Idx gum::learning::IdSet< Alloc >::operator[] ( Idx  index) const
noexcept

returns the id stored at a given index

template<typename Alloc = std::allocator< Idx >>
void gum::learning::IdSet< Alloc >::setSize ( Idx  )
noexcept

sets the domain size of the set

template<typename Alloc = std::allocator< Idx >>
Size gum::learning::IdSet< Alloc >::size ( ) const
noexcept

returns the domain size of the id set

template<typename Alloc = std::allocator< Idx >>
std::string gum::learning::IdSet< Alloc >::toString ( ) const
noexcept

returns the content of the set as a string

Member Data Documentation

template<typename Alloc = std::allocator< Idx >>
std::vector< Idx, Alloc > gum::learning::IdSet< Alloc >::__ids
private

the ordered set of ids

Definition at line 145 of file idSet.h.

template<typename Alloc = std::allocator< Idx >>
Size gum::learning::IdSet< Alloc >::__size {0}
private

the domain size of the set

Definition at line 148 of file idSet.h.


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