well does that explain why it would work as expected before I had changed the implementation method of my matrix class and not afterwards? All I did mind you was change the indexing operator from [][] to (), granted I rewrote tons of code, I didn't touch "SIZE = (size * (size = rows));".
Maybe I will go back to using [][]. The only reason why I switched in the first place was upon running a test as follows:
1 2 3 4 5 6 7 8
|
typedef int matrix[NINE][NINE];
int counter = 0;
int begin = clock();
while (clock() - begin < 10000 && ++counter)
//apmatrix<int> x; //uncomment this line to test speed of apmatrix
//matrix x; //uncomment this line to test speed of matrix
;
cout << "You declared " << counter << " matrices.\n";
|
I get on average 7 times as more matrix declarations as I do apmatrix (which uses the [][] operator).
I was able to similarily compile the same test with my new matrix.h class and it gives similar results, with about 387,179,376 iterations in 10 seconds for matrix<int> x; and only 54,226,347 in 10 seconds for apmatrix<int> x;.
Is worth it? I won't be able to see the exact results until i get my sudoku class with my matrix.h implementation working correctly, but it may be I may be able to achieve more optimum results by focussing my energies on reworking the recursive algorithm that generates random puzzles instead.
or at least that would have given you guys more time to respond...
|
Sorry that sounded bad. I didn't mean to suggest that I am demanding help. All the help that I have received in the past and may continue to receive I am very greatful for. I don't know what I would do without this forum.