Boost logo

Boost :

From: Thomas Lien (tgunlien_at_[hidden])
Date: 2001-10-02 12:38:20


I have developed a Grid<TYPE, ROW, COL> class and was
wondering if there was interest in putting it in the
boost library. I personally think it would be a useful
addition. Algorithms that operate on this type of data
structure could be developed later (such as Matrix
operations for numerical types). Let me know what you
think.

Here is an example usage:
#include "grid.h"

using namespace std;

int main() {
  typedef Grid<int, 5, 20> TestGrid;
  TestGrid mygrid;
  //cout << mygrid.begin() << endl;
  for(int i = 0; i < mygrid.rows(); ++i) {
    for(int j = 0; j < mygrid.columns(); ++j) {
        mygrid[i][j] = i * j;
    }
  }
  const TestGrid mygrid2(mygrid);
  for(int i = 0; i < mygrid2.rows(); ++i) {
    for(int j = 0; j < mygrid2.columns(); ++j) {
      cout << mygrid2[i][j] << " ";
    }
    cout << endl;
  }
  cout << "ITERATOR" << endl;
  cout << "--------" << endl;
  for(TestGrid::const_iterator i = mygrid2.begin();
      i != mygrid2.end();
      ++i)
  {
    cout << *i << " ";
  }
  cout << endl;
  return 0;
}

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk