I am implementing Gaussian Elimination using Julia. The important thing is, when doing the elimination the row vectors are kept updating row by row. While writing a for loop to iterate over the row vector and assigning new value to it one by one does not allocate memory, I wonder whether there are any better solutions (but not package functions) that can do the vector assignment (like I need to update the old vector with an older vector and some basic calculation) without memory allocation?
A, B, C is a matrix below, for example I want to do: A = C + B
Any other efficient ways?
First of all, you will get much better results if you do gausian elimination by column since Julia is column major. Secondly you can use broadcasting to do row/column updates without allocations. (you’ll also want to look at @views)