Main C++/MATLAB FOCUS code.