araujolma / SOAR

7 stars 5 forks source link

Avoid deep copies in calcStepGrad and calcStepRest #92

Open araujolma opened 5 years ago

araujolma commented 5 years ago

I just noticed that both calcStepGrad and calcStepRest make deep (recursive) copies of the running solution every single time they try a new step. This includes copying also all the histories of previous gradient steps, P, P-int, P-psi, I, I-pf, J, etc...

Doing this wastes both time and memory! Let's work out a way to avoid making such huge copies every time!