C++ version of Matlab file for running ABC