Convert array into matrix in place

Thank you, but I noticed that using reshape function in a multi threading for loop eats too much memory.
Are there in place alternatives?