87 Table(
size_t numRows,
size_t numCols);
102 void set(
size_t rowInd,
size_t colInd, T value)
108 const T&
operator() (
size_t rowInd,
size_t colInd)
const;
111 const T &
get(
size_t rowInd,
size_t colInd)
const
134 for(
size_t i=0; i<
s.size(); i++)
150 for(
size_t i=0; i<
s.size(); i++)
166 for(
size_t i=0; i<
s.size(); i++)
170 std::ostream&
stream(std::ostream& os)
const;
173 std::string
to_csv(
const char *seperator)
const;
197 for(
size_t irow = 0; irow <
m_numRows; ++irow){
198 for(
size_t icol = 0; icol <
m_numCols; ++icol){
199 newData[icol].push_back(
m_data[irow][icol]);
209 typedef std::vector<std::vector<T*> >
DataVec;
241 size_t rowInd,
size_t colInd);
245 size_t rowInd,
size_t colInd);
Useful for printing a table to the terminal or into a file.
Definition: table.h:84
std::vector< char > m_colAlign
Definition: table.h:212
void set_col_alignments(std::string s)
Definition: table.h:163
~Table()
Definition: table_impl.hpp:67
void add_rows(size_t num)
Definition: table_impl.hpp:85
size_t num_rows() const
Definition: table_impl.hpp:137
char m_defaultColAlignment
Definition: table.h:215
char get_col_alignment(size_t col) const
Definition: table.h:187
void set_col_alignment(size_t i_col, const char *c)
Definition: table.h:158
void transpose()
Definition: table.h:193
std::vector< std::vector< T * > > DataVec
Definition: table.h:209
Table()
Definition: table_impl.hpp:45
void set(size_t rowInd, size_t colInd, T value)
uses operator() to set an entry to a value
Definition: table.h:102
std::string to_string() const
Definition: table_impl.hpp:153
char get_row_sep(size_t row) const
Definition: table.h:175
void set_default_col_alignment(const char *c)
Definition: table.h:154
size_t m_numCols
Definition: table.h:207
std::ostream & stream(std::ostream &os) const
Definition: table_impl.hpp:221
void clear()
Definition: table_impl.hpp:73
DataVec m_data
Definition: table.h:210
void set_default_col_seperator(const char *c)
Definition: table.h:137
void set_col_seperators(std::string s)
Definition: table.h:147
std::vector< char > m_rowSep
Definition: table.h:214
std::string to_latex() const
Definition: table_impl.hpp:163
void set_row_seperators(std::string s)
Definition: table.h:131
T & operator()(size_t rowInd, size_t colInd)
Returns a reference to the given entry.
Definition: table_impl.hpp:117
void set_default_row_seperator(const char *c)
Definition: table.h:122
const T & get(size_t rowInd, size_t colInd) const
uses operator() to get a value
Definition: table.h:111
void set_col_seperator(size_t i_col, const char *c)
Definition: table.h:142
std::vector< char > m_colSep
Definition: table.h:213
void set_row_seperator(size_t i_row, const char *c)
Definition: table.h:126
char m_defaultRowSeperator
Definition: table.h:215
char get_col_sep(size_t col) const
Definition: table.h:181
std::string to_csv(const char *seperator) const
Definition: table_impl.hpp:198
size_t num_cols() const
Definition: table_impl.hpp:143
char m_defaultColSeperator
Definition: table.h:215
void add_cols(size_t num)
Definition: table_impl.hpp:103
size_t m_numRows
Definition: table.h:206
std::ostream & operator<<(std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
Definition: math_matrix.cpp:38
Table< std::string > StringTable
Definition: table.h:248
Table< std::stringstream > StringStreamTable
Definition: table.h:249
std::string EntryToString(const Table< T > &table, size_t rowInd, size_t colInd)
Returns a string-representation of the current entry.
Definition: table_impl.hpp:274