mex-ized solver