Open Nicholaswogan opened 2 years ago
A more flexible way to put the dependent function in a module and use whatever the module provides inside the function. This way doesn't require user to unpack data
.
But the module approach will make the data global. This makes the code thread-unsafe, if there are work arrays being written to in the data. It also prevents any object/class/type which uses fazang to have multiple different instantiations.
I should've pointed out that fazang
itself is not thread safe. Currently one cannot safely call gradient
in separate threads. It's planned but not there yet.
Would be nice if the gradient and jacobian functions accepted an optional data parameter. The interface would look something like this: