8 namespace datastructure {
49 : num_rows(0), num_cols(0) {
62 : num_rows(rows), num_cols(cols) {
63 int dims[] = {cols, rows, 1};
114 return arr.getElement(
row, col).getValue();
130 return arr.getElement(
row, col).getValue();
A BRIDGES array type.
Definition: Array2D.h:42
int getNumColumns()
Gets the number of columns of the 2D array.
Definition: Array2D.h:78
void setElement(int row, int col, Element< E > el)
Definition: Array2D.h:103
Bracket_helper operator[](int index)
enables using the bracket [] operator
Definition: Array2D.h:119
virtual ~Array2D()
Definition: Array2D.h:53
Array2D(int rows, int cols)
builds an array of given dimensions
Definition: Array2D.h:61
Element< E > & getElement(int row, int col)
Definition: Array2D.h:91
int getNumRows()
Definition: Array2D.h:70
The foundation of BRIDGES array types. It is not meant to be used directly by students.
Definition: Array.h:21
void setSize(int nd, int *dim)
Set the size of the array.
Definition: Array.h:57
Element< E > & getElement(int index)
Definition: Array.h:108
This is the fundamental building block for all data structures in BRIDGES.
Definition: Element.h:51
Support for drawing Bar charts.
Definition: alltypes.h:4
helper class to make [][] operators work on array 2d. You should never use it directly
Definition: Array2D.h:124
int row
Definition: Array2D.h:126
E const & operator[](int col) const
Definition: Array2D.h:129
Array2D< E > const & arr
Definition: Array2D.h:125
Bracket_helper_const(Array2D< E > &a, int r)
Definition: Array2D.h:127
helper class to make [][] operators work on array 2d. You should never use it directly
Definition: Array2D.h:108
Bracket_helper(Array2D< E > &a, int r)
Definition: Array2D.h:111
int row
Definition: Array2D.h:110
Array2D< E > & arr
Definition: Array2D.h:109
E & operator[](int col)
Definition: Array2D.h:113