-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels