CsvTable Struct Reference#

DiFfRG: DiFfRG::CsvTable Struct Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
DiFfRG::CsvTable Struct Reference

A numeric table, stored one vector per column. More...

#include <csv.hh>

Public Member Functions

size_t n_rows () const
 
size_t n_cols () const
 
size_t column_index (std::string_view name) const
 Look up a column by name.
 

Public Attributes

std::vector< std::string > header
 
std::vector< std::vector< double > > columns
 

Detailed Description

A numeric table, stored one vector per column.

Column-major because every consumer wants whole columns: the interpolators build one interpolant per column, and indexed cell access is a two-step lookup either way.

Member Function Documentation

◆ column_index()

size_t DiFfRG::CsvTable::column_index ( std::string_view name) const

Look up a column by name.

Unlike an unparseable cell, an unknown column name is a programming error rather than bad data, so this throws instead of yielding NaN.

Exceptions
std::runtime_errorif the table has no header or no column of that name.

◆ n_cols()

size_t DiFfRG::CsvTable::n_cols ( ) const

◆ n_rows()

size_t DiFfRG::CsvTable::n_rows ( ) const

Member Data Documentation

◆ columns

std::vector<std::vector<double> > DiFfRG::CsvTable::columns

One vector of values per column. All columns have the same length.

◆ header

std::vector<std::string> DiFfRG::CsvTable::header

Column names, or empty if the file carried no header.


The documentation for this struct was generated from the following file:
  • /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/csv.hh