As the timings against the 'reference implementation' indicate (see https://github.com/shabbychef/fromo/blob/experimental/nodist/ref_timings.md), the implementation with lots of C++ template garbage leaves a lot to be desired with respect to speed. That said, I will move to correct this problem and also try to simplify the code, via old school macroization instead of C++ templating.
For now, calling this fixed. The trick of including moment_interp.h as needed has apparently solved this issue. The running sd computation is almost as fast as the reference implementation.
As the timings against the 'reference implementation' indicate (see https://github.com/shabbychef/fromo/blob/experimental/nodist/ref_timings.md), the implementation with lots of C++ template garbage leaves a lot to be desired with respect to speed. That said, I will move to correct this problem and also try to simplify the code, via old school macroization instead of C++ templating.