From 64cf25c15a528166f1437283f8793b75a6bceb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Li?= Date: Mon, 8 Jul 2024 22:09:09 +0200 Subject: [PATCH] [LL] SetSolverSpecificParametersAsString remade --- ortools/linear_solver/knitro_interface.cc | 964 +++++++--------------- 1 file changed, 284 insertions(+), 680 deletions(-) diff --git a/ortools/linear_solver/knitro_interface.cc b/ortools/linear_solver/knitro_interface.cc index 516532cb3c6..45166bdb760 100644 --- a/ortools/linear_solver/knitro_interface.cc +++ b/ortools/linear_solver/knitro_interface.cc @@ -40,641 +40,235 @@ inline double redefine_infinity_double(double value) { return value; } -// static std::map& getMapParam() { -// static std::map mapControls = { -// {"KN_PARAM_NEWPOINT", KN_PARAM_NEWPOINT}, -// {"KN_NEWPOINT_NONE", KN_NEWPOINT_NONE}, -// {"KN_NEWPOINT_SAVEONE", KN_NEWPOINT_SAVEONE}, -// {"KN_NEWPOINT_SAVEALL", KN_NEWPOINT_SAVEALL}, -// {"KN_PARAM_HONORBNDS", KN_PARAM_HONORBNDS}, -// {"KN_HONORBNDS_AUTO", KN_HONORBNDS_AUTO}, -// {"KN_HONORBNDS_NO", KN_HONORBNDS_NO}, -// {"KN_HONORBNDS_ALWAYS", KN_HONORBNDS_ALWAYS}, -// {"KN_HONORBNDS_INITPT", KN_HONORBNDS_INITPT}, -// {"KN_PARAM_ALGORITHM", KN_PARAM_ALGORITHM}, -// {"KN_PARAM_ALG", KN_PARAM_ALG}, -// {"KN_ALG_AUTOMATIC", KN_ALG_AUTOMATIC}, -// {"KN_ALG_AUTO", KN_ALG_AUTO}, -// {"KN_ALG_BAR_DIRECT", KN_ALG_BAR_DIRECT}, -// {"KN_ALG_BAR_CG", KN_ALG_BAR_CG}, -// {"KN_ALG_ACT_CG", KN_ALG_ACT_CG}, -// {"KN_ALG_ACT_SQP", KN_ALG_ACT_SQP}, -// {"KN_ALG_MULTI", KN_ALG_MULTI}, -// {"KN_PARAM_BAR_MURULE", KN_PARAM_BAR_MURULE}, -// {"KN_BAR_MURULE_AUTOMATIC", KN_BAR_MURULE_AUTOMATIC}, -// {"KN_BAR_MURULE_AUTO", KN_BAR_MURULE_AUTO}, -// {"KN_BAR_MURULE_MONOTONE", KN_BAR_MURULE_MONOTONE}, -// {"KN_BAR_MURULE_ADAPTIVE", KN_BAR_MURULE_ADAPTIVE}, -// {"KN_BAR_MURULE_PROBING", KN_BAR_MURULE_PROBING}, -// {"KN_BAR_MURULE_DAMPMPC", KN_BAR_MURULE_DAMPMPC}, -// {"KN_BAR_MURULE_FULLMPC", KN_BAR_MURULE_FULLMPC}, -// {"KN_BAR_MURULE_QUALITY", KN_BAR_MURULE_QUALITY}, -// {"KN_PARAM_BAR_FEASIBLE", KN_PARAM_BAR_FEASIBLE}, -// {"KN_BAR_FEASIBLE_NO", KN_BAR_FEASIBLE_NO}, -// {"KN_BAR_FEASIBLE_STAY", KN_BAR_FEASIBLE_STAY}, -// {"KN_BAR_FEASIBLE_GET", KN_BAR_FEASIBLE_GET}, -// {"KN_BAR_FEASIBLE_GET_STAY", KN_BAR_FEASIBLE_GET_STAY}, -// {"KN_PARAM_GRADOPT", KN_PARAM_GRADOPT}, -// {"KN_GRADOPT_EXACT", KN_GRADOPT_EXACT}, -// {"KN_GRADOPT_FORWARD", KN_GRADOPT_FORWARD}, -// {"KN_GRADOPT_CENTRAL", KN_GRADOPT_CENTRAL}, -// {"KN_GRADOPT_USER_FORWARD", KN_GRADOPT_USER_FORWARD}, -// {"KN_GRADOPT_USER_CENTRAL", KN_GRADOPT_USER_CENTRAL}, -// {"KN_PARAM_HESSOPT", KN_PARAM_HESSOPT}, -// {"KN_HESSOPT_AUTO", KN_HESSOPT_AUTO}, -// {"KN_HESSOPT_EXACT", KN_HESSOPT_EXACT}, -// {"KN_HESSOPT_BFGS", KN_HESSOPT_BFGS}, -// {"KN_HESSOPT_SR1", KN_HESSOPT_SR1}, -// {"KN_HESSOPT_PRODUCT_FINDIFF", KN_HESSOPT_PRODUCT_FINDIFF}, -// {"KN_HESSOPT_PRODUCT", KN_HESSOPT_PRODUCT}, -// {"KN_HESSOPT_LBFGS", KN_HESSOPT_LBFGS}, -// {"KN_HESSOPT_GAUSS_NEWTON", KN_HESSOPT_GAUSS_NEWTON}, -// {"KN_PARAM_BAR_INITPT", KN_PARAM_BAR_INITPT}, -// {"KN_BAR_INITPT_AUTO", KN_BAR_INITPT_AUTO}, -// {"KN_BAR_INITPT_CONVEX", KN_BAR_INITPT_CONVEX}, -// {"KN_BAR_INITPT_NEARBND", KN_BAR_INITPT_NEARBND}, -// {"KN_BAR_INITPT_CENTRAL", KN_BAR_INITPT_CENTRAL}, -// {"KN_PARAM_ACT_LPSOLVER", KN_PARAM_ACT_LPSOLVER}, -// {"KN_ACT_LPSOLVER_INTERNAL", KN_ACT_LPSOLVER_INTERNAL}, -// {"KN_ACT_LPSOLVER_CPLEX", KN_ACT_LPSOLVER_CPLEX}, -// {"KN_ACT_LPSOLVER_XPRESS", KN_ACT_LPSOLVER_XPRESS}, -// {"KN_PARAM_CG_MAXIT", KN_PARAM_CG_MAXIT}, -// {"KN_PARAM_MAXIT", KN_PARAM_MAXIT}, -// {"KN_PARAM_OUTLEV", KN_PARAM_OUTLEV}, -// {"KN_OUTLEV_NONE", KN_OUTLEV_NONE}, -// {"KN_OUTLEV_SUMMARY", KN_OUTLEV_SUMMARY}, -// {"KN_OUTLEV_ITER_10", KN_OUTLEV_ITER_10}, -// {"KN_OUTLEV_ITER", KN_OUTLEV_ITER}, -// {"KN_OUTLEV_ITER_VERBOSE", KN_OUTLEV_ITER_VERBOSE}, -// {"KN_OUTLEV_ITER_X", KN_OUTLEV_ITER_X}, -// {"KN_OUTLEV_ALL", KN_OUTLEV_ALL}, -// {"KN_PARAM_OUTMODE", KN_PARAM_OUTMODE}, -// {"KN_OUTMODE_SCREEN", KN_OUTMODE_SCREEN}, -// {"KN_OUTMODE_FILE", KN_OUTMODE_FILE}, -// {"KN_OUTMODE_BOTH", KN_OUTMODE_BOTH}, -// {"KN_PARAM_SCALE", KN_PARAM_SCALE}, -// {"KN_SCALE_NEVER", KN_SCALE_NEVER}, -// {"KN_SCALE_NO", KN_SCALE_NO}, -// {"KN_SCALE_USER_INTERNAL", KN_SCALE_USER_INTERNAL}, -// {"KN_SCALE_USER_NONE", KN_SCALE_USER_NONE}, -// {"KN_SCALE_INTERNAL", KN_SCALE_INTERNAL}, -// {"KN_PARAM_SOC", KN_PARAM_SOC}, -// {"KN_SOC_NO", KN_SOC_NO}, -// {"KN_SOC_MAYBE", KN_SOC_MAYBE}, -// {"KN_SOC_YES", KN_SOC_YES}, -// {"KN_PARAM_DELTA", KN_PARAM_DELTA}, -// {"KN_PARAM_BAR_FEASMODETOL", KN_PARAM_BAR_FEASMODETOL}, -// {"KN_PARAM_FEASTOL", KN_PARAM_FEASTOL}, -// {"KN_PARAM_FEASTOLABS", KN_PARAM_FEASTOLABS}, -// {"KN_PARAM_MAXTIMECPU", KN_PARAM_MAXTIMECPU}, -// {"KN_PARAM_BAR_INITMU", KN_PARAM_BAR_INITMU}, -// {"KN_PARAM_OBJRANGE", KN_PARAM_OBJRANGE}, -// {"KN_PARAM_OPTTOL", KN_PARAM_OPTTOL}, -// {"KN_PARAM_OPTTOLABS", KN_PARAM_OPTTOLABS}, -// {"KN_PARAM_LINSOLVER_PIVOTTOL", KN_PARAM_LINSOLVER_PIVOTTOL}, -// {"KN_PARAM_XTOL", KN_PARAM_XTOL}, -// {"KN_PARAM_DEBUG", KN_PARAM_DEBUG}, -// {"KN_DEBUG_NONE", KN_DEBUG_NONE}, -// {"KN_DEBUG_PROBLEM", KN_DEBUG_PROBLEM}, -// {"KN_DEBUG_EXECUTION", KN_DEBUG_EXECUTION}, -// {"KN_PARAM_MULTISTART", KN_PARAM_MULTISTART}, -// {"KN_PARAM_MSENABLE", KN_PARAM_MSENABLE}, -// {"KN_PARAM_MS_ENABLE", KN_PARAM_MS_ENABLE}, -// {"KN_MULTISTART_NO", KN_MULTISTART_NO}, -// {"KN_MS_ENABLE_NO", KN_MS_ENABLE_NO}, -// {"KN_MULTISTART_YES", KN_MULTISTART_YES}, -// {"KN_MS_ENABLE_YES", KN_MS_ENABLE_YES}, -// {"KN_PARAM_MSMAXSOLVES", KN_PARAM_MSMAXSOLVES}, -// {"KN_PARAM_MS_MAXSOLVES", KN_PARAM_MS_MAXSOLVES}, -// {"KN_PARAM_MSMAXBNDRANGE", KN_PARAM_MSMAXBNDRANGE}, -// {"KN_PARAM_MS_MAXBNDRANGE", KN_PARAM_MS_MAXBNDRANGE}, -// {"KN_PARAM_MSMAXTIMECPU", KN_PARAM_MSMAXTIMECPU}, -// {"KN_PARAM_MS_MAXTIMECPU", KN_PARAM_MS_MAXTIMECPU}, -// {"KN_PARAM_MSMAXTIMEREAL", KN_PARAM_MSMAXTIMEREAL}, -// {"KN_PARAM_MS_MAXTIMEREAL", KN_PARAM_MS_MAXTIMEREAL}, -// {"KN_PARAM_LMSIZE", KN_PARAM_LMSIZE}, -// {"KN_PARAM_BAR_MAXCROSSIT", KN_PARAM_BAR_MAXCROSSIT}, -// {"KN_PARAM_MAXTIMEREAL", KN_PARAM_MAXTIMEREAL}, -// {"KN_PARAM_CG_PRECOND", KN_PARAM_CG_PRECOND}, -// {"KN_CG_PRECOND_NONE", KN_CG_PRECOND_NONE}, -// {"KN_CG_PRECOND_CHOL", KN_CG_PRECOND_CHOL}, -// {"KN_PARAM_BLASOPTION", KN_PARAM_BLASOPTION}, -// {"KN_BLASOPTION_AUTO", KN_BLASOPTION_AUTO}, -// {"KN_BLASOPTION_KNITRO", KN_BLASOPTION_KNITRO}, -// {"KN_BLASOPTION_INTEL", KN_BLASOPTION_INTEL}, -// {"KN_BLASOPTION_DYNAMIC", KN_BLASOPTION_DYNAMIC}, -// {"KN_BLASOPTION_BLIS", KN_BLASOPTION_BLIS}, -// {"KN_BLASOPTION_APPLE", KN_BLASOPTION_APPLE}, -// {"KN_PARAM_BAR_MAXREFACTOR", KN_PARAM_BAR_MAXREFACTOR}, -// {"KN_PARAM_LINESEARCH_MAXTRIALS", KN_PARAM_LINESEARCH_MAXTRIALS}, -// {"KN_PARAM_BLASOPTIONLIB", KN_PARAM_BLASOPTIONLIB}, -// {"KN_PARAM_OUTAPPEND", KN_PARAM_OUTAPPEND}, -// {"KN_OUTAPPEND_NO", KN_OUTAPPEND_NO}, -// {"KN_OUTAPPEND_YES", KN_OUTAPPEND_YES}, -// {"KN_PARAM_OUTDIR", KN_PARAM_OUTDIR}, -// {"KN_PARAM_CPLEXLIB", KN_PARAM_CPLEXLIB}, -// {"KN_PARAM_BAR_PENRULE", KN_PARAM_BAR_PENRULE}, -// {"KN_BAR_PENRULE_AUTO", KN_BAR_PENRULE_AUTO}, -// {"KN_BAR_PENRULE_SINGLE", KN_BAR_PENRULE_SINGLE}, -// {"KN_BAR_PENRULE_FLEX", KN_BAR_PENRULE_FLEX}, -// {"KN_PARAM_BAR_PENCONS", KN_PARAM_BAR_PENCONS}, -// {"KN_BAR_PENCONS_AUTO", KN_BAR_PENCONS_AUTO}, -// {"KN_BAR_PENCONS_NONE", KN_BAR_PENCONS_NONE}, -// {"KN_BAR_PENCONS_ALL", KN_BAR_PENCONS_ALL}, -// {"KN_BAR_PENCONS_EQUALITIES", KN_BAR_PENCONS_EQUALITIES}, -// {"KN_BAR_PENCONS_INFEAS", KN_BAR_PENCONS_INFEAS}, -// {"KN_PARAM_MSNUMTOSAVE", KN_PARAM_MSNUMTOSAVE}, -// {"KN_PARAM_MS_NUMTOSAVE", KN_PARAM_MS_NUMTOSAVE}, -// {"KN_PARAM_MSSAVETOL", KN_PARAM_MSSAVETOL}, -// {"KN_PARAM_MS_SAVETOL", KN_PARAM_MS_SAVETOL}, -// {"KN_PARAM_PRESOLVEDEBUG", KN_PARAM_PRESOLVEDEBUG}, -// {"KN_PRESOLVEDBG_NONE", KN_PRESOLVEDBG_NONE}, -// {"KN_PRESOLVEDBG_BASIC", KN_PRESOLVEDBG_BASIC}, -// {"KN_PRESOLVEDBG_VERBOSE", KN_PRESOLVEDBG_VERBOSE}, -// {"KN_PRESOLVEDBG_DETAIL", KN_PRESOLVEDBG_DETAIL}, -// {"KN_PARAM_MSTERMINATE", KN_PARAM_MSTERMINATE}, -// {"KN_PARAM_MS_TERMINATE", KN_PARAM_MS_TERMINATE}, -// {"KN_MSTERMINATE_MAXSOLVES", KN_MSTERMINATE_MAXSOLVES}, -// {"KN_MS_TERMINATE_MAXSOLVES", KN_MS_TERMINATE_MAXSOLVES}, -// {"KN_MSTERMINATE_OPTIMAL", KN_MSTERMINATE_OPTIMAL}, -// {"KN_MS_TERMINATE_OPTIMAL", KN_MS_TERMINATE_OPTIMAL}, -// {"KN_MSTERMINATE_FEASIBLE", KN_MSTERMINATE_FEASIBLE}, -// {"KN_MS_TERMINATE_FEASIBLE", KN_MS_TERMINATE_FEASIBLE}, -// {"KN_MSTERMINATE_ANY", KN_MSTERMINATE_ANY}, -// {"KN_MS_TERMINATE_ANY", KN_MS_TERMINATE_ANY}, -// {"KN_MSTERMINATE_RULEBASED", KN_MSTERMINATE_RULEBASED}, -// {"KN_MS_TERMINATE_RULEBASED", KN_MS_TERMINATE_RULEBASED}, -// {"KN_PARAM_MSSTARTPTRANGE", KN_PARAM_MSSTARTPTRANGE}, -// {"KN_PARAM_MS_STARTPTRANGE", KN_PARAM_MS_STARTPTRANGE}, -// {"KN_PARAM_INFEASTOL", KN_PARAM_INFEASTOL}, -// {"KN_PARAM_LINSOLVER", KN_PARAM_LINSOLVER}, -// {"KN_LINSOLVER_AUTO", KN_LINSOLVER_AUTO}, -// {"KN_LINSOLVER_INTERNAL", KN_LINSOLVER_INTERNAL}, -// {"KN_LINSOLVER_HYBRID", KN_LINSOLVER_HYBRID}, -// {"KN_LINSOLVER_DENSEQR", KN_LINSOLVER_DENSEQR}, -// {"KN_LINSOLVER_MA27", KN_LINSOLVER_MA27}, -// {"KN_LINSOLVER_MA57", KN_LINSOLVER_MA57}, -// {"KN_LINSOLVER_MKLPARDISO", KN_LINSOLVER_MKLPARDISO}, -// {"KN_LINSOLVER_MA97", KN_LINSOLVER_MA97}, -// {"KN_LINSOLVER_MA86", KN_LINSOLVER_MA86}, -// {"KN_PARAM_BAR_DIRECTINTERVAL", KN_PARAM_BAR_DIRECTINTERVAL}, -// {"KN_PARAM_PRESOLVE", KN_PARAM_PRESOLVE}, -// {"KN_PRESOLVE_NO", KN_PRESOLVE_NO}, -// {"KN_PRESOLVE_NONE", KN_PRESOLVE_NONE}, -// {"KN_PRESOLVE_YES", KN_PRESOLVE_YES}, -// {"KN_PRESOLVE_BASIC", KN_PRESOLVE_BASIC}, -// {"KN_PRESOLVE_ADVANCED", KN_PRESOLVE_ADVANCED}, -// {"KN_PARAM_PRESOLVE_TOL", KN_PARAM_PRESOLVE_TOL}, -// {"KN_PARAM_BAR_SWITCHRULE", KN_PARAM_BAR_SWITCHRULE}, -// {"KN_BAR_SWITCHRULE_AUTO", KN_BAR_SWITCHRULE_AUTO}, -// {"KN_BAR_SWITCHRULE_NEVER", KN_BAR_SWITCHRULE_NEVER}, -// {"KN_BAR_SWITCHRULE_MODERATE", KN_BAR_SWITCHRULE_MODERATE}, -// {"KN_BAR_SWITCHRULE_AGGRESSIVE", KN_BAR_SWITCHRULE_AGGRESSIVE}, -// {"KN_PARAM_HESSIAN_NO_F", KN_PARAM_HESSIAN_NO_F}, -// {"KN_HESSIAN_NO_F_FORBID", KN_HESSIAN_NO_F_FORBID}, -// {"KN_HESSIAN_NO_F_ALLOW", KN_HESSIAN_NO_F_ALLOW}, -// {"KN_PARAM_MA_TERMINATE", KN_PARAM_MA_TERMINATE}, -// {"KN_MA_TERMINATE_ALL", KN_MA_TERMINATE_ALL}, -// {"KN_MA_TERMINATE_OPTIMAL", KN_MA_TERMINATE_OPTIMAL}, -// {"KN_MA_TERMINATE_FEASIBLE", KN_MA_TERMINATE_FEASIBLE}, -// {"KN_MA_TERMINATE_ANY", KN_MA_TERMINATE_ANY}, -// {"KN_PARAM_MA_MAXTIMECPU", KN_PARAM_MA_MAXTIMECPU}, -// {"KN_PARAM_MA_MAXTIMEREAL", KN_PARAM_MA_MAXTIMEREAL}, -// {"KN_PARAM_MSSEED", KN_PARAM_MSSEED}, -// {"KN_PARAM_MS_SEED", KN_PARAM_MS_SEED}, -// {"KN_PARAM_MA_OUTSUB", KN_PARAM_MA_OUTSUB}, -// {"KN_MA_OUTSUB_NONE", KN_MA_OUTSUB_NONE}, -// {"KN_MA_OUTSUB_YES", KN_MA_OUTSUB_YES}, -// {"KN_PARAM_MS_OUTSUB", KN_PARAM_MS_OUTSUB}, -// {"KN_MS_OUTSUB_NONE", KN_MS_OUTSUB_NONE}, -// {"KN_MS_OUTSUB_YES", KN_MS_OUTSUB_YES}, -// {"KN_PARAM_XPRESSLIB", KN_PARAM_XPRESSLIB}, -// {"KN_PARAM_TUNER", KN_PARAM_TUNER}, -// {"KN_TUNER_OFF", KN_TUNER_OFF}, -// {"KN_TUNER_ON", KN_TUNER_ON}, -// {"KN_PARAM_TUNER_OPTIONSFILE", KN_PARAM_TUNER_OPTIONSFILE}, -// {"KN_PARAM_TUNER_MAXTIMECPU", KN_PARAM_TUNER_MAXTIMECPU}, -// {"KN_PARAM_TUNER_MAXTIMEREAL", KN_PARAM_TUNER_MAXTIMEREAL}, -// {"KN_PARAM_TUNER_OUTSUB", KN_PARAM_TUNER_OUTSUB}, -// {"KN_TUNER_OUTSUB_NONE", KN_TUNER_OUTSUB_NONE}, -// {"KN_TUNER_OUTSUB_SUMMARY", KN_TUNER_OUTSUB_SUMMARY}, -// {"KN_TUNER_OUTSUB_ALL", KN_TUNER_OUTSUB_ALL}, -// {"KN_PARAM_TUNER_TERMINATE", KN_PARAM_TUNER_TERMINATE}, -// {"KN_TUNER_TERMINATE_ALL", KN_TUNER_TERMINATE_ALL}, -// {"KN_TUNER_TERMINATE_OPTIMAL", KN_TUNER_TERMINATE_OPTIMAL}, -// {"KN_TUNER_TERMINATE_FEASIBLE", KN_TUNER_TERMINATE_FEASIBLE}, -// {"KN_TUNER_TERMINATE_ANY", KN_TUNER_TERMINATE_ANY}, -// {"KN_PARAM_LINSOLVER_OOC", KN_PARAM_LINSOLVER_OOC}, -// {"KN_LINSOLVER_OOC_NO", KN_LINSOLVER_OOC_NO}, -// {"KN_LINSOLVER_OOC_MAYBE", KN_LINSOLVER_OOC_MAYBE}, -// {"KN_LINSOLVER_OOC_YES", KN_LINSOLVER_OOC_YES}, -// {"KN_PARAM_BAR_RELAXCONS", KN_PARAM_BAR_RELAXCONS}, -// {"KN_BAR_RELAXCONS_NONE", KN_BAR_RELAXCONS_NONE}, -// {"KN_BAR_RELAXCONS_EQS", KN_BAR_RELAXCONS_EQS}, -// {"KN_BAR_RELAXCONS_INEQS", KN_BAR_RELAXCONS_INEQS}, -// {"KN_BAR_RELAXCONS_ALL", KN_BAR_RELAXCONS_ALL}, -// {"KN_PARAM_MSDETERMINISTIC", KN_PARAM_MSDETERMINISTIC}, -// {"KN_PARAM_MS_DETERMINISTIC", KN_PARAM_MS_DETERMINISTIC}, -// {"KN_MSDETERMINISTIC_NO", KN_MSDETERMINISTIC_NO}, -// {"KN_MS_DETERMINISTIC_NO", KN_MS_DETERMINISTIC_NO}, -// {"KN_MSDETERMINISTIC_YES", KN_MSDETERMINISTIC_YES}, -// {"KN_MS_DETERMINISTIC_YES", KN_MS_DETERMINISTIC_YES}, -// {"KN_PARAM_BAR_REFINEMENT", KN_PARAM_BAR_REFINEMENT}, -// {"KN_BAR_REFINEMENT_NO", KN_BAR_REFINEMENT_NO}, -// {"KN_BAR_REFINEMENT_YES", KN_BAR_REFINEMENT_YES}, -// {"KN_PARAM_DERIVCHECK", KN_PARAM_DERIVCHECK}, -// {"KN_DERIVCHECK_NONE", KN_DERIVCHECK_NONE}, -// {"KN_DERIVCHECK_FIRST", KN_DERIVCHECK_FIRST}, -// {"KN_DERIVCHECK_SECOND", KN_DERIVCHECK_SECOND}, -// {"KN_DERIVCHECK_ALL", KN_DERIVCHECK_ALL}, -// {"KN_PARAM_DERIVCHECK_TYPE", KN_PARAM_DERIVCHECK_TYPE}, -// {"KN_DERIVCHECK_FORWARD", KN_DERIVCHECK_FORWARD}, -// {"KN_DERIVCHECK_CENTRAL", KN_DERIVCHECK_CENTRAL}, -// {"KN_PARAM_DERIVCHECK_TOL", KN_PARAM_DERIVCHECK_TOL}, -// {"KN_PARAM_LINSOLVER_INEXACT", KN_PARAM_LINSOLVER_INEXACT}, -// {"KN_LINSOLVER_INEXACT_NO", KN_LINSOLVER_INEXACT_NO}, -// {"KN_LINSOLVER_INEXACT_YES", KN_LINSOLVER_INEXACT_YES}, -// {"KN_PARAM_LINSOLVER_INEXACTTOL", KN_PARAM_LINSOLVER_INEXACTTOL}, -// {"KN_PARAM_MAXFEVALS", KN_PARAM_MAXFEVALS}, -// {"KN_PARAM_FSTOPVAL", KN_PARAM_FSTOPVAL}, -// {"KN_PARAM_DATACHECK", KN_PARAM_DATACHECK}, -// {"KN_DATACHECK_NO", KN_DATACHECK_NO}, -// {"KN_DATACHECK_YES", KN_DATACHECK_YES}, -// {"KN_PARAM_DERIVCHECK_TERMINATE", KN_PARAM_DERIVCHECK_TERMINATE}, -// {"KN_DERIVCHECK_STOPERROR", KN_DERIVCHECK_STOPERROR}, -// {"KN_DERIVCHECK_STOPALWAYS", KN_DERIVCHECK_STOPALWAYS}, -// {"KN_PARAM_BAR_WATCHDOG", KN_PARAM_BAR_WATCHDOG}, -// {"KN_BAR_WATCHDOG_NO", KN_BAR_WATCHDOG_NO}, -// {"KN_BAR_WATCHDOG_YES", KN_BAR_WATCHDOG_YES}, -// {"KN_PARAM_FTOL", KN_PARAM_FTOL}, -// {"KN_PARAM_FTOL_ITERS", KN_PARAM_FTOL_ITERS}, -// {"KN_PARAM_ACT_QPALG", KN_PARAM_ACT_QPALG}, -// {"KN_ACT_QPALG_AUTO", KN_ACT_QPALG_AUTO}, -// {"KN_ACT_QPALG_BAR_DIRECT", KN_ACT_QPALG_BAR_DIRECT}, -// {"KN_ACT_QPALG_BAR_CG", KN_ACT_QPALG_BAR_CG}, -// {"KN_ACT_QPALG_ACT_CG", KN_ACT_QPALG_ACT_CG}, -// {"KN_PARAM_BAR_INITPI_MPEC", KN_PARAM_BAR_INITPI_MPEC}, -// {"KN_PARAM_XTOL_ITERS", KN_PARAM_XTOL_ITERS}, -// {"KN_PARAM_LINESEARCH", KN_PARAM_LINESEARCH}, -// {"KN_LINESEARCH_AUTO", KN_LINESEARCH_AUTO}, -// {"KN_LINESEARCH_BACKTRACK", KN_LINESEARCH_BACKTRACK}, -// {"KN_LINESEARCH_INTERPOLATE", KN_LINESEARCH_INTERPOLATE}, -// {"KN_LINESEARCH_WEAKWOLFE", KN_LINESEARCH_WEAKWOLFE}, -// {"KN_PARAM_OUT_CSVINFO", KN_PARAM_OUT_CSVINFO}, -// {"KN_OUT_CSVINFO_NO", KN_OUT_CSVINFO_NO}, -// {"KN_OUT_CSVINFO_YES", KN_OUT_CSVINFO_YES}, -// {"KN_PARAM_INITPENALTY", KN_PARAM_INITPENALTY}, -// {"KN_PARAM_ACT_LPFEASTOL", KN_PARAM_ACT_LPFEASTOL}, -// {"KN_PARAM_CG_STOPTOL", KN_PARAM_CG_STOPTOL}, -// {"KN_PARAM_RESTARTS", KN_PARAM_RESTARTS}, -// {"KN_PARAM_RESTARTS_MAXIT", KN_PARAM_RESTARTS_MAXIT}, -// {"KN_PARAM_BAR_SLACKBOUNDPUSH", KN_PARAM_BAR_SLACKBOUNDPUSH}, -// {"KN_PARAM_CG_PMEM", KN_PARAM_CG_PMEM}, -// {"KN_PARAM_BAR_SWITCHOBJ", KN_PARAM_BAR_SWITCHOBJ}, -// {"KN_BAR_SWITCHOBJ_NONE", KN_BAR_SWITCHOBJ_NONE}, -// {"KN_BAR_SWITCHOBJ_SCALARPROX", KN_BAR_SWITCHOBJ_SCALARPROX}, -// {"KN_BAR_SWITCHOBJ_DIAGPROX", KN_BAR_SWITCHOBJ_DIAGPROX}, -// {"KN_PARAM_OUTNAME", KN_PARAM_OUTNAME}, -// {"KN_PARAM_OUT_CSVNAME", KN_PARAM_OUT_CSVNAME}, -// {"KN_PARAM_ACT_PARAMETRIC", KN_PARAM_ACT_PARAMETRIC}, -// {"KN_ACT_PARAMETRIC_NO", KN_ACT_PARAMETRIC_NO}, -// {"KN_ACT_PARAMETRIC_MAYBE", KN_ACT_PARAMETRIC_MAYBE}, -// {"KN_ACT_PARAMETRIC_YES", KN_ACT_PARAMETRIC_YES}, -// {"KN_PARAM_ACT_LPDUMPMPS", KN_PARAM_ACT_LPDUMPMPS}, -// {"KN_ACT_LPDUMPMPS_NO", KN_ACT_LPDUMPMPS_NO}, -// {"KN_ACT_LPDUMPMPS_YES", KN_ACT_LPDUMPMPS_YES}, -// {"KN_PARAM_ACT_LPALG", KN_PARAM_ACT_LPALG}, -// {"KN_ACT_LPALG_DEFAULT", KN_ACT_LPALG_DEFAULT}, -// {"KN_ACT_LPALG_PRIMAL", KN_ACT_LPALG_PRIMAL}, -// {"KN_ACT_LPALG_DUAL", KN_ACT_LPALG_DUAL}, -// {"KN_ACT_LPALG_BARRIER", KN_ACT_LPALG_BARRIER}, -// {"KN_PARAM_ACT_LPPRESOLVE", KN_PARAM_ACT_LPPRESOLVE}, -// {"KN_ACT_LPPRESOLVE_OFF", KN_ACT_LPPRESOLVE_OFF}, -// {"KN_ACT_LPPRESOLVE_ON", KN_ACT_LPPRESOLVE_ON}, -// {"KN_PARAM_ACT_LPPENALTY", KN_PARAM_ACT_LPPENALTY}, -// {"KN_ACT_LPPENALTY_ALL", KN_ACT_LPPENALTY_ALL}, -// {"KN_ACT_LPPENALTY_NONLINEAR", KN_ACT_LPPENALTY_NONLINEAR}, -// {"KN_ACT_LPPENALTY_DYNAMIC", KN_ACT_LPPENALTY_DYNAMIC}, -// {"KN_PARAM_BNDRANGE", KN_PARAM_BNDRANGE}, -// {"KN_PARAM_BAR_CONIC_ENABLE", KN_PARAM_BAR_CONIC_ENABLE}, -// {"KN_BAR_CONIC_ENABLE_AUTO", KN_BAR_CONIC_ENABLE_AUTO}, -// {"KN_BAR_CONIC_ENABLE_NONE", KN_BAR_CONIC_ENABLE_NONE}, -// {"KN_BAR_CONIC_ENABLE_SOC", KN_BAR_CONIC_ENABLE_SOC}, -// {"KN_PARAM_CONVEX", KN_PARAM_CONVEX}, -// {"KN_CONVEX_AUTO", KN_CONVEX_AUTO}, -// {"KN_CONVEX_NO", KN_CONVEX_NO}, -// {"KN_CONVEX_YES", KN_CONVEX_YES}, -// {"KN_PARAM_OUT_HINTS", KN_PARAM_OUT_HINTS}, -// {"KN_OUT_HINTS_NO", KN_OUT_HINTS_NO}, -// {"KN_OUT_HINTS_YES", KN_OUT_HINTS_YES}, -// {"KN_PARAM_EVAL_FCGA", KN_PARAM_EVAL_FCGA}, -// {"KN_EVAL_FCGA_NO", KN_EVAL_FCGA_NO}, -// {"KN_EVAL_FCGA_YES", KN_EVAL_FCGA_YES}, -// {"KN_PARAM_BAR_MAXCORRECTORS", KN_PARAM_BAR_MAXCORRECTORS}, -// {"KN_PARAM_STRAT_WARM_START", KN_PARAM_STRAT_WARM_START}, -// {"KN_STRAT_WARM_START_NO", KN_STRAT_WARM_START_NO}, -// {"KN_STRAT_WARM_START_YES", KN_STRAT_WARM_START_YES}, -// {"KN_PARAM_FINDIFF_TERMINATE", KN_PARAM_FINDIFF_TERMINATE}, -// {"KN_FINDIFF_TERMINATE_NONE", KN_FINDIFF_TERMINATE_NONE}, -// {"KN_FINDIFF_TERMINATE_ERREST", KN_FINDIFF_TERMINATE_ERREST}, -// {"KN_PARAM_CPUPLATFORM", KN_PARAM_CPUPLATFORM}, -// {"KN_CPUPLATFORM_AUTO", KN_CPUPLATFORM_AUTO}, -// {"KN_CPUPLATFORM_COMPATIBLE", KN_CPUPLATFORM_COMPATIBLE}, -// {"KN_CPUPLATFORM_SSE2", KN_CPUPLATFORM_SSE2}, -// {"KN_CPUPLATFORM_AVX", KN_CPUPLATFORM_AVX}, -// {"KN_CPUPLATFORM_AVX2", KN_CPUPLATFORM_AVX2}, -// {"KN_CPUPLATFORM_AVX512", KN_CPUPLATFORM_AVX512}, -// {"KN_PARAM_PRESOLVE_PASSES", KN_PARAM_PRESOLVE_PASSES}, -// {"KN_PARAM_PRESOLVE_LEVEL", KN_PARAM_PRESOLVE_LEVEL}, -// {"KN_PRESOLVE_LEVEL_AUTO", KN_PRESOLVE_LEVEL_AUTO}, -// {"KN_PRESOLVE_LEVEL_1", KN_PRESOLVE_LEVEL_1}, -// {"KN_PRESOLVE_LEVEL_2", KN_PRESOLVE_LEVEL_2}, -// {"KN_PARAM_FINDIFF_RELSTEPSIZE", KN_PARAM_FINDIFF_RELSTEPSIZE}, -// {"KN_PARAM_INFEASTOL_ITERS", KN_PARAM_INFEASTOL_ITERS}, -// {"KN_PARAM_PRESOLVEOP_TIGHTEN", KN_PARAM_PRESOLVEOP_TIGHTEN}, -// {"KN_PRESOLVEOP_TIGHTEN_AUTO", KN_PRESOLVEOP_TIGHTEN_AUTO}, -// {"KN_PRESOLVEOP_TIGHTEN_NONE", KN_PRESOLVEOP_TIGHTEN_NONE}, -// {"KN_PRESOLVEOP_TIGHTEN_VARBND", KN_PRESOLVEOP_TIGHTEN_VARBND}, -// {"KN_PRESOLVEOP_TIGHTEN_COEF", KN_PRESOLVEOP_TIGHTEN_COEF}, -// {"KN_PRESOLVEOP_TIGHTEN_ALL", KN_PRESOLVEOP_TIGHTEN_ALL}, -// {"KN_PARAM_BAR_LINSYS", KN_PARAM_BAR_LINSYS}, -// {"KN_BAR_LINSYS_AUTO", KN_BAR_LINSYS_AUTO}, -// {"KN_BAR_LINSYS_FULL", KN_BAR_LINSYS_FULL}, -// {"KN_BAR_LINSYS_COMPACT1", KN_BAR_LINSYS_COMPACT1}, -// {"KN_BAR_LINSYS_ELIMINATE_SLACKS", KN_BAR_LINSYS_ELIMINATE_SLACKS}, -// {"KN_BAR_LINSYS_COMPACT2", KN_BAR_LINSYS_COMPACT2}, -// {"KN_BAR_LINSYS_ELIMINATE_BOUNDS", KN_BAR_LINSYS_ELIMINATE_BOUNDS}, -// {"KN_BAR_LINSYS_ELIMINATE_INEQS", KN_BAR_LINSYS_ELIMINATE_INEQS}, -// {"KN_PARAM_PRESOLVE_INITPT", KN_PARAM_PRESOLVE_INITPT}, -// {"KN_PRESOLVE_INITPT_AUTO", KN_PRESOLVE_INITPT_AUTO}, -// {"KN_PRESOLVE_INITPT_NOSHIFT", KN_PRESOLVE_INITPT_NOSHIFT}, -// {"KN_PRESOLVE_INITPT_LINSHIFT", KN_PRESOLVE_INITPT_LINSHIFT}, -// {"KN_PRESOLVE_INITPT_ANYSHIFT", KN_PRESOLVE_INITPT_ANYSHIFT}, -// {"KN_PARAM_ACT_QPPENALTY", KN_PARAM_ACT_QPPENALTY}, -// {"KN_ACT_QPPENALTY_AUTO", KN_ACT_QPPENALTY_AUTO}, -// {"KN_ACT_QPPENALTY_NONE", KN_ACT_QPPENALTY_NONE}, -// {"KN_ACT_QPPENALTY_ALL", KN_ACT_QPPENALTY_ALL}, -// {"KN_PARAM_BAR_LINSYS_STORAGE", KN_PARAM_BAR_LINSYS_STORAGE}, -// {"KN_BAR_LINSYS_STORAGE_AUTO", KN_BAR_LINSYS_STORAGE_AUTO}, -// {"KN_BAR_LINSYS_STORAGE_LOWMEM", KN_BAR_LINSYS_STORAGE_LOWMEM}, -// {"KN_BAR_LINSYS_STORAGE_NORMAL", KN_BAR_LINSYS_STORAGE_NORMAL}, -// {"KN_PARAM_LINSOLVER_MAXITREF", KN_PARAM_LINSOLVER_MAXITREF}, -// {"KN_PARAM_BFGS_SCALING", KN_PARAM_BFGS_SCALING}, -// {"KN_BFGS_SCALING_DYNAMIC", KN_BFGS_SCALING_DYNAMIC}, -// {"KN_BFGS_SCALING_INVHESS", KN_BFGS_SCALING_INVHESS}, -// {"KN_BFGS_SCALING_HESS", KN_BFGS_SCALING_HESS}, -// {"KN_PARAM_BAR_INITSHIFTTOL", KN_PARAM_BAR_INITSHIFTTOL}, -// {"KN_PARAM_NUMTHREADS", KN_PARAM_NUMTHREADS}, -// {"KN_PARAM_CONCURRENT_EVALS", KN_PARAM_CONCURRENT_EVALS}, -// {"KN_CONCURRENT_EVALS_NO", KN_CONCURRENT_EVALS_NO}, -// {"KN_CONCURRENT_EVALS_YES", KN_CONCURRENT_EVALS_YES}, -// {"KN_PARAM_BLAS_NUMTHREADS", KN_PARAM_BLAS_NUMTHREADS}, -// {"KN_PARAM_LINSOLVER_NUMTHREADS", KN_PARAM_LINSOLVER_NUMTHREADS}, -// {"KN_PARAM_MS_NUMTHREADS", KN_PARAM_MS_NUMTHREADS}, -// {"KN_PARAM_CONIC_NUMTHREADS", KN_PARAM_CONIC_NUMTHREADS}, -// {"KN_PARAM_NCVX_QCQP_INIT", KN_PARAM_NCVX_QCQP_INIT}, -// {"KN_NCVX_QCQP_INIT_AUTO", KN_NCVX_QCQP_INIT_AUTO}, -// {"KN_NCVX_QCQP_INIT_NONE", KN_NCVX_QCQP_INIT_NONE}, -// {"KN_NCVX_QCQP_INIT_LINEAR", KN_NCVX_QCQP_INIT_LINEAR}, -// {"KN_NCVX_QCQP_INIT_HYBRID", KN_NCVX_QCQP_INIT_HYBRID}, -// {"KN_NCVX_QCQP_INIT_PENALTY", KN_NCVX_QCQP_INIT_PENALTY}, -// {"KN_NCVX_QCQP_INIT_CVXQUAD", KN_NCVX_QCQP_INIT_CVXQUAD}, -// {"KN_PARAM_FINDIFF_ESTNOISE", KN_PARAM_FINDIFF_ESTNOISE}, -// {"KN_FINDIFF_ESTNOISE_NO", KN_FINDIFF_ESTNOISE_NO}, -// {"KN_FINDIFF_ESTNOISE_YES", KN_FINDIFF_ESTNOISE_YES}, -// {"KN_FINDIFF_ESTNOISE_WITHCURV", KN_FINDIFF_ESTNOISE_WITHCURV}, -// {"KN_PARAM_FINDIFF_NUMTHREADS", KN_PARAM_FINDIFF_NUMTHREADS}, -// {"KN_PARAM_BAR_MPEC_HEURISTIC", KN_PARAM_BAR_MPEC_HEURISTIC}, -// {"KN_BAR_MPEC_HEURISTIC_NO", KN_BAR_MPEC_HEURISTIC_NO}, -// {"KN_BAR_MPEC_HEURISTIC_YES", KN_BAR_MPEC_HEURISTIC_YES}, -// {"KN_PARAM_PRESOLVEOP_REDUNDANT", KN_PARAM_PRESOLVEOP_REDUNDANT}, -// {"KN_PRESOLVEOP_REDUNDANT_NONE", KN_PRESOLVEOP_REDUNDANT_NONE}, -// {"KN_PRESOLVEOP_REDUNDANT_DUPCON", KN_PRESOLVEOP_REDUNDANT_DUPCON}, -// {"KN_PRESOLVEOP_REDUNDANT_DEPCON", KN_PRESOLVEOP_REDUNDANT_DEPCON}, -// {"KN_PARAM_LINSOLVER_ORDERING", KN_PARAM_LINSOLVER_ORDERING}, -// {"KN_LINSOLVER_ORDERING_AUTO", KN_LINSOLVER_ORDERING_AUTO}, -// {"KN_LINSOLVER_ORDERING_BEST", KN_LINSOLVER_ORDERING_BEST}, -// {"KN_LINSOLVER_ORDERING_AMD", KN_LINSOLVER_ORDERING_AMD}, -// {"KN_LINSOLVER_ORDERING_METIS", KN_LINSOLVER_ORDERING_METIS}, -// {"KN_PARAM_LINSOLVER_NODEAMALG", KN_PARAM_LINSOLVER_NODEAMALG}, -// {"KN_PARAM_PRESOLVEOP_SUBSTITUTION", KN_PARAM_PRESOLVEOP_SUBSTITUTION}, -// {"KN_PRESOLVEOP_SUBSTITUTION_AUTO", KN_PRESOLVEOP_SUBSTITUTION_AUTO}, -// {"KN_PRESOLVEOP_SUBSTITUTION_NONE", KN_PRESOLVEOP_SUBSTITUTION_NONE}, -// {"KN_PRESOLVEOP_SUBSTITUTION_SIMPLE", KN_PRESOLVEOP_SUBSTITUTION_SIMPLE}, -// {"KN_PRESOLVEOP_SUBSTITUTION_ALL", KN_PRESOLVEOP_SUBSTITUTION_ALL}, -// {"KN_PARAM_PRESOLVEOP_SUBSTITUTION_TOL", -// KN_PARAM_PRESOLVEOP_SUBSTITUTION_TOL}, -// {"KN_PARAM_MS_INITPT_CLUSTER", KN_PARAM_MS_INITPT_CLUSTER}, -// {"KN_MS_INITPT_CLUSTER_NONE", KN_MS_INITPT_CLUSTER_NONE}, -// {"KN_MS_INITPT_CLUSTER_SL", KN_MS_INITPT_CLUSTER_SL}, -// {"KN_PARAM_SCALE_VARS", KN_PARAM_SCALE_VARS}, -// {"KN_SCALE_VARS_NONE", KN_SCALE_VARS_NONE}, -// {"KN_SCALE_VARS_BNDS", KN_SCALE_VARS_BNDS}, -// {"KN_PARAM_BAR_MAXMU", KN_PARAM_BAR_MAXMU}, -// {"KN_PARAM_BAR_GLOBALIZE", KN_PARAM_BAR_GLOBALIZE}, -// {"KN_BAR_GLOBALIZE_NONE", KN_BAR_GLOBALIZE_NONE}, -// {"KN_BAR_GLOBALIZE_KKT", KN_BAR_GLOBALIZE_KKT}, -// {"KN_BAR_GLOBALIZE_FILTER", KN_BAR_GLOBALIZE_FILTER}, -// {"KN_PARAM_LINSOLVER_SCALING", KN_PARAM_LINSOLVER_SCALING}, -// {"KN_LINSOLVER_SCALING_NONE", KN_LINSOLVER_SCALING_NONE}, -// {"KN_LINSOLVER_SCALING_ALWAYS", KN_LINSOLVER_SCALING_ALWAYS}, -// {"KN_PARAM_MIP_METHOD", KN_PARAM_MIP_METHOD}, -// {"KN_MIP_METHOD_AUTO", KN_MIP_METHOD_AUTO}, -// {"KN_MIP_METHOD_BB", KN_MIP_METHOD_BB}, -// {"KN_MIP_METHOD_HQG", KN_MIP_METHOD_HQG}, -// {"KN_MIP_METHOD_MISQP", KN_MIP_METHOD_MISQP}, -// {"KN_PARAM_MIP_BRANCHRULE", KN_PARAM_MIP_BRANCHRULE}, -// {"KN_MIP_BRANCH_AUTO", KN_MIP_BRANCH_AUTO}, -// {"KN_MIP_BRANCH_MOSTFRAC", KN_MIP_BRANCH_MOSTFRAC}, -// {"KN_MIP_BRANCH_PSEUDOCOST", KN_MIP_BRANCH_PSEUDOCOST}, -// {"KN_MIP_BRANCH_STRONG", KN_MIP_BRANCH_STRONG}, -// {"KN_PARAM_MIP_SELECTRULE", KN_PARAM_MIP_SELECTRULE}, -// {"KN_MIP_SEL_AUTO", KN_MIP_SEL_AUTO}, -// {"KN_MIP_SEL_DEPTHFIRST", KN_MIP_SEL_DEPTHFIRST}, -// {"KN_MIP_SEL_BESTBOUND", KN_MIP_SEL_BESTBOUND}, -// {"KN_MIP_SEL_COMBO_1", KN_MIP_SEL_COMBO_1}, -// {"KN_PARAM_MIP_INTGAPABS", KN_PARAM_MIP_INTGAPABS}, -// {"KN_PARAM_MIP_OPTGAPABS", KN_PARAM_MIP_OPTGAPABS}, -// {"KN_PARAM_MIP_INTGAPREL", KN_PARAM_MIP_INTGAPREL}, -// {"KN_PARAM_MIP_OPTGAPREL", KN_PARAM_MIP_OPTGAPREL}, -// {"KN_PARAM_MIP_MAXTIMECPU", KN_PARAM_MIP_MAXTIMECPU}, -// {"KN_PARAM_MIP_MAXTIMEREAL", KN_PARAM_MIP_MAXTIMEREAL}, -// {"KN_PARAM_MIP_MAXSOLVES", KN_PARAM_MIP_MAXSOLVES}, -// {"KN_PARAM_MIP_INTEGERTOL", KN_PARAM_MIP_INTEGERTOL}, -// {"KN_PARAM_MIP_OUTLEVEL", KN_PARAM_MIP_OUTLEVEL}, -// {"KN_MIP_OUTLEVEL_NONE", KN_MIP_OUTLEVEL_NONE}, -// {"KN_MIP_OUTLEVEL_ITERS", KN_MIP_OUTLEVEL_ITERS}, -// {"KN_MIP_OUTLEVEL_ITERSTIME", KN_MIP_OUTLEVEL_ITERSTIME}, -// {"KN_MIP_OUTLEVEL_ROOT", KN_MIP_OUTLEVEL_ROOT}, -// {"KN_PARAM_MIP_OUTINTERVAL", KN_PARAM_MIP_OUTINTERVAL}, -// {"KN_PARAM_MIP_OUTSUB", KN_PARAM_MIP_OUTSUB}, -// {"KN_MIP_OUTSUB_NONE", KN_MIP_OUTSUB_NONE}, -// {"KN_MIP_OUTSUB_YES", KN_MIP_OUTSUB_YES}, -// {"KN_MIP_OUTSUB_YESPROB", KN_MIP_OUTSUB_YESPROB}, -// {"KN_PARAM_MIP_DEBUG", KN_PARAM_MIP_DEBUG}, -// {"KN_MIP_DEBUG_NONE", KN_MIP_DEBUG_NONE}, -// {"KN_MIP_DEBUG_ALL", KN_MIP_DEBUG_ALL}, -// {"KN_PARAM_MIP_IMPLICATNS", KN_PARAM_MIP_IMPLICATNS}, -// {"KN_PARAM_MIP_IMPLICATIONS", KN_PARAM_MIP_IMPLICATIONS}, -// {"KN_MIP_IMPLICATNS_NO", KN_MIP_IMPLICATNS_NO}, -// {"KN_MIP_IMPLICATIONS_NO", KN_MIP_IMPLICATIONS_NO}, -// {"KN_MIP_IMPLICATNS_YES", KN_MIP_IMPLICATNS_YES}, -// {"KN_MIP_IMPLICATIONS_YES", KN_MIP_IMPLICATIONS_YES}, -// {"KN_PARAM_MIP_GUB_BRANCH", KN_PARAM_MIP_GUB_BRANCH}, -// {"KN_MIP_GUB_BRANCH_NO", KN_MIP_GUB_BRANCH_NO}, -// {"KN_MIP_GUB_BRANCH_YES", KN_MIP_GUB_BRANCH_YES}, -// {"KN_PARAM_MIP_KNAPSACK", KN_PARAM_MIP_KNAPSACK}, -// {"KN_MIP_KNAPSACK_AUTO", KN_MIP_KNAPSACK_AUTO}, -// {"KN_MIP_KNAPSACK_NO", KN_MIP_KNAPSACK_NO}, -// {"KN_MIP_KNAPSACK_NONE", KN_MIP_KNAPSACK_NONE}, -// {"KN_MIP_KNAPSACK_ROOT", KN_MIP_KNAPSACK_ROOT}, -// {"KN_MIP_KNAPSACK_TREE", KN_MIP_KNAPSACK_TREE}, -// {"KN_MIP_KNAPSACK_INEQ", KN_MIP_KNAPSACK_INEQ}, -// {"KN_MIP_KNAPSACK_LIFTED", KN_MIP_KNAPSACK_LIFTED}, -// {"KN_MIP_KNAPSACK_ALL", KN_MIP_KNAPSACK_ALL}, -// {"KN_PARAM_MIP_ROUNDING", KN_PARAM_MIP_ROUNDING}, -// {"KN_MIP_ROUND_AUTO", KN_MIP_ROUND_AUTO}, -// {"KN_MIP_ROUND_NONE", KN_MIP_ROUND_NONE}, -// {"KN_MIP_ROUND_HEURISTIC", KN_MIP_ROUND_HEURISTIC}, -// {"KN_MIP_ROUND_NLP_SOME", KN_MIP_ROUND_NLP_SOME}, -// {"KN_MIP_ROUND_NLP_ALWAYS", KN_MIP_ROUND_NLP_ALWAYS}, -// {"KN_PARAM_MIP_ROOTALG", KN_PARAM_MIP_ROOTALG}, -// {"KN_MIP_ROOTALG_AUTO", KN_MIP_ROOTALG_AUTO}, -// {"KN_MIP_ROOTALG_BAR_DIRECT", KN_MIP_ROOTALG_BAR_DIRECT}, -// {"KN_MIP_ROOTALG_BAR_CG", KN_MIP_ROOTALG_BAR_CG}, -// {"KN_MIP_ROOTALG_ACT_CG", KN_MIP_ROOTALG_ACT_CG}, -// {"KN_MIP_ROOTALG_ACT_SQP", KN_MIP_ROOTALG_ACT_SQP}, -// {"KN_MIP_ROOTALG_MULTI", KN_MIP_ROOTALG_MULTI}, -// {"KN_PARAM_MIP_LPALG", KN_PARAM_MIP_LPALG}, -// {"KN_MIP_LPALG_AUTO", KN_MIP_LPALG_AUTO}, -// {"KN_MIP_LPALG_BAR_DIRECT", KN_MIP_LPALG_BAR_DIRECT}, -// {"KN_MIP_LPALG_BAR_CG", KN_MIP_LPALG_BAR_CG}, -// {"KN_MIP_LPALG_ACT_CG", KN_MIP_LPALG_ACT_CG}, -// {"KN_PARAM_MIP_TERMINATE", KN_PARAM_MIP_TERMINATE}, -// {"KN_MIP_TERMINATE_OPTIMAL", KN_MIP_TERMINATE_OPTIMAL}, -// {"KN_MIP_TERMINATE_FEASIBLE", KN_MIP_TERMINATE_FEASIBLE}, -// {"KN_PARAM_MIP_MAXNODES", KN_PARAM_MIP_MAXNODES}, -// {"KN_PARAM_MIP_HEURISTIC", KN_PARAM_MIP_HEURISTIC}, -// {"KN_MIP_HEURISTIC_AUTO", KN_MIP_HEURISTIC_AUTO}, -// {"KN_MIP_HEURISTIC_NONE", KN_MIP_HEURISTIC_NONE}, -// {"KN_MIP_HEURISTIC_FEASPUMP", KN_MIP_HEURISTIC_FEASPUMP}, -// {"KN_MIP_HEURISTIC_MPEC", KN_MIP_HEURISTIC_MPEC}, -// {"KN_MIP_HEURISTIC_DIVING", KN_MIP_HEURISTIC_DIVING}, -// {"KN_PARAM_MIP_HEUR_MAXIT", KN_PARAM_MIP_HEUR_MAXIT}, -// {"KN_PARAM_MIP_HEUR_MAXTIMECPU", KN_PARAM_MIP_HEUR_MAXTIMECPU}, -// {"KN_PARAM_MIP_HEUR_MAXTIMEREAL", KN_PARAM_MIP_HEUR_MAXTIMEREAL}, -// {"KN_PARAM_MIP_PSEUDOINIT", KN_PARAM_MIP_PSEUDOINIT}, -// {"KN_MIP_PSEUDOINIT_AUTO", KN_MIP_PSEUDOINIT_AUTO}, -// {"KN_MIP_PSEUDOINIT_AVE", KN_MIP_PSEUDOINIT_AVE}, -// {"KN_MIP_PSEUDOINIT_STRONG", KN_MIP_PSEUDOINIT_STRONG}, -// {"KN_PARAM_MIP_STRONG_MAXIT", KN_PARAM_MIP_STRONG_MAXIT}, -// {"KN_PARAM_MIP_STRONG_CANDLIM", KN_PARAM_MIP_STRONG_CANDLIM}, -// {"KN_PARAM_MIP_STRONG_LEVEL", KN_PARAM_MIP_STRONG_LEVEL}, -// {"KN_PARAM_MIP_INTVAR_STRATEGY", KN_PARAM_MIP_INTVAR_STRATEGY}, -// {"KN_MIP_INTVAR_STRATEGY_NONE", KN_MIP_INTVAR_STRATEGY_NONE}, -// {"KN_MIP_INTVAR_STRATEGY_RELAX", KN_MIP_INTVAR_STRATEGY_RELAX}, -// {"KN_MIP_INTVAR_STRATEGY_MPEC", KN_MIP_INTVAR_STRATEGY_MPEC}, -// {"KN_PARAM_MIP_RELAXABLE", KN_PARAM_MIP_RELAXABLE}, -// {"KN_MIP_RELAXABLE_NONE", KN_MIP_RELAXABLE_NONE}, -// {"KN_MIP_RELAXABLE_ALL", KN_MIP_RELAXABLE_ALL}, -// {"KN_PARAM_MIP_NODEALG", KN_PARAM_MIP_NODEALG}, -// {"KN_MIP_NODEALG_AUTO", KN_MIP_NODEALG_AUTO}, -// {"KN_MIP_NODEALG_BAR_DIRECT", KN_MIP_NODEALG_BAR_DIRECT}, -// {"KN_MIP_NODEALG_BAR_CG", KN_MIP_NODEALG_BAR_CG}, -// {"KN_MIP_NODEALG_ACT_CG", KN_MIP_NODEALG_ACT_CG}, -// {"KN_MIP_NODEALG_ACT_SQP", KN_MIP_NODEALG_ACT_SQP}, -// {"KN_MIP_NODEALG_MULTI", KN_MIP_NODEALG_MULTI}, -// {"KN_PARAM_MIP_HEUR_TERMINATE", KN_PARAM_MIP_HEUR_TERMINATE}, -// {"KN_MIP_HEUR_TERMINATE_FEASIBLE", KN_MIP_HEUR_TERMINATE_FEASIBLE}, -// {"KN_MIP_HEUR_TERMINATE_LIMIT", KN_MIP_HEUR_TERMINATE_LIMIT}, -// {"KN_PARAM_MIP_SELECTDIR", KN_PARAM_MIP_SELECTDIR}, -// {"KN_MIP_SELECTDIR_DOWN", KN_MIP_SELECTDIR_DOWN}, -// {"KN_MIP_SELECTDIR_UP", KN_MIP_SELECTDIR_UP}, -// {"KN_PARAM_MIP_CUTFACTOR", KN_PARAM_MIP_CUTFACTOR}, -// {"KN_PARAM_MIP_ZEROHALF", KN_PARAM_MIP_ZEROHALF}, -// {"KN_MIP_ZEROHALF_AUTO", KN_MIP_ZEROHALF_AUTO}, -// {"KN_MIP_ZEROHALF_NONE", KN_MIP_ZEROHALF_NONE}, -// {"KN_MIP_ZEROHALF_ROOT", KN_MIP_ZEROHALF_ROOT}, -// {"KN_MIP_ZEROHALF_TREE", KN_MIP_ZEROHALF_TREE}, -// {"KN_MIP_ZEROHALF_ALL", KN_MIP_ZEROHALF_ALL}, -// {"KN_PARAM_MIP_MIR", KN_PARAM_MIP_MIR}, -// {"KN_MIP_MIR_AUTO", KN_MIP_MIR_AUTO}, -// {"KN_MIP_MIR_NONE", KN_MIP_MIR_NONE}, -// {"KN_MIP_MIR_ROOT", KN_MIP_MIR_ROOT}, -// {"KN_MIP_MIR_TREE", KN_MIP_MIR_TREE}, -// {"KN_MIP_MIR_NLP", KN_MIP_MIR_NLP}, -// {"KN_PARAM_MIP_CLIQUE", KN_PARAM_MIP_CLIQUE}, -// {"KN_MIP_CLIQUE_AUTO", KN_MIP_CLIQUE_AUTO}, -// {"KN_MIP_CLIQUE_NONE", KN_MIP_CLIQUE_NONE}, -// {"KN_MIP_CLIQUE_ROOT", KN_MIP_CLIQUE_ROOT}, -// {"KN_MIP_CLIQUE_TREE", KN_MIP_CLIQUE_TREE}, -// {"KN_MIP_CLIQUE_ALL", KN_MIP_CLIQUE_ALL}, -// {"KN_PARAM_MIP_HEUR_STRATEGY", KN_PARAM_MIP_HEUR_STRATEGY}, -// {"KN_MIP_HEUR_STRATEGY_AUTO", KN_MIP_HEUR_STRATEGY_AUTO}, -// {"KN_MIP_HEUR_STRATEGY_NONE", KN_MIP_HEUR_STRATEGY_NONE}, -// {"KN_MIP_HEUR_STRATEGY_BASIC", KN_MIP_HEUR_STRATEGY_BASIC}, -// {"KN_MIP_HEUR_STRATEGY_ADVANCED", KN_MIP_HEUR_STRATEGY_ADVANCED}, -// {"KN_MIP_HEUR_STRATEGY_EXTENSIVE", KN_MIP_HEUR_STRATEGY_EXTENSIVE}, -// {"KN_PARAM_MIP_HEUR_FEASPUMP", KN_PARAM_MIP_HEUR_FEASPUMP}, -// {"KN_MIP_HEUR_FEASPUMP_AUTO", KN_MIP_HEUR_FEASPUMP_AUTO}, -// {"KN_MIP_HEUR_FEASPUMP_OFF", KN_MIP_HEUR_FEASPUMP_OFF}, -// {"KN_MIP_HEUR_FEASPUMP_ON", KN_MIP_HEUR_FEASPUMP_ON}, -// {"KN_PARAM_MIP_HEUR_MPEC", KN_PARAM_MIP_HEUR_MPEC}, -// {"KN_MIP_HEUR_MPEC_AUTO", KN_MIP_HEUR_MPEC_AUTO}, -// {"KN_MIP_HEUR_MPEC_OFF", KN_MIP_HEUR_MPEC_OFF}, -// {"KN_MIP_HEUR_MPEC_ON", KN_MIP_HEUR_MPEC_ON}, -// {"KN_PARAM_MIP_HEUR_DIVING", KN_PARAM_MIP_HEUR_DIVING}, -// {"KN_PARAM_MIP_CUTTINGPLANE", KN_PARAM_MIP_CUTTINGPLANE}, -// {"KN_MIP_CUTTINGPLANE_NONE", KN_MIP_CUTTINGPLANE_NONE}, -// {"KN_MIP_CUTTINGPLANE_ROOT", KN_MIP_CUTTINGPLANE_ROOT}, -// {"KN_PARAM_MIP_CUTOFF", KN_PARAM_MIP_CUTOFF}, -// {"KN_PARAM_MIP_HEUR_LNS", KN_PARAM_MIP_HEUR_LNS}, -// {"KN_PARAM_MIP_MULTISTART", KN_PARAM_MIP_MULTISTART}, -// {"KN_MIP_MULTISTART_OFF", KN_MIP_MULTISTART_OFF}, -// {"KN_MIP_MULTISTART_ON", KN_MIP_MULTISTART_ON}, -// {"KN_PARAM_MIP_LIFTPROJECT", KN_PARAM_MIP_LIFTPROJECT}, -// {"KN_MIP_LIFTPROJECT_AUTO", KN_MIP_LIFTPROJECT_AUTO}, -// {"KN_MIP_LIFTPROJECT_NONE", KN_MIP_LIFTPROJECT_NONE}, -// {"KN_MIP_LIFTPROJECT_ROOT", KN_MIP_LIFTPROJECT_ROOT}, -// {"KN_PARAM_MIP_NUMTHREADS", KN_PARAM_MIP_NUMTHREADS}, -// {"KN_PARAM_MIP_HEUR_MISQP", KN_PARAM_MIP_HEUR_MISQP}, -// {"KN_MIP_HEUR_MISQP_AUTO", KN_MIP_HEUR_MISQP_AUTO}, -// {"KN_MIP_HEUR_MISQP_OFF", KN_MIP_HEUR_MISQP_OFF}, -// {"KN_MIP_HEUR_MISQP_ON", KN_MIP_HEUR_MISQP_ON}, -// {"KN_PARAM_MIP_RESTART", KN_PARAM_MIP_RESTART}, -// {"KN_MIP_RESTART_OFF", KN_MIP_RESTART_OFF}, -// {"KN_MIP_RESTART_ON", KN_MIP_RESTART_ON}, -// {"KN_PARAM_MIP_GOMORY", KN_PARAM_MIP_GOMORY}, -// {"KN_MIP_GOMORY_AUTO", KN_MIP_GOMORY_AUTO}, -// {"KN_MIP_GOMORY_NONE", KN_MIP_GOMORY_NONE}, -// {"KN_MIP_GOMORY_ROOT", KN_MIP_GOMORY_ROOT}, -// {"KN_MIP_GOMORY_TREE", KN_MIP_GOMORY_TREE}, -// {"KN_PARAM_MIP_CUT_PROBING", KN_PARAM_MIP_CUT_PROBING}, -// {"KN_MIP_CUT_PROBING_AUTO", KN_MIP_CUT_PROBING_AUTO}, -// {"KN_MIP_CUT_PROBING_NONE", KN_MIP_CUT_PROBING_NONE}, -// {"KN_MIP_CUT_PROBING_ROOT", KN_MIP_CUT_PROBING_ROOT}, -// {"KN_MIP_CUT_PROBING_TREE", KN_MIP_CUT_PROBING_TREE}, -// {"KN_PARAM_MIP_CUT_FLOWCOVER", KN_PARAM_MIP_CUT_FLOWCOVER}, -// {"KN_MIP_CUT_FLOWCOVER_AUTO", KN_MIP_CUT_FLOWCOVER_AUTO}, -// {"KN_MIP_CUT_FLOWCOVER_NONE", KN_MIP_CUT_FLOWCOVER_NONE}, -// {"KN_MIP_CUT_FLOWCOVER_ROOT", KN_MIP_CUT_FLOWCOVER_ROOT}, -// {"KN_MIP_CUT_FLOWCOVER_TREE", KN_MIP_CUT_FLOWCOVER_TREE}, -// {"KN_PARAM_MIP_HEUR_LOCALSEARCH", KN_PARAM_MIP_HEUR_LOCALSEARCH}, -// {"KN_MIP_HEUR_LOCALSEARCH_AUTO", KN_MIP_HEUR_LOCALSEARCH_AUTO}, -// {"KN_MIP_HEUR_LOCALSEARCH_OFF", KN_MIP_HEUR_LOCALSEARCH_OFF}, -// {"KN_MIP_HEUR_LOCALSEARCH_ON", KN_MIP_HEUR_LOCALSEARCH_ON}, -// {"KN_PARAM_PAR_NUMTHREADS", KN_PARAM_PAR_NUMTHREADS}, -// {"KN_PARAM_PAR_CONCURRENT_EVALS", KN_PARAM_PAR_CONCURRENT_EVALS}, -// {"KN_PAR_CONCURRENT_EVALS_NO", KN_PAR_CONCURRENT_EVALS_NO}, -// {"KN_PAR_CONCURRENT_EVALS_YES", KN_PAR_CONCURRENT_EVALS_YES}, -// {"KN_PARAM_PAR_BLASNUMTHREADS", KN_PARAM_PAR_BLASNUMTHREADS}, -// {"KN_PARAM_PAR_LSNUMTHREADS", KN_PARAM_PAR_LSNUMTHREADS}, -// {"KN_PARAM_PAR_MSNUMTHREADS", KN_PARAM_PAR_MSNUMTHREADS}, -// {"KN_PAR_MSNUMTHREADS_AUTO", KN_PAR_MSNUMTHREADS_AUTO}, -// {"KN_PARAM_PAR_CONICNUMTHREADS", KN_PARAM_PAR_CONICNUMTHREADS}, -// }; -// return mapControls; -// } +static std::map& getMapParam() { + static std::map mapControls = { + {"KN_PARAM_NEWPOINT", KN_PARAM_NEWPOINT}, + {"KN_PARAM_HONORBNDS", KN_PARAM_HONORBNDS}, + {"KN_PARAM_ALGORITHM", KN_PARAM_ALGORITHM}, + {"KN_PARAM_ALG", KN_PARAM_ALG}, + {"KN_PARAM_BAR_MURULE", KN_PARAM_BAR_MURULE}, + {"KN_PARAM_BAR_FEASIBLE", KN_PARAM_BAR_FEASIBLE}, + {"KN_PARAM_GRADOPT", KN_PARAM_GRADOPT}, + {"KN_PARAM_HESSOPT", KN_PARAM_HESSOPT}, + {"KN_PARAM_BAR_INITPT", KN_PARAM_BAR_INITPT}, + {"KN_PARAM_ACT_LPSOLVER", KN_PARAM_ACT_LPSOLVER}, + {"KN_PARAM_CG_MAXIT", KN_PARAM_CG_MAXIT}, + {"KN_PARAM_MAXIT", KN_PARAM_MAXIT}, + {"KN_PARAM_OUTLEV", KN_PARAM_OUTLEV}, + {"KN_PARAM_OUTMODE", KN_PARAM_OUTMODE}, + {"KN_PARAM_SCALE", KN_PARAM_SCALE}, + {"KN_PARAM_SOC", KN_PARAM_SOC}, + {"KN_PARAM_DELTA", KN_PARAM_DELTA}, + {"KN_PARAM_BAR_FEASMODETOL", KN_PARAM_BAR_FEASMODETOL}, + {"KN_PARAM_FEASTOL", KN_PARAM_FEASTOL}, + {"KN_PARAM_FEASTOLABS", KN_PARAM_FEASTOLABS}, + {"KN_PARAM_MAXTIMECPU", KN_PARAM_MAXTIMECPU}, + {"KN_PARAM_BAR_INITMU", KN_PARAM_BAR_INITMU}, + {"KN_PARAM_OBJRANGE", KN_PARAM_OBJRANGE}, + {"KN_PARAM_OPTTOL", KN_PARAM_OPTTOL}, + {"KN_PARAM_OPTTOLABS", KN_PARAM_OPTTOLABS}, + {"KN_PARAM_LINSOLVER_PIVOTTOL", KN_PARAM_LINSOLVER_PIVOTTOL}, + {"KN_PARAM_XTOL", KN_PARAM_XTOL}, + {"KN_PARAM_DEBUG", KN_PARAM_DEBUG}, + {"KN_PARAM_MULTISTART", KN_PARAM_MULTISTART}, + {"KN_PARAM_MSENABLE", KN_PARAM_MSENABLE}, + {"KN_PARAM_MS_ENABLE", KN_PARAM_MS_ENABLE}, + {"KN_PARAM_MSMAXSOLVES", KN_PARAM_MSMAXSOLVES}, + {"KN_PARAM_MS_MAXSOLVES", KN_PARAM_MS_MAXSOLVES}, + {"KN_PARAM_MSMAXBNDRANGE", KN_PARAM_MSMAXBNDRANGE}, + {"KN_PARAM_MS_MAXBNDRANGE", KN_PARAM_MS_MAXBNDRANGE}, + {"KN_PARAM_MSMAXTIMECPU", KN_PARAM_MSMAXTIMECPU}, + {"KN_PARAM_MS_MAXTIMECPU", KN_PARAM_MS_MAXTIMECPU}, + {"KN_PARAM_MSMAXTIMEREAL", KN_PARAM_MSMAXTIMEREAL}, + {"KN_PARAM_MS_MAXTIMEREAL", KN_PARAM_MS_MAXTIMEREAL}, + {"KN_PARAM_LMSIZE", KN_PARAM_LMSIZE}, + {"KN_PARAM_BAR_MAXCROSSIT", KN_PARAM_BAR_MAXCROSSIT}, + {"KN_PARAM_MAXTIMEREAL", KN_PARAM_MAXTIMEREAL}, + {"KN_PARAM_CG_PRECOND", KN_PARAM_CG_PRECOND}, + {"KN_PARAM_BLASOPTION", KN_PARAM_BLASOPTION}, + {"KN_PARAM_BAR_MAXREFACTOR", KN_PARAM_BAR_MAXREFACTOR}, + {"KN_PARAM_LINESEARCH_MAXTRIALS", KN_PARAM_LINESEARCH_MAXTRIALS}, + {"KN_PARAM_BLASOPTIONLIB", KN_PARAM_BLASOPTIONLIB}, + {"KN_PARAM_OUTAPPEND", KN_PARAM_OUTAPPEND}, + {"KN_PARAM_OUTDIR", KN_PARAM_OUTDIR}, + {"KN_PARAM_CPLEXLIB", KN_PARAM_CPLEXLIB}, + {"KN_PARAM_BAR_PENRULE", KN_PARAM_BAR_PENRULE}, + {"KN_PARAM_BAR_PENCONS", KN_PARAM_BAR_PENCONS}, + {"KN_PARAM_MSNUMTOSAVE", KN_PARAM_MSNUMTOSAVE}, + {"KN_PARAM_MS_NUMTOSAVE", KN_PARAM_MS_NUMTOSAVE}, + {"KN_PARAM_MSSAVETOL", KN_PARAM_MSSAVETOL}, + {"KN_PARAM_MS_SAVETOL", KN_PARAM_MS_SAVETOL}, + {"KN_PARAM_PRESOLVEDEBUG", KN_PARAM_PRESOLVEDEBUG}, + {"KN_PARAM_MSTERMINATE", KN_PARAM_MSTERMINATE}, + {"KN_PARAM_MS_TERMINATE", KN_PARAM_MS_TERMINATE}, + {"KN_PARAM_MSSTARTPTRANGE", KN_PARAM_MSSTARTPTRANGE}, + {"KN_PARAM_MS_STARTPTRANGE", KN_PARAM_MS_STARTPTRANGE}, + {"KN_PARAM_INFEASTOL", KN_PARAM_INFEASTOL}, + {"KN_PARAM_LINSOLVER", KN_PARAM_LINSOLVER}, + {"KN_PARAM_BAR_DIRECTINTERVAL", KN_PARAM_BAR_DIRECTINTERVAL}, + {"KN_PARAM_PRESOLVE", KN_PARAM_PRESOLVE}, + {"KN_PARAM_PRESOLVE_TOL", KN_PARAM_PRESOLVE_TOL}, + {"KN_PARAM_BAR_SWITCHRULE", KN_PARAM_BAR_SWITCHRULE}, + {"KN_PARAM_HESSIAN_NO_F", KN_PARAM_HESSIAN_NO_F}, + {"KN_PARAM_MA_TERMINATE", KN_PARAM_MA_TERMINATE}, + {"KN_PARAM_MA_MAXTIMECPU", KN_PARAM_MA_MAXTIMECPU}, + {"KN_PARAM_MA_MAXTIMEREAL", KN_PARAM_MA_MAXTIMEREAL}, + {"KN_PARAM_MSSEED", KN_PARAM_MSSEED}, + {"KN_PARAM_MS_SEED", KN_PARAM_MS_SEED}, + {"KN_PARAM_MA_OUTSUB", KN_PARAM_MA_OUTSUB}, + {"KN_PARAM_MS_OUTSUB", KN_PARAM_MS_OUTSUB}, + {"KN_PARAM_XPRESSLIB", KN_PARAM_XPRESSLIB}, + {"KN_PARAM_TUNER", KN_PARAM_TUNER}, + {"KN_PARAM_TUNER_OPTIONSFILE", KN_PARAM_TUNER_OPTIONSFILE}, + {"KN_PARAM_TUNER_MAXTIMECPU", KN_PARAM_TUNER_MAXTIMECPU}, + {"KN_PARAM_TUNER_MAXTIMEREAL", KN_PARAM_TUNER_MAXTIMEREAL}, + {"KN_PARAM_TUNER_OUTSUB", KN_PARAM_TUNER_OUTSUB}, + {"KN_PARAM_TUNER_TERMINATE", KN_PARAM_TUNER_TERMINATE}, + {"KN_PARAM_LINSOLVER_OOC", KN_PARAM_LINSOLVER_OOC}, + {"KN_PARAM_BAR_RELAXCONS", KN_PARAM_BAR_RELAXCONS}, + {"KN_PARAM_MSDETERMINISTIC", KN_PARAM_MSDETERMINISTIC}, + {"KN_PARAM_MS_DETERMINISTIC", KN_PARAM_MS_DETERMINISTIC}, + {"KN_PARAM_BAR_REFINEMENT", KN_PARAM_BAR_REFINEMENT}, + {"KN_PARAM_DERIVCHECK", KN_PARAM_DERIVCHECK}, + {"KN_PARAM_DERIVCHECK_TYPE", KN_PARAM_DERIVCHECK_TYPE}, + {"KN_PARAM_DERIVCHECK_TOL", KN_PARAM_DERIVCHECK_TOL}, + {"KN_PARAM_LINSOLVER_INEXACT", KN_PARAM_LINSOLVER_INEXACT}, + {"KN_PARAM_LINSOLVER_INEXACTTOL", KN_PARAM_LINSOLVER_INEXACTTOL}, + {"KN_PARAM_MAXFEVALS", KN_PARAM_MAXFEVALS}, + {"KN_PARAM_FSTOPVAL", KN_PARAM_FSTOPVAL}, + {"KN_PARAM_DATACHECK", KN_PARAM_DATACHECK}, + {"KN_PARAM_DERIVCHECK_TERMINATE", KN_PARAM_DERIVCHECK_TERMINATE}, + {"KN_PARAM_BAR_WATCHDOG", KN_PARAM_BAR_WATCHDOG}, + {"KN_PARAM_FTOL", KN_PARAM_FTOL}, + {"KN_PARAM_FTOL_ITERS", KN_PARAM_FTOL_ITERS}, + {"KN_PARAM_ACT_QPALG", KN_PARAM_ACT_QPALG}, + {"KN_PARAM_BAR_INITPI_MPEC", KN_PARAM_BAR_INITPI_MPEC}, + {"KN_PARAM_XTOL_ITERS", KN_PARAM_XTOL_ITERS}, + {"KN_PARAM_LINESEARCH", KN_PARAM_LINESEARCH}, + {"KN_PARAM_OUT_CSVINFO", KN_PARAM_OUT_CSVINFO}, + {"KN_PARAM_INITPENALTY", KN_PARAM_INITPENALTY}, + {"KN_PARAM_ACT_LPFEASTOL", KN_PARAM_ACT_LPFEASTOL}, + {"KN_PARAM_CG_STOPTOL", KN_PARAM_CG_STOPTOL}, + {"KN_PARAM_RESTARTS", KN_PARAM_RESTARTS}, + {"KN_PARAM_RESTARTS_MAXIT", KN_PARAM_RESTARTS_MAXIT}, + {"KN_PARAM_BAR_SLACKBOUNDPUSH", KN_PARAM_BAR_SLACKBOUNDPUSH}, + {"KN_PARAM_CG_PMEM", KN_PARAM_CG_PMEM}, + {"KN_PARAM_BAR_SWITCHOBJ", KN_PARAM_BAR_SWITCHOBJ}, + {"KN_PARAM_OUTNAME", KN_PARAM_OUTNAME}, + {"KN_PARAM_OUT_CSVNAME", KN_PARAM_OUT_CSVNAME}, + {"KN_PARAM_ACT_PARAMETRIC", KN_PARAM_ACT_PARAMETRIC}, + {"KN_PARAM_ACT_LPDUMPMPS", KN_PARAM_ACT_LPDUMPMPS}, + {"KN_PARAM_ACT_LPALG", KN_PARAM_ACT_LPALG}, + {"KN_PARAM_ACT_LPPRESOLVE", KN_PARAM_ACT_LPPRESOLVE}, + {"KN_PARAM_ACT_LPPENALTY", KN_PARAM_ACT_LPPENALTY}, + {"KN_PARAM_BNDRANGE", KN_PARAM_BNDRANGE}, + {"KN_PARAM_BAR_CONIC_ENABLE", KN_PARAM_BAR_CONIC_ENABLE}, + {"KN_PARAM_CONVEX", KN_PARAM_CONVEX}, + {"KN_PARAM_OUT_HINTS", KN_PARAM_OUT_HINTS}, + {"KN_PARAM_EVAL_FCGA", KN_PARAM_EVAL_FCGA}, + {"KN_PARAM_BAR_MAXCORRECTORS", KN_PARAM_BAR_MAXCORRECTORS}, + {"KN_PARAM_STRAT_WARM_START", KN_PARAM_STRAT_WARM_START}, + {"KN_PARAM_FINDIFF_TERMINATE", KN_PARAM_FINDIFF_TERMINATE}, + {"KN_PARAM_CPUPLATFORM", KN_PARAM_CPUPLATFORM}, + {"KN_PARAM_PRESOLVE_PASSES", KN_PARAM_PRESOLVE_PASSES}, + {"KN_PARAM_PRESOLVE_LEVEL", KN_PARAM_PRESOLVE_LEVEL}, + {"KN_PARAM_FINDIFF_RELSTEPSIZE", KN_PARAM_FINDIFF_RELSTEPSIZE}, + {"KN_PARAM_INFEASTOL_ITERS", KN_PARAM_INFEASTOL_ITERS}, + {"KN_PARAM_PRESOLVEOP_TIGHTEN", KN_PARAM_PRESOLVEOP_TIGHTEN}, + {"KN_PARAM_BAR_LINSYS", KN_PARAM_BAR_LINSYS}, + {"KN_PARAM_PRESOLVE_INITPT", KN_PARAM_PRESOLVE_INITPT}, + {"KN_PARAM_ACT_QPPENALTY", KN_PARAM_ACT_QPPENALTY}, + {"KN_PARAM_BAR_LINSYS_STORAGE", KN_PARAM_BAR_LINSYS_STORAGE}, + {"KN_PARAM_LINSOLVER_MAXITREF", KN_PARAM_LINSOLVER_MAXITREF}, + {"KN_PARAM_BFGS_SCALING", KN_PARAM_BFGS_SCALING}, + {"KN_PARAM_BAR_INITSHIFTTOL", KN_PARAM_BAR_INITSHIFTTOL}, + {"KN_PARAM_NUMTHREADS", KN_PARAM_NUMTHREADS}, + {"KN_PARAM_CONCURRENT_EVALS", KN_PARAM_CONCURRENT_EVALS}, + {"KN_PARAM_BLAS_NUMTHREADS", KN_PARAM_BLAS_NUMTHREADS}, + {"KN_PARAM_LINSOLVER_NUMTHREADS", KN_PARAM_LINSOLVER_NUMTHREADS}, + {"KN_PARAM_MS_NUMTHREADS", KN_PARAM_MS_NUMTHREADS}, + {"KN_PARAM_CONIC_NUMTHREADS", KN_PARAM_CONIC_NUMTHREADS}, + {"KN_PARAM_NCVX_QCQP_INIT", KN_PARAM_NCVX_QCQP_INIT}, + {"KN_PARAM_FINDIFF_ESTNOISE", KN_PARAM_FINDIFF_ESTNOISE}, + {"KN_PARAM_FINDIFF_NUMTHREADS", KN_PARAM_FINDIFF_NUMTHREADS}, + {"KN_PARAM_BAR_MPEC_HEURISTIC", KN_PARAM_BAR_MPEC_HEURISTIC}, + {"KN_PARAM_PRESOLVEOP_REDUNDANT", KN_PARAM_PRESOLVEOP_REDUNDANT}, + {"KN_PARAM_LINSOLVER_ORDERING", KN_PARAM_LINSOLVER_ORDERING}, + {"KN_PARAM_LINSOLVER_NODEAMALG", KN_PARAM_LINSOLVER_NODEAMALG}, + {"KN_PARAM_PRESOLVEOP_SUBSTITUTION", KN_PARAM_PRESOLVEOP_SUBSTITUTION}, + {"KN_PARAM_PRESOLVEOP_SUBSTITUTION_TOL", + KN_PARAM_PRESOLVEOP_SUBSTITUTION_TOL}, + {"KN_PARAM_MS_INITPT_CLUSTER", KN_PARAM_MS_INITPT_CLUSTER}, + {"KN_PARAM_SCALE_VARS", KN_PARAM_SCALE_VARS}, + {"KN_PARAM_BAR_MAXMU", KN_PARAM_BAR_MAXMU}, + {"KN_PARAM_BAR_GLOBALIZE", KN_PARAM_BAR_GLOBALIZE}, + {"KN_PARAM_LINSOLVER_SCALING", KN_PARAM_LINSOLVER_SCALING}, + {"KN_PARAM_MIP_METHOD", KN_PARAM_MIP_METHOD}, + {"KN_PARAM_MIP_BRANCHRULE", KN_PARAM_MIP_BRANCHRULE}, + {"KN_PARAM_MIP_SELECTRULE", KN_PARAM_MIP_SELECTRULE}, + {"KN_PARAM_MIP_INTGAPABS", KN_PARAM_MIP_INTGAPABS}, + {"KN_PARAM_MIP_OPTGAPABS", KN_PARAM_MIP_OPTGAPABS}, + {"KN_PARAM_MIP_INTGAPREL", KN_PARAM_MIP_INTGAPREL}, + {"KN_PARAM_MIP_OPTGAPREL", KN_PARAM_MIP_OPTGAPREL}, + {"KN_PARAM_MIP_MAXTIMECPU", KN_PARAM_MIP_MAXTIMECPU}, + {"KN_PARAM_MIP_MAXTIMEREAL", KN_PARAM_MIP_MAXTIMEREAL}, + {"KN_PARAM_MIP_MAXSOLVES", KN_PARAM_MIP_MAXSOLVES}, + {"KN_PARAM_MIP_INTEGERTOL", KN_PARAM_MIP_INTEGERTOL}, + {"KN_PARAM_MIP_OUTLEVEL", KN_PARAM_MIP_OUTLEVEL}, + {"KN_PARAM_MIP_OUTINTERVAL", KN_PARAM_MIP_OUTINTERVAL}, + {"KN_PARAM_MIP_OUTSUB", KN_PARAM_MIP_OUTSUB}, + {"KN_PARAM_MIP_DEBUG", KN_PARAM_MIP_DEBUG}, + {"KN_PARAM_MIP_IMPLICATNS", KN_PARAM_MIP_IMPLICATNS}, + {"KN_PARAM_MIP_IMPLICATIONS", KN_PARAM_MIP_IMPLICATIONS}, + {"KN_PARAM_MIP_GUB_BRANCH", KN_PARAM_MIP_GUB_BRANCH}, + {"KN_PARAM_MIP_KNAPSACK", KN_PARAM_MIP_KNAPSACK}, + {"KN_PARAM_MIP_ROUNDING", KN_PARAM_MIP_ROUNDING}, + {"KN_PARAM_MIP_ROOTALG", KN_PARAM_MIP_ROOTALG}, + {"KN_PARAM_MIP_LPALG", KN_PARAM_MIP_LPALG}, + {"KN_PARAM_MIP_TERMINATE", KN_PARAM_MIP_TERMINATE}, + {"KN_PARAM_MIP_MAXNODES", KN_PARAM_MIP_MAXNODES}, + {"KN_PARAM_MIP_HEURISTIC", KN_PARAM_MIP_HEURISTIC}, + {"KN_PARAM_MIP_HEUR_MAXIT", KN_PARAM_MIP_HEUR_MAXIT}, + {"KN_PARAM_MIP_HEUR_MAXTIMECPU", KN_PARAM_MIP_HEUR_MAXTIMECPU}, + {"KN_PARAM_MIP_HEUR_MAXTIMEREAL", KN_PARAM_MIP_HEUR_MAXTIMEREAL}, + {"KN_PARAM_MIP_PSEUDOINIT", KN_PARAM_MIP_PSEUDOINIT}, + {"KN_PARAM_MIP_STRONG_MAXIT", KN_PARAM_MIP_STRONG_MAXIT}, + {"KN_PARAM_MIP_STRONG_CANDLIM", KN_PARAM_MIP_STRONG_CANDLIM}, + {"KN_PARAM_MIP_STRONG_LEVEL", KN_PARAM_MIP_STRONG_LEVEL}, + {"KN_PARAM_MIP_INTVAR_STRATEGY", KN_PARAM_MIP_INTVAR_STRATEGY}, + {"KN_PARAM_MIP_RELAXABLE", KN_PARAM_MIP_RELAXABLE}, + {"KN_PARAM_MIP_NODEALG", KN_PARAM_MIP_NODEALG}, + {"KN_PARAM_MIP_HEUR_TERMINATE", KN_PARAM_MIP_HEUR_TERMINATE}, + {"KN_PARAM_MIP_SELECTDIR", KN_PARAM_MIP_SELECTDIR}, + {"KN_PARAM_MIP_CUTFACTOR", KN_PARAM_MIP_CUTFACTOR}, + {"KN_PARAM_MIP_ZEROHALF", KN_PARAM_MIP_ZEROHALF}, + {"KN_PARAM_MIP_MIR", KN_PARAM_MIP_MIR}, + {"KN_PARAM_MIP_CLIQUE", KN_PARAM_MIP_CLIQUE}, + {"KN_PARAM_MIP_HEUR_STRATEGY", KN_PARAM_MIP_HEUR_STRATEGY}, + {"KN_PARAM_MIP_HEUR_FEASPUMP", KN_PARAM_MIP_HEUR_FEASPUMP}, + {"KN_PARAM_MIP_HEUR_MPEC", KN_PARAM_MIP_HEUR_MPEC}, + {"KN_PARAM_MIP_HEUR_DIVING", KN_PARAM_MIP_HEUR_DIVING}, + {"KN_PARAM_MIP_CUTTINGPLANE", KN_PARAM_MIP_CUTTINGPLANE}, + {"KN_PARAM_MIP_CUTOFF", KN_PARAM_MIP_CUTOFF}, + {"KN_PARAM_MIP_HEUR_LNS", KN_PARAM_MIP_HEUR_LNS}, + {"KN_PARAM_MIP_MULTISTART", KN_PARAM_MIP_MULTISTART}, + {"KN_PARAM_MIP_LIFTPROJECT", KN_PARAM_MIP_LIFTPROJECT}, + {"KN_PARAM_MIP_NUMTHREADS", KN_PARAM_MIP_NUMTHREADS}, + {"KN_PARAM_MIP_HEUR_MISQP", KN_PARAM_MIP_HEUR_MISQP}, + {"KN_PARAM_MIP_RESTART", KN_PARAM_MIP_RESTART}, + {"KN_PARAM_MIP_GOMORY", KN_PARAM_MIP_GOMORY}, + {"KN_PARAM_MIP_CUT_PROBING", KN_PARAM_MIP_CUT_PROBING}, + {"KN_PARAM_MIP_CUT_FLOWCOVER", KN_PARAM_MIP_CUT_FLOWCOVER}, + {"KN_PARAM_MIP_HEUR_LOCALSEARCH", KN_PARAM_MIP_HEUR_LOCALSEARCH}, + {"KN_PARAM_PAR_NUMTHREADS", KN_PARAM_PAR_NUMTHREADS}, + {"KN_PARAM_PAR_CONCURRENT_EVALS", KN_PARAM_PAR_CONCURRENT_EVALS}, + {"KN_PARAM_PAR_BLASNUMTHREADS", KN_PARAM_PAR_BLASNUMTHREADS}, + {"KN_PARAM_PAR_LSNUMTHREADS", KN_PARAM_PAR_LSNUMTHREADS}, + {"KN_PARAM_PAR_MSNUMTHREADS", KN_PARAM_PAR_MSNUMTHREADS}, + {"KN_PARAM_PAR_CONICNUMTHREADS", KN_PARAM_PAR_CONICNUMTHREADS}, + }; + return mapControls; +} /*------------KnitroInterface Definition------------*/ @@ -764,7 +358,7 @@ class KnitroInterface : public MPSolverInterface { bool mip_; bool no_obj_; MPCallback* callback_ = nullptr; - // std::map param_map_; + std::map param_map_; }; /*------------Knitro CallBack Context------------*/ @@ -892,7 +486,7 @@ int KNITRO_API CallBackFn(KN_context_ptr kc, const double* const x, /*------------Knitro Interface Implem ------------*/ KnitroInterface::KnitroInterface(MPSolver* solver, bool mip) - : MPSolverInterface(solver), kc_(nullptr), mip_(mip), no_obj_(true) { + : MPSolverInterface(solver), kc_(nullptr), mip_(mip), no_obj_(true), param_map_(getMapParam()) { KnitroIsCorrectlyInstalled(); CHECK_STATUS(KN_new(&kc_)); } @@ -1098,8 +692,8 @@ void KnitroInterface::ExtractNewVariables() { // } // delete[] ptr; // }; - // std::unique_ptr names(new char*[len], deleter); - // for priority properties + // std::unique_ptr names(new char*[len], + // deleter); for priority properties std::unique_ptr prior(new int[len]); std::unique_ptr prior_idx(new int[len]); int prior_nb = 0; @@ -1171,7 +765,8 @@ void KnitroInterface::ExtractNewConstraints() { // } // delete[] ptr; // }; - // std::unique_ptr names(new char*[len], deleter); + // std::unique_ptr names(new char*[len], + // deleter); std::cout << "Constraints' Containers created" << std::endl; int idx_lin_term = 0; // Define new constraints @@ -1259,17 +854,19 @@ void KnitroInterface::SetParameters(const MPSolverParameters& param) { if (mip_) SetMIPParameters(param); } -#define setParamIfPossible_MACRO(target_map, setter, converter) \ - { \ - auto matchingParamIter = (target_map).find(paramAndValuePair.first); \ - if (matchingParamIter != (target_map).end()) { \ - const auto convertedValue = converter(paramAndValuePair.second); \ - VLOG(1) << "Setting parameter " << paramAndValuePair.first \ - << " to value " << convertedValue << std::endl; \ - setter(mLp, matchingParamIter->second, convertedValue); \ - continue; \ - } \ +// Save the existing locale, use the "C" locale to ensure that +// string -> double conversion is done ignoring the locale. +struct ScopedLocale { + ScopedLocale() { + oldLocale = std::setlocale(LC_NUMERIC, nullptr); + auto newLocale = std::setlocale(LC_NUMERIC, "C"); + CHECK_EQ(std::string(newLocale), "C"); } + ~ScopedLocale() { std::setlocale(LC_NUMERIC, oldLocale); } + + private: + const char* oldLocale; +}; bool KnitroInterface::SetSolverSpecificParametersAsString( const std::string& parameters) { @@ -1277,38 +874,45 @@ bool KnitroInterface::SetSolverSpecificParametersAsString( return true; } - // std::vector > paramAndValuePairList; - - // std::stringstream ss(parameters); - // std::string paramName; - // while (std::getline(ss, paramName, ' ')) { - // std::string paramValue; - // if (std::getline(ss, paramValue, ' ')) { - // paramAndValuePairList.push_back(std::make_pair(paramName, paramValue)); - // } else { - // LOG(ERROR) << "No value for parameter " << paramName << " : function " - // << __FUNCTION__ << std::endl; - // return false; - // } - // } + std::vector > paramAndValuePairList; - // ScopedLocale locale; - // for (auto& paramAndValuePair : paramAndValuePairList) { - // setParamIfPossible_MACRO(mapIntegerControls_, XPRSsetintcontrol, std::stoi); - // setParamIfPossible_MACRO(mapDoubleControls_, XPRSsetdblcontrol, std::stod); - // setParamIfPossible_MACRO(mapStringControls_, XPRSsetstrcontrol, - // stringToCharPtr); - // setParamIfPossible_MACRO(mapInteger64Controls_, XPRSsetintcontrol64, - // std::stoll); - // LOG(ERROR) << "Unknown parameter " << paramName << " : function " - // << __FUNCTION__ << std::endl; - // return false; - // } - // return true; - if (KN_load_param_file(kc_, parameters.c_str()) == 0) { - return true; + std::stringstream ss(parameters); + std::string paramName; + while (std::getline(ss, paramName, ' ')) { + std::string paramValue; + if (std::getline(ss, paramValue, ' ')) { + paramAndValuePairList.push_back(std::make_pair(paramName, paramValue)); + } else { + LOG(ERROR) << "No value for parameter " << paramName << " : function " + << __FUNCTION__ << std::endl; + return false; + } + } + + ScopedLocale locale; + for (auto& paramAndValuePair : paramAndValuePairList) { + auto matchingParamIter = param_map_.find(paramAndValuePair.first); + if (matchingParamIter != param_map_.end()) { + int param_id = param_map_[paramAndValuePair.first], param_type = 0; + KN_get_param_type(kc_, param_id, ¶m_type); + switch (param_type){ + case KN_PARAMTYPE_INTEGER: + KN_set_int_param(kc_, param_id, std::stoi(paramAndValuePair.second)); + break; + case KN_PARAMTYPE_FLOAT: + KN_set_double_param(kc_, param_id, std::stod(paramAndValuePair.second)); + break; + case KN_PARAMTYPE_STRING: + KN_set_char_param(kc_, param_id, paramAndValuePair.second.c_str()); + break; + } + continue; + } + LOG(ERROR) << "Unknown parameter " << paramName << " : function " + << __FUNCTION__ << std::endl; + return false; } - return false; + return true; } void KnitroInterface::SetRelativeMipGap(double value) {