Subj : Re: Matrix Operation To : borland.public.cpp.borlandcpp From : Bruce Salzman Date : Fri Apr 22 2005 03:17 pm > How can I store a two dimension matrix efficiently? Is there a > better alternate for the following? > > double** data; > > data = new double* [rows]; > > for (unsigned i = 0; i < rows; i++) > data[i] = new double[columns]; > One example is the sparse matrix (one with lots of zero elements). http://www.nist.gov/dads/HTML/sparsematrix.html Boost has an implementation: http://www.boost.org/libs/numeric/ublas/doc/matrix_sparse.htm -- Bruce .