Programming challenges in converting R to C++
summary
Converts a clinical-trial R codebase (the smart package, MySQL-backed datasets, p‑value matrices) into C++ and reports concrete tradeoffs: replacing dense matrices with sparse vectors cuts memory and drops a 30‑minute job to seconds, while naive copies blow up memory; rewrites of numerically unstable formulas (use integration by parts, log‑gamma) fix wrong p‑values; one‑pass variance is unstable so Welford/accumulators are used; uses Boost, LAPACK and Boost.Accumulators, Pimpl + shared_ptr, and extensive unit and randomized testing — resulting production code is much faster and usable.
AI-written summary · about
chapters (11)
- 0:00Start
- 0:40Introduction
- 1:03What Is a Clinical Trial
- 12:47Scientific Programming Challenges
- 14:58Testing
- 19:39Software Architecture in Data Structure
- 24:51Sample Variance
- 29:15The Factory Pattern
- 37:39Mobile Numerical Instabilities
- 45:36Beta Binomial Distribution
- 47:18Do the Calculation in the Log Scale
related talks
07mStatistical scientific programming OO patterns: accumulators
25mApplication of C++ in Computational Cancer Modeling
54mRapid Prototyping in C++
01h 05mThe Most Important Optimizations to Apply in Your C++ Programs
50mThinking Functionally in C++
01h 30mC++ in Constrained Environments
01h 06mMigration of C++ Libraries to C++14
01h 00mHow to call C libraries from C++
