column and row major order matrix filling