os<<"NLOPT_STOPVAL_REACHED: Optimization stopped because stopval (above) was reached."<<endl;
break;
case3:
os<<"NLOPT_FTOL_REACHED: Optimization stopped because ftol_rel or ftol_abs (above) was reached."<<endl;
break;
case4:
os<<"NLOPT_XTOL_REACHED: Optimization stopped because xtol_rel or xtol_abs (above) was reached."<<endl;
break;
case5:
os<<"NLOPT_MAXEVAL_REACHED: Optimization stopped because maxeval (above) was reached."<<endl;
break;
case6:
os<<"NLOPT_MAXTIME_REACHED: Optimization stopped because maxtime (above) was reached."<<endl;
break;
case-1:
os<<"NLOPT_FAILURE: Generic failure code."<<endl;
break;
case-2:
os<<"NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etc.)"<<endl;
break;
case-3:
os<<"NLOPT_OUT_OF_MEMORY: Ran out of memory."<<endl;
break;
case-4:
os<<"NLOPT_ROUNDOFF_LIMITED: Halted because roundoff errors limited progress. (In this case, the optimization still typically returns a useful result."<<endl;
break;
case-5:
os<<"NLOPT_FORCED_STOP: Halted because of a forced termination: the user called nlopt_force_stop(opt) on the optimization’s nlopt_opt object opt from the user’s objective function or constraints."<<endl;