Most of the supplementary code is found in the following subdirectories:

LookupTableCode contains the C++ program that produces lookup tables to map 
tristimulus color spaces to moments. To build it, just feed all *.cpp files to 
the compiler of your choice. There are no dependencies other than the standard 
library. To configure it, you should edit variables main() in main.cpp. Run it 
with makeFourierToXYZGrid = true first to generate a lookup table from Fourier 
coefficients to XYZ triples. Then run it with makeFourierToXYZGrid = false and 
other parameters as desired to generate a lookup table from a tristimulus 
color space to Fourier coefficients.

BoundedMESECode contains code in various languages that implements the variants 
of the bounded MESE. The .real.h and .real.hpp variants use C or C++ with a 
custom type for complex numbers since our compiler had an inefficient 
implementation for float complex and std::complex<float>. This code has been 
generated automatically for each variant to avoid instruction flow that could 
prohibit compiler optimizations. Independent of the used method, you always 
invoke one prepare*() method with wavelength-independent parameters and pass 
its output to an evaluate*() method to obtain the reflectance at one 
wavelength. There are different variants for complex and real trigonometric 
moments, different moment counts and with or without Lagrange multipliers.

Additionally, there are two Python scripts:

ReferenceImplementation.py implements computation of moments and all variants 
of the MESE and bounded MESE. It is not particularly efficient but written to 
closely resemble the algorithms as stated in the paper.

XYZImportanceWarp.py implements the computation of a warp that brings the 
Fourier basis closer to response curves of a tristimulus color space, e.g. XYZ. 
