create a new row-major 2d array, with provided value or fill function.