You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the update! method for DefaultState, we are currently using state.prev = copy(v) (see here. For arrays this can be expensive. It would be better to use copy!(istate.prev, v)
Also, only giving the user the current state in the function that is the first argument to managed_iteration forces him to make a copy of it before using. If I write these algorithms out by hand I write v = init; v_new = similar(v) once outside the loop, then I update v_new during stage 2 (iteration phase) and call copy!(v, v_new) at the end of stage 3 (between iteration processing). This means during the loop I don't allocate anything for v and v_new. We should think carefully about a way to enable the user to do this here also.
The text was updated successfully, but these errors were encountered:
In the
update!
method for DefaultState, we are currently usingstate.prev = copy(v)
(see here. For arrays this can be expensive. It would be better to usecopy!(istate.prev, v)
Also, only giving the user the current state in the function that is the first argument to
managed_iteration
forces him to make a copy of it before using. If I write these algorithms out by hand I writev = init; v_new = similar(v)
once outside the loop, then I updatev_new
during stage 2 (iteration phase) and callcopy!(v, v_new)
at the end of stage 3 (between iteration processing). This means during the loop I don't allocate anything forv
andv_new
. We should think carefully about a way to enable the user to do this here also.The text was updated successfully, but these errors were encountered: