Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle IterationState{Array} different from generic T #1

Open
sglyon opened this issue Apr 24, 2015 · 0 comments
Open

Handle IterationState{Array} different from generic T #1

sglyon opened this issue Apr 24, 2015 · 0 comments

Comments

@sglyon
Copy link
Owner

sglyon commented Apr 24, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant