Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

type Fixed has no field value #36

Closed
SteffenPL opened this issue Jun 14, 2020 · 3 comments · Fixed by #38
Closed

type Fixed has no field value #36

SteffenPL opened this issue Jun 14, 2020 · 3 comments · Fixed by #38

Comments

@SteffenPL
Copy link

There seems to be a small typo in jacobian.jl and hessian.jl

map(arg -> arg isa Fixed ?
arg.value : tag(arg, ctx, one(TermCombination)), args)...)

since Fixed has only a field val. Either the type Fixed or these lines have to be changed.

@ChrisRackauckas
Copy link
Member

@shashi does that thumbs up mean that the fix is easy?

@SteffenPL
Copy link
Author

In my case, just renaming makes it work.
I was a bit confused about how to implement the tests. That's why I didn't send a pull request yet.

SteffenPL@1c24bbe

@shashi
Copy link
Collaborator

shashi commented Jun 21, 2020

Yeah I think @SteffenPL's diagnosis is correct.

Test could be just be jacobian_sparisty(f, y,x, Fixed(z)) and f(x,y,z) = z > 0 ? y .= x : y .= reverse(x)

The sparsity depends on the value of z here and it's always a diagonal (either a identity or a reversed diagonal)

If Fixed did not work, then the sparsity would come from both branches making it more like an "X" (crossed diagonals)

shashi added a commit that referenced this issue Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants