Obsidian
Probabilistic Geophysical Joint Inversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
obsidian::io::csv Namespace Reference

For reading and writing csv files. More...

Functions

std::vector< std::vector
< std::string > > 
readRaw (const std::string &inCsvFilePath)
 Read csv file into a list of list of string fields.
 
void writeRaw (const std::string &outCsvFilePath, const std::vector< std::vector< std::string >> &data)
 Write list of list of string fields into a csv file.
 
std::pair< size_t, size_t > getRowMatrixDimensions (const std::vector< std::vector< std::string >> &data)
 Extracts row and column dimensions of data in list of list of string fields format. More...
 
template<typename ScalarType , int Rows = Eigen::Dynamic, int Cols = Eigen::Dynamic>
Eigen::Matrix< ScalarType,
Rows, Cols > 
read (const std::string &inCsvFilePath)
 Read csv file into a rectangular matrix. More...
 
template<typename ScalarType , int Rows = Eigen::Dynamic, int Cols = Eigen::Dynamic>
void write (const std::string &outCsvFilePath, const Eigen::Matrix< ScalarType, Rows, Cols > &data)
 Write Matrix into csv file.
 

Detailed Description

For reading and writing csv files.

Function Documentation

std::pair< size_t, size_t > obsidian::io::csv::getRowMatrixDimensions ( const std::vector< std::vector< std::string >> &  data)

Extracts row and column dimensions of data in list of list of string fields format.

Note
Has checks for rectangularity of the data
Assumes there is at least one row.
template<typename ScalarType , int Rows = Eigen::Dynamic, int Cols = Eigen::Dynamic>
Eigen::Matrix<ScalarType, Rows, Cols> obsidian::io::csv::read ( const std::string &  inCsvFilePath)

Read csv file into a rectangular matrix.

Note
Assumes underlying file is rectangular