The Matlab functions WdpwBX, ksurfX, ksphereX and ecmhX use the two C++ functions rLoopEval and sploop2mat and loop2SMatC

The  mex source files "rLoopEval.cpp", "loop2SMatC.cpp" and "sploop2mat.cpp" (in the folder cpp_files)
need to be compiled as mex functions before matlab can use them.

(These have been compiled as .mex64 files already, but will only work if a compatible
C++ compiler is installed.)


Here is one way to compile the C++ files (on Windows):
 
If you already have a c++ compiler you can skip the first two steps.

1.  Install C++ compiler, e.g.  TDM64 MinGW-w64 at http://tdm-gcc.tdragon.net/download
    (use recommended package, install, e.g. in C:\TDM-GCC-64)

2.  To allow Matlab mex files to be installed with minGW, Install gnumex for
 GNU compilers at http://gnumex.sourceforge.net/
    (instructions are here:  http://gnumex.sourceforge.net/documentation.html)
   Briefly:  
      a) unzip the file, 
      b) put the folder into Matlab working directory, 
      c) open the function gnummex.m and run it, 
      d) in the window that opens up, supply the path for MinGw  (e.g. C:\TDM-GCC-64) from step 1, 
       then  click "Make options file", and you should be able to compile.

3.  In Matlab, enter:  mex -setup 
    If you have done steps 1-2 it should show tdm-gcc as an option, so choose that.

4.  Compile the mex files  "rLoopEval.cpp" and "sploop2mat.cpp" with:
    mex -largeArrayDims <mexSourceFile.cpp>

5. Place the new .mex files in the working directory and you are set.