totally_noob
04-17-2008, 11:17 AM
Hi all,
I am a total beginner so please don't be hating.
How do I add size() to the MatDoub typedef (or NRMatrix template) so that I can just do this:
void display (const MatDoub & vy)
{ for (int i = 0; i < vy.size(); i++) // loops through each row of vy
{ for (int j = 0; j < vy[i].size(); j++) // loops through each element of each row
cout << vy[i][j] << " "; // prints the jth element of the ith row
cout << endl;
}
sorry for being a lamer!
Cheers
I am a total beginner so please don't be hating.
How do I add size() to the MatDoub typedef (or NRMatrix template) so that I can just do this:
void display (const MatDoub & vy)
{ for (int i = 0; i < vy.size(); i++) // loops through each row of vy
{ for (int j = 0; j < vy[i].size(); j++) // loops through each element of each row
cout << vy[i][j] << " "; // prints the jth element of the ith row
cout << endl;
}
sorry for being a lamer!
Cheers