Skip to content

Conversation

@ChrisRackauckas
Copy link
Member

No description provided.

function DiffEqBase.ODEFunction(sys::ODESystem, dvs, ps; version::FunctionVersion = ArrayFunction)
expr = generate_function(sys, dvs, ps; version = version)
expr = eval(generate_function(sys, dvs, ps; version = version))
jac_expr = isempty(sys.jac[]) ? nothing : eval(generate_jacobian(sys))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that unless the Jacobian has already been computed, it won't be included. Is that the desired behavior?

(Note that jac_expr = eval(generate_jacobian(sys)) would use the cached version if one exists, computing it otherwise.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this gives an opt-in mechanism: call calculate_jacobian if you want it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like a rather strange/unintuitive way of opting in (which also makes the fact that we currently cache Jacobians user-facing)... couldn't we just have a kwarg for jac::Bool = false?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can do it with a bool as well.

@ChrisRackauckas ChrisRackauckas merged commit 2cd451f into master Jul 7, 2019
@ChrisRackauckas ChrisRackauckas deleted the jac branch July 7, 2019 23:00
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

Successfully merging this pull request may close these issues.

3 participants