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

oop jacobian can't preserve array-like objects #71

Open
huanglangwen opened this issue Oct 27, 2019 · 5 comments
Open

oop jacobian can't preserve array-like objects #71

huanglangwen opened this issue Oct 27, 2019 · 5 comments

Comments

@huanglangwen
Copy link
Contributor

forwarddiff_color_jacobian automatically converts array-like input object into array. When f depend on specific property of the input object, the jacobian will fail. MWE:

using OrdinaryDiffEq, SparseDiffTools
mutable struct SimTypeg{T,T2} <: DEDataMatrix{T}
  x::Array{T,2} # two dimensional
  f1::T2
end
function f(u)
  u.f1*u[1]
end
u0 = SimTypeg(fill(0.00001,2,2),0.0)
forwarddiff_color_jacobian(f,u0)
@ChrisRackauckas
Copy link
Member

Does it also convert SArrays?

@huanglangwen
Copy link
Contributor Author

@ChrisRackauckas
Copy link
Member

Does this at least not break anything that currently exists?

@huanglangwen
Copy link
Contributor Author

Does this at least not break anything that currently exists?

It break at least one test in OrdinaryDiffEq.jl: https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/blob/master/test/interface/data_array_test.jl

@ChrisRackauckas
Copy link
Member

Looks like there's a few other things to work out with resizing.

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

2 participants