If I have a matrix like:
M = [[1, 2, 3]
[4, 5, 6]
[7, 8, 9]]
And I have a function like:
def expand(v: int) -> Tuple[Tuple[float, float], Tuple[float, float]]:
return [[1.1, 2.2], [3.3, 4.4]]
or some arbitrary mapping to a square matrix, how could I apply this function to the existing matrix so the output is still a valid 2 dimensional matrix?
So I'd like the output matrix to be something like a flatmap where the output is a 6 x 6 matrix and not a 3 x 3 x 2 x 2 matrix.