36#ifndef STK_DATAHANDLER_H
37#define STK_DATAHANDLER_H
55template<
typename Type>
108 template<
typename Type>
119 template<
typename Array>
122 template<
typename Type>
132 std::vector<int>
colIndex(std::string
const& idData)
const;
147template<
typename Type>
151#ifdef STK_MIXTURE_VERY_VERBOSE
152 stk_cout <<
_T(
"In DataHandler::getData, idData = ") << idData <<
_T(
"\n");
160 int j=
data.beginCols();
168template<
typename Type>
170 , std::string
const& idData
178 for (
int j=
data.beginCols();
j<=
data.lastIdxCols(); ++
j)
182 for (
int i=
data.beginRows();
i <
data.endRows(); ++
i)
190template<
typename Array>
192 , std::string
const& idData
200 for (
int j=
data.beginCols();
j<=
data.lastIdxCols(); ++
j)
204 for (
int i=
data.beginRows();
i <
data.endRows(); ++
i)
In this file, we define the final class Array2D.
In this file we define the class TReadWriteCsv.
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
A class derived from a DataHandlerBase allows to store various data sets identified by an idData and ...
std::map< std::string, std::string > InfoMap
bool addInfo(std::string const &idData, std::string const &idModel)
Add an info descriptor to the data handler.
implementation of the DataHandlerBase class using ReadWriteCsv and Array2D.
void getData(std::string const &idData, Array2D< Type > &data) const
void setWithNames(bool withNames)
set withNames flag
ReadWriteCsv descriptor_
descriptor files with two rows.
ReadWriteCsv const & descriptor() const
get the whole descriptor set
bool withNames_
first line with names ?
bool readDataFromArray(ExprBase< Array > const &data, std::string const &idData, std::string const &idModel)
read a data set from an Array or Expression.
ReadWriteCsv data_
data files
void removeData(std::string const &idData)
remove the data with the given idData
DataHandlerBase< DataHandler >::InfoMap InfoMap
std::vector< int > colIndex(std::string const &idData) const
lookup on the descriptors in order to get the columns of the ReadWriteCsv with the Id idData.
bool readDataFromArray2D(Array2D< Type > const &data, std::string const &idData, std::string const &idModel)
read a data set from an Array2D.
DataHandler()
default constructor
bool readDataFromCsvFile(std::string const &datafile, std::string descriptorfile)
read a data file and its companion description file.
ReadWriteCsv const & data() const
get the whole data set
DataHandlerBase< DataHandler > Base
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
String typeToString(Type const &t, std::ios_base &(*f)(std::ios_base &)=std::dec)
convert a Type to String
String stringNa
Representation of a Not Available value.
const int baseIdx
base index of the containers created in STK++.
The namespace STK is the main domain space of the Statistical ToolKit project.
The DataHandlerTraits will give the type of container furnished by the concrete implementations of th...