Public Member Functions | Protected Attributes | Friends | List of all members
o2scl::matrix_view_vec_vec< vec1_t, vec2_t > Class Template Reference

View a o2scl::table object as a matrix. More...

#include <vector.h>

Inheritance diagram for o2scl::matrix_view_vec_vec< vec1_t, vec2_t >:
o2scl::matrix_view

Detailed Description

template<class vec1_t, class vec2_t = std::vector<vec1_t>>
class o2scl::matrix_view_vec_vec< vec1_t, vec2_t >

Note
This stores a pointer to the table and the user must ensure that the pointer is valid with the matrix view is accessed.
Idea for Future:
It would be nice to store a reference rather than a pointer, but this causes problems with o2scl::interpm_idw .

Definition at line 2942 of file vector.h.

Public Member Functions

 matrix_view_vec_vec (vec2_t &vv)
 Create a matrix view object from the specified table and list of rows.
 
size_t size1 () const
 Return the number of rows.
 
size_t size2 () const
 Return the number of columns.
 
const double & operator() (size_t row, size_t col) const
 Return a reference to the element at row row and column col.
 
double & operator() (size_t row, size_t col)
 Return a reference to the element at row row and column col.
 
- Public Member Functions inherited from o2scl::matrix_view
const double & operator() (size_t row, size_t col) const
 Return a reference to the element at row row and column col.
 
double & operator() (size_t row, size_t col)
 Return a reference to the element at row row and column col.
 
size_t size1 () const
 Return the number of rows.
 
size_t size2 () const
 Return the number of columns.
 

Protected Attributes

vec2_t * vvp
 Pointer to the table.
 

Friends

void swap (matrix_view_vec_vec &t1, matrix_view_vec_vec &t2)
 Swap method. More...
 

Friends And Related Function Documentation

◆ swap

template<class vec1_t , class vec2_t = std::vector<vec1_t>>
void swap ( matrix_view_vec_vec< vec1_t, vec2_t > &  t1,
matrix_view_vec_vec< vec1_t, vec2_t > &  t2 
)
friend

Just swap the pointer

Definition at line 2953 of file vector.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).