aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
DBRowGeneratorParser.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (c) 2005-2024 by Christophe GONZALES(_at_AMU) and Pierre-Henri WUILLEMIN(_at_LIP6) *
3 * info_at_agrum_dot_org *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
25#ifndef GUM_LEARNING_DB_ROW_GENERATOR_PARSER_H
26#define GUM_LEARNING_DB_ROW_GENERATOR_PARSER_H
27
28#include <limits>
29
30#include <agrum/agrum.h>
33
34namespace gum {
35
36 namespace learning {
37
85 public:
86 // ##########################################################################
88 // ##########################################################################
89
91
94 const DBRowGeneratorSet& generator_set);
95
98
101
103 virtual DBRowGeneratorParser* clone() const;
104
107
109
110 // ##########################################################################
112 // ##########################################################################
113
115
118
121
123
124 // ##########################################################################
126 // ##########################################################################
127
129
156 bool hasRows();
157
159
183
185 void reset();
186
189
191 const typename DatabaseTable::Handler& handler() const;
192
194 const DatabaseTable& database() const;
195
198
201
203
213 void setRange(std::size_t begin, std::size_t end);
214
225 void setColumnsOfInterest(const std::vector< std::size_t >& cols_of_interest);
226
237 void setColumnsOfInterest(std::vector< std::size_t >&& cols_of_interest);
238
240
245 template < typename GUM_SCALAR >
246 void setBayesNet(const BayesNet< GUM_SCALAR >& new_bn);
247
249
250
251 private:
254
257
259 std::size_t _generator_size_;
260 };
261
262 } /* namespace learning */
263
264} /* namespace gum */
265
266// always include the template implementation
268
270#ifndef GUM_NO_INLINE
272#endif /* GUM_NO_INLINE */
273
274#endif /* GUM_LEARNING_DB_ROW_GENERATOR_PARSER_H */
Template implementation of the DBRowGeneratorParser class.
Copyright (c) 2005-2024 by Pierre-Henri WUILLEMIN(_at_LIP6) & Christophe GONZALES(_at_AMU) info_at_ag...
class for packing sets of generators
void reset()
resets the parser
std::size_t _generator_size_
the size of the generator set
void setColumnsOfInterest(std::vector< std::size_t > &&cols_of_interest)
sets the columns of interest: the output DBRow needs only contain values fot these columns
const DatabaseTable & database() const
returns a reference on the database
DBRowGeneratorParser & operator=(const DBRowGeneratorParser &from)
copy operator
bool hasRows()
returns true if there are still rows that can be output by the DBRowGeneratorParser
DBRowGeneratorParser & operator=(DBRowGeneratorParser &&from)
move operator
virtual ~DBRowGeneratorParser()
destructor
void setBayesNet(const BayesNet< GUM_SCALAR > &new_bn)
assign a new Bayes net to all the generators that depend on a BN
const DatabaseTable::Handler & handler() const
returns the handler used by the parser
void setRange(std::size_t begin, std::size_t end)
sets the area in the database the handler will handle
DBRowGeneratorParser(const DBRowGeneratorParser &from)
copy constructor
void setColumnsOfInterest(const std::vector< std::size_t > &cols_of_interest)
sets the columns of interest: the output DBRow needs only contain values fot these columns
DBRowGeneratorSet _generator_set_
the set of DBRow generators (might be empty)
const DBRowGeneratorSet & generatorSet() const
returns the generator set that is actually used
DatabaseTable::Handler _handler_
the handler that is really used to parse the database
virtual DBRowGeneratorParser * clone() const
virtual copy constructor
DBRowGeneratorParser(const typename DatabaseTable::Handler &handler, const DBRowGeneratorSet &generator_set)
default constructor
DBRowGeneratorSet & generatorSet()
returns the generator set that is actually used
const DBRow< DBTranslatedValue > & row()
returns a new output row with its corresponding weight
DatabaseTable::Handler & handler()
returns the handler used by the parser
DBRowGeneratorParser(DBRowGeneratorParser &&filter)
move constructor
The class used to pack sets of generators.
The class for storing a record in a database.
Definition DBRow.h:75
The class representing a tabular database as used by learning tasks.
typename IDatabaseTable< DBTranslatedValue >::Handler Handler
the unsafe handler type
The class representing a tabular database stored in RAM.
include the inlined functions if necessary
Definition CSVParser.h:54
gum is the global namespace for all aGrUM entities
Definition agrum.h:46