I'm revamping an old application that use Numerical Recipes' dmatrix
quite extensively. Since one of the reasons I'm working on the application is because its code is about to be opened, I want to replace all of the Numerical Recipes code with code that can be freely distributed.
dmatrix
is a function that returns a matrix of doubles. The called supplies the lower and upper bound for each index, like so:
double **mat = dmatrix(1,3,1,3);
mat
now has 3 rows, from 1 to 3, and 3 columns, from 1 to 3, so that mat[1][1]
is the first element and mat[3][3]
is the last.
I looked at various C++ matrix implementations, none of them allowed me to specify the lower bound of each dimension. Is there something I can use, or do I have to write yet another matrix class for this?