Changelog
Source:NEWS.md
rwig 0.2.0
- Dropped the dependencies on Rcpp and RcppArmadillo. The C++ code talks to R through the native C API (
.Callwith registered routines) and calls the BLAS/LAPACK libraries shipped with R directly through a small internal matrix layer, which also makes the installed package much smaller. The package now has no compiled-code dependencies at all. - Interrupting a long computation (Ctrl-C) now releases worker threads and buffers before returning to R, and surfaces as an R error.
- Faster log-stabilized
sinkhorn()andbarycenter(): the soft-min kernels no longer materialize the M x N matrixC - f 1' - 1 g'on every iteration, and worker threads (n_threads) are created once per call instead of once per iteration. - Faster
wdl()on CPU: the softmax Jacobian is applied in O(N) instead of O(N^2) per column, an unused matrix product per backward step was removed, and the per-batch history buffers use about half the memory. -
wdl()now draws its random initialization from R’s RNG (rnorm()), soset.seed()reproduces the documented R sequence. Fits with the same seed therefore differ from version 0.1.0, which used Armadillo’s own generator. - Fixed:
wdl()returnedweights,docs_predanddocs_distin the shuffled training order (the defaultshuffle = TRUE) next todocsin the input order, sowig()summed document scores into the wrong periods. Per-document outputs are now put back into the input order. - Fixed:
wig()failed whenwig_controlwas given withoutgroup_unit. -
wdl_specs()/wig_specs()now honor the values passed inbarycenter_control(method,max_iter, …) instead of silently overriding them; thewdl_controlseed entry is namedseed(it was documented asrng_seedbut read asseed).verbosedefaults to 0 when omitted from a partialsinkhorn_control/barycenter_control. - Dropped the dependency on RhpcBLASctl:
rwigno longer sets the BLAS thread count to 1 for the whole session when attached. The startup message now explains the recommendation and, if RhpcBLASctl is installed (it is now only suggested), reports the current thread count and the call to change it. - Dropped the dependency on lubridate:
group_unitis now passed tocut()(?cut.Date), so it accepts “day”, “week”, “month”, “quarter”, “year” and multiples such as “2 months”. Weeks start on Monday. - Fixed: threaded (
n_threads > 0) log barycenter crashed when the cost matrix had more columns than rows. - Fixed: the CUDA build passes an explicit GPU architecture to
nvcc(recent CUDA toolkits default tosm_52, which lacks double-precisionatomicAdd). SetRWIG_CUDA_ARCHto override the detected flag, orRWIG_NO_CUDA=1to build without GPU support even when CUDA is installed.
rwig 0.1.0
CRAN release: 2026-04-21
- Initial CRAN submission.
- Efficient implementation of several Optimal Transport algorithms in
Fangzhou Xie (2025) doi:10.48550/arXiv.2504.08722 and the Wasserstein Index Generation (WIG) model in Fangzhou Xie (2020) doi:10.1016/j.econlet.2019.108874.