-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I. The two C++ files are quite messy. Here are three worries:
- Does
modulatework as intended ingreedy.cpp? - Does
initwork as intended ingreedy.cpp? - Is the part not covered by codecov in
exact.cppandgreedy.cppever visited?
II. In order to clean up the mess we should:
- Make a better interface to
greedy.cppandexact.cpp. - Document
greedy.cppandexact.cppusing Doxygen. - Remove dependency on Rcpp inside the main functions. Make a separate C++ library of them.
- Make functions connecting the library functions to R using Rcpp.
III. Both greedy.cpp and exact.cpp are general functions that can and should work more kinds of input functions than now. Now they use function pointers in a messy way. I have ambitions for at least two more kinds of input functions, namely corresponding to the AIC and discrepancy with respect to parametric starts.
- Invent a smart object structure.
- Implement the structure on
greedy.cpp. - Implement the structure on
exact.cpp.
IIII. Interrupting does not work, but this is essential for functions taking this long to run. This might be hard to make work together with point II above.
- Insert interrupt checks in
exact.cpp - Insert interrupt checks in
greedy.cpp
V. Think about how to handle the eps argument. One hand, something like eps is necessary for the histograms to look well. On the other hand, it sometimes happens that neither algorithm finds a solution with a given eps. In this case, they can return non-sensical answers.
- Think about how to handle
eps; read about the DP algorithm again. - Implement a solution. There might be a solution involving a tweak to the algorithms (only looking at the members of
xwon't work, as thisepsproblem only occurs (inexactat least) when it isn't possible to makebreaksbins with the data points as endpoints with minimal distanceepsbetween points.