I've many matrix like vector<vector<d ouble> > A1, ..., Am, and I want to initialize them using a function like the following instead of do them repeatly. But it does not work. Who can please shed some light on this?
Code:
double_mtx(vector<vector<double> > &mtx,int row, int col){
mtx.resize(row);
for(int i=0;i<row;i++)mtx[row].resize(col);
for(int i=0;i<row;i++)
for(int j=0;j<col;j++)mtx[i][j]=0.;
return;
}