dajmcdon / rtestim

https://dajmcdon.github.io/rtestim/
Other
4 stars 0 forks source link

fix 'arma' error and more #1

Closed jiapivialiu closed 1 year ago

jiapivialiu commented 1 year ago

This pull request contains a few updates.

For the previous errors:

  1. The error of sourcing c++ functions using arma namespace in R is fixed (by revising .h files).
  2. The error of missing header file "<boost/math/special_functions/lambert_w.hpp>" is fixed (by adding Rcpp, RcppArmadillo, BH under LinkingTo in DESCRIPTION).

For more updates:

  1. The c++ function of admm algorithm is modified. Specifically, vectors are all defined before the for loop to save memory.
  2. In methods.R, simple plot and summary functions are provided to visualize the algorithm results.
  3. Current c++ files follow the Chromium coding style with the header sorting turned off. The reason of not sorting the header files following Chromium is the following. Take a file named as abc.cpp as an example. Chromium puts the header file abc.h on the top of abc.cpp, but we need abc.h to stay after all other header files of abc.cpp.
  4. A function to compute mu is both exported and added to the admm_solver function.
  5. imports.R is renamed as global.R. Besides the name change, the updated file contains not only packages (functions) import, but all package level documentation.

Please review the changes. Thank you!

jiapivialiu commented 1 year ago
  • ad Johnson's dynamic programming paper yet, but seems like he torn the function into many pieces which might be easier to debug?
  • Other than that it looks go

We should be fine with this dp algorithm here, since we are using the code here. But instead of c code, we write it in c++. So we don't need to worry about debugging this code.