Improved code in matlab/dai.cpp that tests whether findMaximum is supported