I would like to make the following broadcasted expression work:
J = rand(4,4)
fx1 = rand(2,2)
fx2 = rand(2,2)
@. J[:,1] = fx1 + fx2
I really want some kind of:
@. J[:,1] = vec(fx1 + fx2)
where this vec is saying it should reshape to be 4x1, but I don't want to have to make this allocating. How could this be generically handled (i.e. no indexing on the fx)?