JuliaDiff / JuliaDiff/ForwardDiff.jl

jacobian with StaticArray always uses autogenerated Tag

Open
#594 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
1k
Forks
160
PR merge metrics
No merged PRs in 30d

Description

It doesn't seem to be possible to explicitly set the Tag when using StaticArrays to calculate an out-of-place Jacobian. This is needed when f uses preallocated internal buffer arrays, which must match the Dual number type. For other array types, this can be set by supplying a cfg::JacobianConfig, however this argument is ignored when using StaticArrays.

Looks like the problem is in jacobian.jl L85-87 which then calls L183-186 so any cfg argument to jacobian is ignored, and the Tag is always autogenerated.

Related:
Discussion in issue 296, https://github.com/JuliaDiff/ForwardDiff.jl/issues/296#issuecomment-365045955
PR https://github.com/JuliaDiff/ForwardDiff.jl/pull/304

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/jacobian.jl at lines 85-87 and 183-186, where the issue reports that the supplied JacobianConfig is ignored for StaticArrays. Read issue 296 and PR 304 for prior context, then verify that an explicitly supplied Tag is honored for out-of-place StaticArray Jacobians, including the preallocated-buffer use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.