mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
LoadCSV Class Reference

Load the csv file.This class use boost::spirit to implement the parser, please refer to following link http://theboostcpplibraries.com/boost.spirit for quick review. More...

Public Member Functions

 LoadCSV (std::string file, bool fatal=false)
 
size_t ColSize ()
 
template<typename T , typename MapPolicy >
void GetMatrixSize (size_t &rows, size_t &cols, DatasetMapper< MapPolicy > &info)
 Peek at the file to determine the number of rows and columns in the matrix, assuming a non-transposed matrix. More...
 
template<typename T , typename MapPolicy >
void GetTransposeMatrixSize (size_t &rows, size_t &cols, DatasetMapper< MapPolicy > &info)
 
template<typename T , typename PolicyType >
void Load (arma::Mat< T > &inout, DatasetMapper< PolicyType > &infoSet, bool transpose=true)
 
size_t RowSize ()
 

Detailed Description

Load the csv file.This class use boost::spirit to implement the parser, please refer to following link http://theboostcpplibraries.com/boost.spirit for quick review.

Definition at line 36 of file load_csv.hpp.

Constructor & Destructor Documentation

LoadCSV ( std::string  file,
bool  fatal = false 
)
explicit

Member Function Documentation

size_t ColSize ( )
void GetMatrixSize ( size_t &  rows,
size_t &  cols,
DatasetMapper< MapPolicy > &  info 
)
inline

Peek at the file to determine the number of rows and columns in the matrix, assuming a non-transposed matrix.

This will also take a first pass over the data for DatasetMapper, if MapPolicy::NeedsFirstPass is true. The info object will be re-initialized with the correct dimensionality.

Parameters
rowsVariable to be filled with the number of rows.
colsVariable to be filled with the number of columns.
infoDatasetMapper object to use for first pass.

Definition at line 73 of file load_csv.hpp.

void GetTransposeMatrixSize ( size_t &  rows,
size_t &  cols,
DatasetMapper< MapPolicy > &  info 
)
inline

Definition at line 133 of file load_csv.hpp.

void Load ( arma::Mat< T > &  inout,
DatasetMapper< PolicyType > &  infoSet,
bool  transpose = true 
)
inline

Definition at line 42 of file load_csv.hpp.

size_t RowSize ( )

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