50 typedef std::map<std::string, std::vector<double>>
table_map;
76 void m_set (
const std::vector<std::string> names,
const size_t nrows);
87 void m_set (
const std::vector<std::string> names,
const std::vector<std::vector<double>> values);
94 std::vector<std::string>
m_keys ();
118 Table (
const std::vector<std::string> names,
const std::vector<std::vector<double>> values);
132 Table (
const std::vector<std::string> names,
const size_t nrows);
151 Table (
const std::string input_dir,
const std::string input_file,
const std::vector<std::string> names,
const std::vector<size_t> use_cols={},
const size_t header_lines_to_skip=1);
167 std::vector<double> &
operator[] (
const std::string name);
176 std::vector<std::vector<double>>
operator[] (
const std::vector<std::string> names);
189 void insert (
const std::string name,
const std::vector<double> values,
const bool replace=
false);
202 void insert (
const std::vector<std::string> names,
const std::vector<std::vector<double>> values,
const bool replace=
false);
219 void read (
const std::string input_dir,
const std::string input_file,
const std::vector<std::string> names,
const std::vector<size_t> use_cols = {},
const size_t header_lines_to_skip=1);
232 void write (
const std::string output_dir,
const std::string output_file,
const std::vector<std::string> names={});
Useful generic functions.
table_map m_table
the table in form of std::map
std::vector< std::string > m_keys()
get the map keys
void m_set(const std::vector< std::string > names, const size_t nrows)
function to set internal members
std::vector< double > & operator[](const std::string name)
function to get a column
void write(const std::string output_dir, const std::string output_file, const std::vector< std::string > names={})
function to write columns
void insert(const std::string name, const std::vector< double > values, const bool replace=false)
function to insert a column
Table()=default
default constructor
virtual ~Table()=default
default destructor
void read(const std::string input_dir, const std::string input_file, const std::vector< std::string > names, const std::vector< size_t > use_cols={}, const size_t header_lines_to_skip=1)
function to read from an ascii file
std::map< std::string, std::vector< double > > table_map
Map type used in Table class.
The global namespace of the CosmoBolognaLib