34 #include <Base/Common/Array2D.hh>
45 void set(
const double d) { data=d; }
46 double get()
const {
return data; }
54 cout << nr <<
" x "<< nc <<
" :\n";
55 for (
unsigned r=0; r<nr; r++){
56 for (
unsigned c=0; c<nc; c++){
57 cout << a(r,c).get() <<
"\t";
67 cout <<
"empty Array2D: ";
69 cout <<
"empty() = "<<boolalpha<<array.
empty()<<endl;
72 cout <<
"empty Array2D of size 2x2 : ";
78 cout <<
"filled Array2D of size 2x2 : ";
83 cout <<
"partially filled Array2D of size 3x3 : ";
88 for (it = array.
begin(); it!=array.
end(); it++, i++){
91 cout <<
"filled Array2D of size 3x3 : ";
94 cout <<
"array[1][1] = "<<array[1][1].get()<<endl;
generic two dimensional rectangular array holding arbitrary data types
for iterator access todo: derive from std::iterator class(es)
void resize(const unsigned nrows, const unsigned ncols)
preserves the content
const_iterator end() const
void fill(const T &val)
fills the array with val
const_iterator begin() const