32 #ifndef GUM_DATABASE_TABLE_H 33 #define GUM_DATABASE_TABLE_H 186 template <
template <
typename >
class ALLOC = std::allocator >
190 template <
typename TX_DATA >
191 using DBVector = std::vector< TX_DATA, ALLOC< TX_DATA > >;
194 template <
typename TX_DATA >
198 template <
typename TX_DATA >
200 std::vector< DBRow< TX_DATA, ALLOC >, ALLOC< DBRow< TX_DATA, ALLOC > > >;
202 template <
template <
typename >
class XALLOC >
236 template <
template <
typename >
class XALLOC >
278 DatabaseTable< ALLOC >& operator=(const DatabaseTable< ALLOC >& from);
281 DatabaseTable< ALLOC >& operator=(DatabaseTable< ALLOC >&& from);
307 const
std::
size_t input_column,
308 const
bool unique_column = true);
332 const
std::
size_t input_column,
333 const
bool unique_column = true);
352 template < template < typename > class XALLOC >
355 const
std::
size_t input_column,
356 std::vector<
std::
string, XALLOC<
std::
string > > missing_symbols,
357 const
bool unique_column = true);
374 const
bool k_is_input_col = false);
393 translator(const
std::
size_t k, const
bool k_is_input_col = false) const;
409 const
bool k_is_input_col = false) const;
440 virtual
void setVariableNames(
441 const
std::vector<
std::
string, ALLOC<
std::
string > >& names,
442 const
bool from_external_object = true) final;
477 const
bool from_external_object = true) final;
503 const
bool k_is_input_col = false) const;
541 const
bool k_is_input_col = false) const;
562 void reorder(const
std::
size_t k, const
bool k_is_input_col = false);
598 virtual
void insertRow(
599 const
std::vector<
std::
string, ALLOC<
std::
string > >& new_row) final;
611 virtual
void insertRow(
Row< DBTranslatedValue >&& new_row,
612 const
IsMissing contains_missing_data) final;
624 virtual
void insertRow(const
Row< DBTranslatedValue >& new_row,
625 const
IsMissing contains_missing_data) final;
634 virtual
void insertRow(const
Row<
DBCell >& new_row) final;
643 virtual
void insertRow(
Row<
DBCell >&& new_row) final;
691 virtual
void clear() final;
706 #ifndef DOXYGEN_SHOULD_SKIP_THIS 724 std::size_t __getKthIndex(
const std::size_t k,
725 const bool k_is_input_col)
const;
732 const bool k_is_input_col)
const;
753 template <
typename Functor1,
typename Functor2 >
754 void __threadProcessDatabase(Functor1& exec_func, Functor2& undo_func);
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The common class for the tabular database tables.
Base class for every random variable.
std::size_t size_type
Types for STL compliance.
std::vector< TX_DATA, ALLOC< TX_DATA > > DBVector
the type for the vectors used in the DatabaseTable
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void ignoreColumn(const std::size_t k, const bool from_external_object=true) final
makes the database table ignore from now on the kth column of the input dataset or the column parsed ...
DBVector< std::size_t > domainSizes() const
returns the domain sizes of all the variables in the database table
typename IDatabaseTable< DBTranslatedValue, ALLOC >::HandlerSafe HandlerSafe
the safe handler type
const DBTranslatorSet< ALLOC > & translatorSet() const
returns the set of translators
The class representing the original values of the cells of databases.
virtual void insertRow(const std::vector< std::string, ALLOC< std::string > > &new_row) final
insert a new row at the end of the database
HandlerSafe iterator_safe
Types for STL compliance.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::vector< std::string, XALLOC< std::string > > MissingValType
std::vector< DBRow< TX_DATA, ALLOC >, ALLOC< DBRow< TX_DATA, ALLOC > > > Matrix
the type for the matrices stored into the database
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The union class for storing the translated values in learning databases.
ALLOC< DBTranslatedValue > allocator_type
Types for STL compliance.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Representation of a setA Set is a structure that contains arbitrary elements.
bool needsReordering(const std::size_t k, const bool k_is_input_col=false) const
indicates whether a reordering is needed to sort the translations of the kth translator or those of t...
virtual DatabaseTable< ALLOC > * clone() const final
virtual copy constructor
Handler iterator
Types for STL compliance.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
typename IDatabaseTable< DBTranslatedValue, ALLOC >::Handler Handler
the unsafe handler type
virtual const DBVector< std::size_t > inputColumns() const final
returns the set of columns of the original dataset that are present in the DatabaseTable ...
The base class for all the tabular database cell translators.
const DBTranslator< ALLOC > & translator(const std::size_t k, const bool k_is_input_col=false) const
returns either the kth translator of the database table or the first one reading the kth column of th...
std::size_t domainSize(const std::size_t k, const bool k_is_input_col=false) const
returns the domain size of the kth variable of the database table or of that of the first one corresp...
virtual const DBVector< std::size_t > ignoredColumns() const final
returns the set of columns of the original dataset that are ignored
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for storing a record in a database.
const Variable & variable(const std::size_t k, const bool k_is_input_col=false) const
returns either the kth variable of the database table or the first one corresponding to the kth colum...
virtual void insertRows(Matrix< DBTranslatedValue > &&new_rows, const DBVector< IsMissing > &rows_have_missing_vals) final
insert a set of new DBRows at the end of the database
The class representing a tabular database as used by learning tasks.
virtual void clear() final
erase the content of the database, including the names of the variables
std::size_t insertTranslator(const DBTranslator< ALLOC > &translator, const std::size_t input_column, const bool unique_column=true)
insert a new translator into the database table
std::ptrdiff_t difference_type
Types for STL compliance.
virtual void setVariableNames(const std::vector< std::string, ALLOC< std::string > > &names, const bool from_external_object=true) final
sets the names of the variables
typename IDatabaseTable< DBTranslatedValue, ALLOC >::IsMissing IsMissing
the class for packing together the translators used to preprocess the datasets
DatabaseTable(const MissingValType< XALLOC > &missing_symbols, const DBTranslatorSet< ALLOC > &translators=DBTranslatorSet< ALLOC >(), const allocator_type &alloc=allocator_type())
default constructor
void eraseTranslators(const std::size_t k, const bool k_is_input_col=false)
erases either the kth translator or all those parsing the kth column of the input dataset ...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void reorder()
performs a reordering of all the columns