Class const_matrix_view_table_transpose (o2scl)

O2scl : Class List

template<class vec_t = std::vector<double>, class fp_t = double>
class const_matrix_view_table_transpose : public o2scl::const_matrix_view

View a o2scl::table object as a matrix.

Note

This stores a pointer to the table and the user must ensure that the pointer is valid with the matrix view is accessed.

Public Functions

inline const_matrix_view_table_transpose()

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

inline const_matrix_view_table_transpose(o2scl::table<vec_t, fp_t> &t, std::vector<std::string> rows)

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

inline void set(o2scl::table<vec_t, fp_t> &t, std::vector<std::string> rows)

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

inline size_t size1()

Return the number of rows.

inline size_t size2()

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.

Protected Attributes

size_t nr

The number of rows in the matrix (equal to the number of pointers to table columns)

std::vector<const vec_t*> col_ptrs

Pointers to each row.

size_t nlines

Number of lines in the table.

Friends

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

Swap method.