Class matrix_swap_table (o2scl)

O2scl : Class List

class matrix_swap_table : public o2scl::matrix_view

Swap part of a o2scl::table object into a matrix.

Public Functions

inline matrix_swap_table()

Create a matrix view object from the specified table and list of columns.

inline matrix_swap_table(o2scl::table<std::vector<double>> &t, const std::vector<std::string> &col_names)

Create a matrix view object from the specified table and list of columns.

inline void set(o2scl::table<std::vector<double>> &t, const std::vector<std::string> &col_names)

Create a matrix view object from the specified table and list of columns.

inline size_t size1() const

Return the number of rows.

inline size_t size2() const

Return the number of columns.

inline const double &operator()(size_t row, size_t col) const

Return a reference to the element at row row and column col.

inline double &operator()(size_t row, size_t col)

Return a reference to the element at row row and column col.

Protected Attributes

size_t nc

The number of columns.

size_t nlines

The number of lines in the table.

std::vector<std::vector<double>> cols

Array of columns.

Friends

inline friend void swap(matrix_swap_table &t1, matrix_swap_table &t2)

Swap method.