Skip to content

Reevaluate greedy.cpp and exact.cpp. #2

@JonasMoss

Description

@JonasMoss

I. The two C++ files are quite messy. Here are three worries:

  • Does modulate work as intended in greedy.cpp?
  • Does init work as intended in greedy.cpp?
  • Is the part not covered by codecov in exact.cpp and greedy.cpp ever visited?

II. In order to clean up the mess we should:

  • Make a better interface to greedy.cpp and exact.cpp.
  • Document greedy.cpp and exact.cpp using 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 x won't work, as this eps problem only occurs (in exact at least) when it isn't possible to make breaks bins with the data points as endpoints with minimal distance eps between points.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions