Skip to content

Handle IterationState{Array} different from generic T #1

@sglyon

Description

@sglyon

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions