I'm coming back to using octave after spending a few years working primarily in IDL. IDL has a very nice "temporary" function for "disowning" a variable so that it won't be copied when written.
"The TEMPORARY function returns a temporary copy of a variable, and sets
the original variable to "undefined". This function can be used to
conserve memory when performing operations on large arrays, as it
avoids making a new copy of results that are only temporary. In
general, the TEMPORARY routine can be used to advantage whenever a
variable containing an array on the left hand side of an assignment
statement is also referenced on the right hand side."
This means that in IDL rewriting "a = 5*a + 1" as "a = 5*temporary(a)+1" avoids duplicating the contents of a.
Does octave already have similar functionality? If not will this approach be compatible with octave's interpreter? Any pointers on where I should start for adding this?