Replies: 2 comments 2 replies
-
in c++ it is much more elegant to use fonctors, eg: |
Beta Was this translation helpful? Give feedback.
2 replies
-
A reverse communication interface would also greatly simplify the integration into CP2K. Any chances this could be add to libprima? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am wondering if you are interested in a reverse communication interface style version just like ARPACK.
The motivation is that, the current interface accepts a callback function to be passed. For small/simple problems in C and Fortran, it is generally not a problem to define such a function. While for large complex problems written in CPP with the OO style, wrapping things into such a function may not be straightforward and potentially could be cumbersome. All the dependent data have to be somewhat arranged in a single container so that the pointer can then be passed as the third argument
*data
.An RCI style API could be beneficial for downstream projects to flexibly design the algorithm.
However, I do see the challenges. For an RCI, the solver needs to be terminated wherever the functional evaluation is needed. Before returning, temporary data needs to be stored in user provided working buffer. When resuming, the solver needs to recover temporary data from buffer and reads the new function value from designated location. This may be quite different from the current implementation that calls the callback.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions