25 #ifndef GUM_LEARNING_DB_ROW_GENERATOR_PARSER_H 26 #define GUM_LEARNING_DB_ROW_GENERATOR_PARSER_H 30 #include <agrum/agrum.h> 31 #include <agrum/tools/database/DBHandler.h> 32 #include <agrum/tools/database/databaseTable.h> 33 #include <agrum/tools/database/DBRowGeneratorSet.h> 85 template <
template<
typename>
class ALLOC =
std::
allocator>
108 const allocator_type& alloc );
115 const allocator_type& alloc );
234 void setRange(std::size_t begin, std::size_t end);
247 const std::vector<std::size_t,ALLOC<std::size_t>>& cols_of_interest );
260 std::vector<std::size_t,ALLOC<std::size_t>>&& cols_of_interest );
268 template <
typename GUM_SCALAR >
269 void setBayesNet (
const BayesNet<GUM_SCALAR>& new_bn);
295 #include <agrum/tools/database/DBRowGeneratorParser_tpl.h> virtual DBRowGeneratorParser< ALLOC > * clone() const
virtual copy constructor
DBRowGeneratorSet< ALLOC > _generator_set_
the set of DBRow generators (might be empty)
void setBayesNet(const BayesNet< GUM_SCALAR > &new_bn)
assign a new Bayes net to all the generators that depend on a BN
INLINE void emplace(Args &&... args)
const DatabaseTable< ALLOC >::Handler & handler() const
returns the handler used by the parser
DBRowGeneratorParser(const DBRowGeneratorParser< ALLOC > &from)
copy constructor
DBRowGeneratorParser< ALLOC > & operator=(DBRowGeneratorParser< ALLOC > &&from)
move operator
DBRowGeneratorParser(const DBRowGeneratorParser< ALLOC > &from, const allocator_type &alloc)
copy constructor with a given allocator
std::size_t _generator_size_
the size of the generator set
DBRowGeneratorParser< ALLOC > & operator=(const DBRowGeneratorParser< ALLOC > &from)
copy operator
void setColumnsOfInterest(const std::vector< std::size_t, ALLOC< std::size_t >> &cols_of_interest)
sets the columns of interest: the output DBRow needs only contain values fot these columns ...
allocator_type getAllocator() const
returns the allocator used
virtual ~DBRowGeneratorParser()
destructor
const DBRowGeneratorSet< ALLOC > & generatorSet() const
returns the generator set that is actually used
const DBRow< DBTranslatedValue, ALLOC > & row()
returns a new output row with its corresponding weight
DBRowGeneratorParser(DBRowGeneratorParser< ALLOC > &&filter, const allocator_type &alloc)
move constructor with a given allocator
bool hasRows()
returns true if there are still rows that can be output by the DBRowGeneratorParser ...
virtual DBRowGeneratorParser< ALLOC > * clone(const allocator_type &alloc) const
virtual copy constructor with a given allocator
DBRowGeneratorSet< ALLOC > & generatorSet()
returns the generator set that is actually used
const DatabaseTable< ALLOC > & database() const
returns a reference on the database
void setColumnsOfInterest(std::vector< std::size_t, ALLOC< std::size_t >> &&cols_of_interest)
sets the columns of interest: the output DBRow needs only contain values fot these columns ...
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)
DBRowGeneratorParser(DBRowGeneratorParser< ALLOC > &&filter)
move constructor
void reset()
resets the parser
void setRange(std::size_t begin, std::size_t end)
sets the area in the database the handler will handle
DBRowGeneratorParser(const typename DatabaseTable< ALLOC >::Handler &handler, const DBRowGeneratorSet< ALLOC > &generator_set, const allocator_type &alloc=allocator_type())
default constructor