Skip to content

Correction for nonsquare jacobian #66

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

Merged
merged 2 commits into from
Oct 6, 2019
Merged

Correction for nonsquare jacobian #66

merged 2 commits into from
Oct 6, 2019

Conversation

huanglangwen
Copy link
Contributor

No description provided.

@@ -80,8 +88,8 @@ function forwarddiff_color_jacobian(f,x::AbstractArray{<:Number},jac_cache::Forw

vecx = vec(x)

ncols=length(x)
J = jac_prototype isa Nothing ? false .* x .* x' : zero(jac_prototype)
J = jac_prototype isa Nothing ? (sparsity isa Nothing ? false .* dx .* x' : zeros(eltype(x),size(sparsity))) : zero(jac_prototype)
Copy link
Member

Choose a reason for hiding this comment

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

zeros gives an Array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think when jac_prototype is not specified, J should be an Array.

Copy link
Member

Choose a reason for hiding this comment

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

true, makes sense.

@ChrisRackauckas ChrisRackauckas merged commit e2b11d3 into JuliaDiff:master Oct 6, 2019
@huanglangwen huanglangwen deleted the nsq branch October 7, 2019 10:40
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.

2 participants