1. vector二維數(shù)組初始化方法:

2.示例代碼
unsigned int rows = costMatrix.rows();
unsigned int cols = costMatrix.cols();
vector< vector<double> > costFunc(rows,vector<double>(cols,0));
for (unsigned int i = 0; i < rows; ++i)
{
??? for (unsigned int j = 0; j < cols; ++j)
??? {
??????? costFunc[i][j] = (double)costMatrix(i,j);
??? }
}