ForwardDiff & mul!()

ForwardDiff works by operating on dual numbers:

http://www.juliadiff.org/ForwardDiff.jl/latest/dev/how_it_works.html

As I said, you should either consider using non-modifying versions of these functions, or (if you are feeling adventurous) pre-allocate buffers of the correct type. It is better to do this for an inner loop only, where the outer part will know the type (Dual has a type tag).

To help with the latter, it would be great to have a full MWE.

1 Like