simple 2D array. More...
#include <vbl_array_2d.h>
Public Types | |
typedef vcl_size_t | size_type |
typedef T | element_type |
typedef T * | iterator |
typedef T const * | const_iterator |
typedef T & | reference |
typedef T const & | const_reference |
Public Member Functions | |
vbl_array_2d () | |
Default constructor. | |
vbl_array_2d (size_type m, size_type n) | |
Construct m-by-n array. | |
vbl_array_2d (size_type m, size_type n, const T &v) | |
Construct and fill an m-by-n array. | |
vbl_array_2d (vbl_array_2d< T > const &that) | |
Construct from a 2d array. | |
~vbl_array_2d () | |
Destructor. | |
vbl_array_2d< T > & | operator= (vbl_array_2d< T > const &that) |
Assignment. | |
bool | operator== (vbl_array_2d< T > const &that) const |
Comparison. | |
bool | operator!= (vbl_array_2d< T > const &that) const |
void | fill (T value) |
fill with `value'. | |
void | resize (size_type m, size_type n) |
change size. | |
void | clear () |
make as if default-constructed. | |
const_reference | operator() (size_type i, size_type j) const |
reference | operator() (size_type i, size_type j) |
void | put (size_type i, size_type j, T const &x) |
T | get (size_type i, size_type j) const |
T const * | operator[] (size_type i) const |
T * | operator[] (size_type i) |
size_type | rows () const |
Return number of rows. | |
size_type | cols () const |
Return number of columns. | |
size_type | columns () const |
Return number of columns. | |
size_type | size () const |
Return size = (number of rows) * (number of columns). | |
size_type | capacity () const |
T ** | get_rows () |
T const *const * | get_rows () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Private Member Functions | |
void | construct () |
void | construct (size_type m, size_type n) |
void | destruct () |
Private Attributes | |
element_type ** | rows_ |
size_type | num_rows_ |
size_type | num_cols_ |
simple 2D array.
Definition at line 25 of file vbl_array_2d.h.
typedef T const* vbl_array_2d< T >::const_iterator |
Definition at line 38 of file vbl_array_2d.h.
typedef T const& vbl_array_2d< T >::const_reference |
Definition at line 41 of file vbl_array_2d.h.
typedef T vbl_array_2d< T >::element_type |
Definition at line 29 of file vbl_array_2d.h.
typedef T* vbl_array_2d< T >::iterator |
Definition at line 37 of file vbl_array_2d.h.
typedef T& vbl_array_2d< T >::reference |
Definition at line 40 of file vbl_array_2d.h.
typedef vcl_size_t vbl_array_2d< T >::size_type |
Definition at line 28 of file vbl_array_2d.h.
vbl_array_2d< T >::vbl_array_2d | ( | ) | [inline] |
Default constructor.
Definition at line 45 of file vbl_array_2d.h.
vbl_array_2d< T >::vbl_array_2d | ( | size_type | m, |
size_type | n | ||
) | [inline] |
Construct m-by-n array.
Definition at line 48 of file vbl_array_2d.h.
vbl_array_2d< T >::vbl_array_2d | ( | size_type | m, |
size_type | n, | ||
const T & | v | ||
) | [inline] |
Construct and fill an m-by-n array.
Definition at line 51 of file vbl_array_2d.h.
vbl_array_2d< T >::vbl_array_2d | ( | vbl_array_2d< T > const & | that | ) | [inline] |
Construct from a 2d array.
Definition at line 54 of file vbl_array_2d.h.
vbl_array_2d< T >::~vbl_array_2d | ( | ) | [inline] |
Destructor.
Definition at line 60 of file vbl_array_2d.h.
iterator vbl_array_2d< T >::begin | ( | ) | [inline] |
Definition at line 138 of file vbl_array_2d.h.
const_iterator vbl_array_2d< T >::begin | ( | ) | const [inline] |
Definition at line 141 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::capacity | ( | ) | const [inline] |
Definition at line 132 of file vbl_array_2d.h.
void vbl_array_2d< T >::clear | ( | ) | [inline] |
make as if default-constructed.
Definition at line 103 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::cols | ( | ) | const [inline] |
Return number of columns.
Definition at line 125 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::columns | ( | ) | const [inline] |
Return number of columns.
Definition at line 128 of file vbl_array_2d.h.
void vbl_array_2d< T >::construct | ( | ) | [inline, private] |
Definition at line 145 of file vbl_array_2d.h.
void vbl_array_2d< T >::construct | ( | size_type | m, |
size_type | n | ||
) | [inline, private] |
Definition at line 151 of file vbl_array_2d.h.
void vbl_array_2d< T >::destruct | ( | ) | [inline, private] |
Definition at line 165 of file vbl_array_2d.h.
iterator vbl_array_2d< T >::end | ( | ) | [inline] |
Definition at line 139 of file vbl_array_2d.h.
const_iterator vbl_array_2d< T >::end | ( | ) | const [inline] |
Definition at line 142 of file vbl_array_2d.h.
void vbl_array_2d< T >::fill | ( | T | value | ) | [inline] |
fill with `value'.
Definition at line 88 of file vbl_array_2d.h.
T vbl_array_2d< T >::get | ( | size_type | i, |
size_type | j | ||
) | const [inline] |
Definition at line 115 of file vbl_array_2d.h.
T* * vbl_array_2d< T >::get_rows | ( | ) | [inline] |
Definition at line 134 of file vbl_array_2d.h.
T const* const* vbl_array_2d< T >::get_rows | ( | ) | const [inline] |
Definition at line 135 of file vbl_array_2d.h.
bool vbl_array_2d< T >::operator!= | ( | vbl_array_2d< T > const & | that | ) | const [inline] |
Definition at line 83 of file vbl_array_2d.h.
const_reference vbl_array_2d< T >::operator() | ( | size_type | i, |
size_type | j | ||
) | const [inline] |
Definition at line 111 of file vbl_array_2d.h.
reference vbl_array_2d< T >::operator() | ( | size_type | i, |
size_type | j | ||
) | [inline] |
Definition at line 112 of file vbl_array_2d.h.
vbl_array_2d<T>& vbl_array_2d< T >::operator= | ( | vbl_array_2d< T > const & | that | ) | [inline] |
Assignment.
Definition at line 63 of file vbl_array_2d.h.
bool vbl_array_2d< T >::operator== | ( | vbl_array_2d< T > const & | that | ) | const [inline] |
Comparison.
Definition at line 72 of file vbl_array_2d.h.
T const* vbl_array_2d< T >::operator[] | ( | size_type | i | ) | const [inline] |
Definition at line 117 of file vbl_array_2d.h.
T* vbl_array_2d< T >::operator[] | ( | size_type | i | ) | [inline] |
Definition at line 118 of file vbl_array_2d.h.
void vbl_array_2d< T >::put | ( | size_type | i, |
size_type | j, | ||
T const & | x | ||
) | [inline] |
Definition at line 114 of file vbl_array_2d.h.
void vbl_array_2d< T >::resize | ( | size_type | m, |
size_type | n | ||
) | [inline] |
change size.
Definition at line 95 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::rows | ( | ) | const [inline] |
Return number of rows.
Definition at line 122 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::size | ( | ) | const [inline] |
Return size = (number of rows) * (number of columns).
Definition at line 131 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::num_cols_ [private] |
Definition at line 34 of file vbl_array_2d.h.
size_type vbl_array_2d< T >::num_rows_ [private] |
Definition at line 33 of file vbl_array_2d.h.
element_type** vbl_array_2d< T >::rows_ [private] |
Definition at line 32 of file vbl_array_2d.h.