The direct access works because you've reserved the space,
and it is faster since it does not involve a function call,
unless perhaps push_back is inlined.
For such similar programs it's better to use an #ifdef:
#define USE_PUSH true // at top of program
// . . .
mtr[i][j] = num;