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

Clean up logging code #4

Open
thetazero opened this issue Feb 6, 2023 · 0 comments
Open

Clean up logging code #4

thetazero opened this issue Feb 6, 2023 · 0 comments

Comments

@thetazero
Copy link
Member

thetazero commented Feb 6, 2023

I made a pull that makes the logging code more flexible
Currently it is implemented via:
Something that defines the initial state of the log

function default_log_init(state)
    return [[state.ω; norm(state.ω)]]
end
function default_log_step(hist, state)
    point = [state.ω; norm(state.ω)]
    push!(hist, point)
end

In the end it needs some processing to turn the "array of pointers to arrays" into a matrix at the end before returning the history

  hist = reduce(hcat, hist)
    hist = hist'
    return (hist, time_hist)

The relevant code is here

This is pretty slow causing a significant performance hit, for an operation that should really be virtually free.

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