Closed DavidSagan closed 9 months ago
You will need https://github.com/SciML/PreallocationTools.jl
@avik-pal Looking at the documentation for PreallocationTools it is not clear to me how to use this. Can you show me how to use this for implementing fff
in the above example? That is, how to write xx[1] = var[1] - v_true[1]
in a form that will not cause an error.
xx = eltype(var)[1.0, 2.0, 3.0, 4.0]
@ChrisRackauckas Yes this works. Much Thanks!
[Side note: You might want to consider a documentation problem category for issues.]
The following code fails:
The error generated is:
The error is generated in the line
xx[1] = var[1] - v_true[1]
in the functionfff
. I believe I understand this to be due to a call tofff
inside solve with the argumentvar
not being a vector but instead a construct using ForwardDiff. This is not covered in the documentation and I'm not sure how to get around this. [It is true that this line is completely irrelevant to the test case but in my real code I need to understand exactly what is happening.]