TimSiebert1 / ADOLC.jl

MIT License
11 stars 2 forks source link

slight improvment of guides.md #13

Closed j-fu closed 2 months ago

j-fu commented 2 months ago

... sorry, habe master nicht gemerged, mache noch ein update...

j-fu commented 2 months ago

I think the implementation of finalizers is the way to go. Unfortunately I don't know in the moment how the interaction with cxxwrap should look like. AMGCLWrap.jl wraps around C code and uses finalizers.

TimSiebert1 commented 2 months ago

The idea for the finalizers can be found here. Basically, the CxxPtr is wrapped in a mutable struct, which gets a finalizer. The current idea would be to extend this for a combined struct of a Julia matrix and a C++ matrix since both are necessary: The C++ matrix is used to store and compute the result of the derivative from ADOL-C, and you do not want to re-allocated and destroy them every time; the Julia matrix is then used to do the computations with the result. An update of the C++ matrix would trigger an update of the Julia matrix. Something like that...