double **matrix = new double*[rows*sizeof(double*)];
This line declares a new matrix variable that hides the one defined in your class. After the constructor runs, the matrix variable defined in your class is still uninitialized.
for(int i=0, j=0; (i < rows, j < columns); i++, j++)
I don't think this does what you think it does. The i < rows
part will be ignored completely and doesn't participate in stopping the loop. That means unless the matrix has the same number of rows and columns every time, you'll try to use an invalid index.
The usual method for traversing a 2D array is this:
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
// Do something at index [i][j]
}
}