text:
# This list was obtained through AWK with Cplex 12.51 (and then pared down):
#
# grep "#define" cpxconst.h | awk '{ printf("const %s = convert(Cint,%s)\n",$2,$3) }'

const CPX_FEATURES_H = convert(Cint,1)
#const CPX_INTWIDTH_H = convert(Cint,)
#const CPX_PUBCONST_H = convert(Cint,)
#const CPXPUBLIC = convert(Cint,__stdcall)
#const CPXPUBVARARGS = convert(Cint,__cdecl)
#const CPXCDECL = convert(Cint,__cdecl)
#const CPXPUBLIC = convert(Cint,)
#const CPXPUBVARARGS = convert(Cint,)
#const CPXCDECL = convert(Cint,)
const CPX_STR_PARAM_MAX = convert(Cint,512)
#const __PUBTYPE_H = convert(Cint,)
#const CALLBACK_BRANCH_ARGS = convert(Cint,CPXCENVptr)
#const CALLBACK_NODE_ARGS = convert(Cint,CPXCENVptr)
#const CALLBACK_HEURISTIC_ARGS = convert(Cint,CPXCENVptr)
#const CALLBACK_SOLVE_ARGS = convert(Cint,CPXCENVptr)
#const CALLBACK_CUT_ARGS = convert(Cint,CPXCENVptr)
#const CALLBACK_INCUMBENT_ARGS = convert(Cint,CPXCENVptr)
#const CALLBACK_DELETENODE_ARGS = convert(Cint,CPXCENVptr)
#const CPX_CPLEXCONSTANTS_H = convert(Cint,)
const CPX_VERSION = convert(Cint,12060200)
const CPX_VERSION_VERSION = convert(Cint,12)
const CPX_VERSION_RELEASE = convert(Cint,6)
const CPX_VERSION_MODIFICATION = convert(Cint,2)
const CPX_VERSION_FIX = convert(Cint,0)
#const CPX_VERSIONSTRING = convert(Cint,"@(#)Licensed)
#const CPX_VERSIONSTRING = convert(Cint,"@(#)Licensed)
const CPX_INFBOUND = convert(Cdouble,1.0E+20)
const CPX_PARAMTYPE_NONE = convert(Cint,0)
const CPX_PARAMTYPE_INT = convert(Cint,1)
const CPX_PARAMTYPE_DOUBLE = convert(Cint,2)
const CPX_PARAMTYPE_STRING = convert(Cint,3)
const CPX_PARAMTYPE_LONG = convert(Cint,4)
const CPX_NO_SOLN = convert(Cint,0)
const CPX_AUTO_SOLN = convert(Cint,0)
const CPX_BASIC_SOLN = convert(Cint,1)
const CPX_NONBASIC_SOLN = convert(Cint,2)
const CPX_PRIMAL_SOLN = convert(Cint,3)
const CPX_PRECOL_LOW = convert(Cint,-1)
const CPX_PRECOL_UP = convert(Cint,-2)
const CPX_PRECOL_FIX = convert(Cint,-3)
const CPX_PRECOL_AGG = convert(Cint,-4)
const CPX_PRECOL_OTHER = convert(Cint,-5)
const CPX_PREROW_RED = convert(Cint,-1)
const CPX_PREROW_AGG = convert(Cint,-2)
const CPX_PREROW_OTHER = convert(Cint,-3)
const CPXERR_LICENSE_MIN = convert(Cint,32000)
const CPXERR_NO_MIP_LIC = convert(Cint,32301)
const CPXERR_NO_BARRIER_LIC = convert(Cint,32302)
const CPXERR_NO_MIQP_LIC = convert(Cint,32305)
const CPXERR_BADLDWID = convert(Cint,32018)
const CPXERR_LICENSE_MAX = convert(Cint,32999)
const CPX_AUTO = convert(Cint,-1)
const CPX_ON = convert(Cint,1)
const CPX_OFF = convert(Cint,0)
const CPX_MAX = convert(Cint,-1)
const CPX_MIN = convert(Cint,1)
const CPX_PPRIIND_PARTIAL = convert(Cint,-1)
const CPX_PPRIIND_AUTO = convert(Cint,0)
const CPX_PPRIIND_DEVEX = convert(Cint,1)
const CPX_PPRIIND_STEEP = convert(Cint,2)
const CPX_PPRIIND_STEEPQSTART = convert(Cint,3)
const CPX_PPRIIND_FULL = convert(Cint,4)
const CPX_DPRIIND_AUTO = convert(Cint,0)
const CPX_DPRIIND_FULL = convert(Cint,1)
const CPX_DPRIIND_STEEP = convert(Cint,2)
const CPX_DPRIIND_FULLSTEEP = convert(Cint,3)
const CPX_DPRIIND_STEEPQSTART = convert(Cint,4)
const CPX_DPRIIND_DEVEX = convert(Cint,5)
const CPX_PARALLEL_DETERMINISTIC = convert(Cint,1)
const CPX_PARALLEL_AUTO = convert(Cint,0)
const CPX_PARALLEL_OPPORTUNISTIC = convert(Cint,-1)
const CPX_WRITELEVEL_AUTO = convert(Cint,0)
const CPX_WRITELEVEL_ALLVARS = convert(Cint,1)
const CPX_WRITELEVEL_DISCRETEVARS = convert(Cint,2)
const CPX_WRITELEVEL_NONZEROVARS = convert(Cint,3)
const CPX_WRITELEVEL_NONZERODISCRETEVARS = convert(Cint,4)
const CPX_OPTIMALITYTARGET_AUTO = convert(Cint,0)
const CPX_OPTIMALITYTARGET_OPTIMALCONVEX = convert(Cint,1)
const CPX_OPTIMALITYTARGET_FIRSTORDER = convert(Cint,2)
const CPX_OPTIMALITYTARGET_OPTIMALGLOBAL = convert(Cint,3)
const CPX_SOLUTIONTARGET_AUTO = convert(Cint,0)
const CPX_SOLUTIONTARGET_OPTIMALCONVEX = convert(Cint,1)
const CPX_SOLUTIONTARGET_FIRSTORDER = convert(Cint,2)
const CPX_SOLUTIONTARGET_OPTIMALGLOBAL = convert(Cint,3)
const CPX_ALG_NONE = convert(Cint,-1)
const CPX_ALG_AUTOMATIC = convert(Cint,0)
const CPX_ALG_PRIMAL = convert(Cint,1)
const CPX_ALG_DUAL = convert(Cint,2)
const CPX_ALG_NET = convert(Cint,3)
const CPX_ALG_BARRIER = convert(Cint,4)
const CPX_ALG_SIFTING = convert(Cint,5)
const CPX_ALG_CONCURRENT = convert(Cint,6)
const CPX_ALG_BAROPT = convert(Cint,7)
const CPX_ALG_PIVOTIN = convert(Cint,8)
const CPX_ALG_PIVOTOUT = convert(Cint,9)
const CPX_ALG_PIVOT = convert(Cint,10)
const CPX_ALG_FEASOPT = convert(Cint,11)
const CPX_ALG_MIP = convert(Cint,12)
const CPX_ALG_ROBUST = convert(Cint,13)
const CPX_AT_LOWER = convert(Cint,0)
const CPX_BASIC = convert(Cint,1)
const CPX_AT_UPPER = convert(Cint,2)
const CPX_FREE_SUPER = convert(Cint,3)
const CPX_NO_VARIABLE = convert(Cint,2100000000)
const CPX_CONTINUOUS = convert(Cchar,'C')
const CPX_BINARY = convert(Cchar,'B')
const CPX_INTEGER = convert(Cchar,'I')
const CPX_SEMICONT = convert(Cchar,'S')
const CPX_SEMIINT = convert(Cchar,'N')
const CPX_PREREDUCE_PRIMALANDDUAL = convert(Cint,3)
const CPX_PREREDUCE_DUALONLY = convert(Cint,2)
const CPX_PREREDUCE_PRIMALONLY = convert(Cint,1)
const CPX_PREREDUCE_NOPRIMALORDUAL = convert(Cint,0)
const CPX_CONFLICT_EXCLUDED = convert(Cint,-1)
const CPX_CONFLICT_POSSIBLE_MEMBER = convert(Cint,0)
const CPX_CONFLICT_POSSIBLE_LB = convert(Cint,1)
const CPX_CONFLICT_POSSIBLE_UB = convert(Cint,2)
const CPX_CONFLICT_MEMBER = convert(Cint,3)
const CPX_CONFLICT_LB = convert(Cint,4)
const CPX_CONFLICT_UB = convert(Cint,5)
const CPX_CONFLICTALG_AUTO = convert(Cint,0)
const CPX_CONFLICTALG_FAST = convert(Cint,1)
const CPX_CONFLICTALG_PROPAGATE = convert(Cint,2)
const CPX_CONFLICTALG_PRESOLVE = convert(Cint,3)
const CPX_CONFLICTALG_IIS = convert(Cint,4)
const CPX_CONFLICTALG_LIMITSOLVE = convert(Cint,5)
const CPX_CONFLICTALG_SOLVE = convert(Cint,6)
const CPXPROB_LP = convert(Cint,0)
const CPXPROB_MILP = convert(Cint,1)
const CPXPROB_FIXEDMILP = convert(Cint,3)
const CPXPROB_NODELP = convert(Cint,4)
const CPXPROB_QP = convert(Cint,5)
const CPXPROB_MIQP = convert(Cint,7)
const CPXPROB_FIXEDMIQP = convert(Cint,8)
const CPXPROB_NODEQP = convert(Cint,9)
const CPXPROB_QCP = convert(Cint,10)
const CPXPROB_MIQCP = convert(Cint,11)
const CPXPROB_NODEQCP = convert(Cint,12)
const CPX_PARAM_ADVIND = convert(Cint,1001)
const CPX_PARAM_AGGFILL = convert(Cint,1002)
const CPX_PARAM_AGGIND = convert(Cint,1003)
const CPX_PARAM_CLOCKTYPE = convert(Cint,1006)
const CPX_PARAM_CRAIND = convert(Cint,1007)
const CPX_PARAM_DEPIND = convert(Cint,1008)
const CPX_PARAM_DPRIIND = convert(Cint,1009)
const CPX_PARAM_PRICELIM = convert(Cint,1010)
const CPX_PARAM_EPMRK = convert(Cint,1013)
const CPX_PARAM_EPOPT = convert(Cint,1014)
const CPX_PARAM_EPPER = convert(Cint,1015)
const CPX_PARAM_EPRHS = convert(Cint,1016)
const CPX_PARAM_SIMDISPLAY = convert(Cint,1019)
const CPX_PARAM_ITLIM = convert(Cint,1020)
const CPX_PARAM_ROWREADLIM = convert(Cint,1021)
const CPX_PARAM_NETFIND = convert(Cint,1022)
const CPX_PARAM_COLREADLIM = convert(Cint,1023)
const CPX_PARAM_NZREADLIM = convert(Cint,1024)
const CPX_PARAM_OBJLLIM = convert(Cint,1025)
const CPX_PARAM_OBJULIM = convert(Cint,1026)
const CPX_PARAM_PERIND = convert(Cint,1027)
const CPX_PARAM_PERLIM = convert(Cint,1028)
const CPX_PARAM_PPRIIND = convert(Cint,1029)
const CPX_PARAM_PREIND = convert(Cint,1030)
const CPX_PARAM_REINV = convert(Cint,1031)
const CPX_PARAM_SCAIND = convert(Cint,1034)
const CPX_PARAM_SCRIND = convert(Cint,1035)
const CPX_PARAM_SINGLIM = convert(Cint,1037)
const CPX_PARAM_TILIM = convert(Cint,1039)
const CPX_PARAM_PREDUAL = convert(Cint,1044)
const CPX_PARAM_PREPASS = convert(Cint,1052)
const CPX_PARAM_DATACHECK = convert(Cint,1056)
const CPX_PARAM_REDUCE = convert(Cint,1057)
const CPX_PARAM_PRELINEAR = convert(Cint,1058)
const CPX_PARAM_LPMETHOD = convert(Cint,1062)
const CPX_PARAM_QPMETHOD = convert(Cint,1063)
const CPX_PARAM_WORKDIR = convert(Cint,1064)
const CPX_PARAM_WORKMEM = convert(Cint,1065)
const CPX_PARAM_THREADS = convert(Cint,1067)
const CPX_PARAM_CONFLICTALG = convert(Cint,1073)
const CPX_PARAM_CONFLICTDISPLAY = convert(Cint,1074)
const CPX_PARAM_SIFTDISPLAY = convert(Cint,1076)
const CPX_PARAM_SIFTALG = convert(Cint,1077)
const CPX_PARAM_SIFTITLIM = convert(Cint,1078)
const CPX_PARAM_MPSLONGNUM = convert(Cint,1081)
const CPX_PARAM_MEMORYEMPHASIS = convert(Cint,1082)
const CPX_PARAM_NUMERICALEMPHASIS = convert(Cint,1083)
const CPX_PARAM_FEASOPTMODE = convert(Cint,1084)
const CPX_PARAM_PARALLELMODE = convert(Cint,1109)
const CPX_PARAM_TUNINGMEASURE = convert(Cint,1110)
const CPX_PARAM_TUNINGREPEAT = convert(Cint,1111)
const CPX_PARAM_TUNINGTILIM = convert(Cint,1112)
const CPX_PARAM_TUNINGDISPLAY = convert(Cint,1113)
const CPX_PARAM_WRITELEVEL = convert(Cint,1114)
const CPX_PARAM_RANDOMSEED = convert(Cint,1124)
const CPX_PARAM_DETTILIM = convert(Cint,1127)
const CPX_PARAM_FILEENCODING = convert(Cint,1129)
const CPX_PARAM_APIENCODING = convert(Cint,1130)
const CPX_PARAM_OPTIMALITYTARGET = convert(Cint,1131)
const CPX_PARAM_CLONELOG = convert(Cint,1132)
const CPX_PARAM_TUNINGDETTILIM = convert(Cint,1139)
const CPX_PARAM_CPUMASK = convert(Cint,1144)
const CPX_PARAM_SOLUTIONTYPE = convert(Cint,1147)
const CPX_PARAM_SOLUTIONTARGET = convert(Cint,1148)
const CPX_PARAM_ALL_MIN = convert(Cint,1000)
const CPX_PARAM_ALL_MAX = convert(Cint,6000)
const CPX_CALLBACK_PRIMAL = convert(Cint,1)
const CPX_CALLBACK_DUAL = convert(Cint,2)
const CPX_CALLBACK_NETWORK = convert(Cint,3)
const CPX_CALLBACK_PRIMAL_CROSSOVER = convert(Cint,4)
const CPX_CALLBACK_DUAL_CROSSOVER = convert(Cint,5)
const CPX_CALLBACK_BARRIER = convert(Cint,6)
const CPX_CALLBACK_PRESOLVE = convert(Cint,7)
const CPX_CALLBACK_QPBARRIER = convert(Cint,8)
const CPX_CALLBACK_QPSIMPLEX = convert(Cint,9)
const CPX_CALLBACK_TUNING = convert(Cint,10)
const CPX_CALLBACK_INFO_PRIMAL_OBJ = convert(Cint,1)
const CPX_CALLBACK_INFO_DUAL_OBJ = convert(Cint,2)
const CPX_CALLBACK_INFO_PRIMAL_INFMEAS = convert(Cint,3)
const CPX_CALLBACK_INFO_DUAL_INFMEAS = convert(Cint,4)
const CPX_CALLBACK_INFO_PRIMAL_FEAS = convert(Cint,5)
const CPX_CALLBACK_INFO_DUAL_FEAS = convert(Cint,6)
const CPX_CALLBACK_INFO_ITCOUNT = convert(Cint,7)
const CPX_CALLBACK_INFO_CROSSOVER_PPUSH = convert(Cint,8)
const CPX_CALLBACK_INFO_CROSSOVER_PEXCH = convert(Cint,9)
const CPX_CALLBACK_INFO_CROSSOVER_DPUSH = convert(Cint,10)
const CPX_CALLBACK_INFO_CROSSOVER_DEXCH = convert(Cint,11)
const CPX_CALLBACK_INFO_CROSSOVER_SBCNT = convert(Cint,12)
const CPX_CALLBACK_INFO_PRESOLVE_ROWSGONE = convert(Cint,13)
const CPX_CALLBACK_INFO_PRESOLVE_COLSGONE = convert(Cint,14)
const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST = convert(Cint,15)
const CPX_CALLBACK_INFO_PRESOLVE_COEFFS = convert(Cint,16)
const CPX_CALLBACK_INFO_USER_PROBLEM = convert(Cint,17)
const CPX_CALLBACK_INFO_TUNING_PROGRESS = convert(Cint,18)
const CPX_CALLBACK_INFO_ENDTIME = convert(Cint,19)
const CPX_CALLBACK_INFO_ITCOUNT_LONG = convert(Cint,20)
const CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG = convert(Cint,21)
const CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG = convert(Cint,22)
const CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG = convert(Cint,23)
const CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG = convert(Cint,24)
const CPX_CALLBACK_INFO_PRESOLVE_AGGSUBST_LONG = convert(Cint,25)
const CPX_CALLBACK_INFO_PRESOLVE_COEFFS_LONG = convert(Cint,26)
const CPX_CALLBACK_INFO_ENDDETTIME = convert(Cint,27)
const CPX_CALLBACK_INFO_STARTTIME = convert(Cint,28)
const CPX_CALLBACK_INFO_STARTDETTIME = convert(Cint,29)
const CPX_TUNE_AVERAGE = convert(Cint,1)
const CPX_TUNE_MINMAX = convert(Cint,2)
const CPX_TUNE_ABORT = convert(Cint,1)
const CPX_TUNE_TILIM = convert(Cint,2)
const CPX_TUNE_DETTILIM = convert(Cint,3)
const CPX_FEASOPT_MIN_SUM = convert(Cint,0)
const CPX_FEASOPT_OPT_SUM = convert(Cint,1)
const CPX_FEASOPT_MIN_INF = convert(Cint,2)
const CPX_FEASOPT_OPT_INF = convert(Cint,3)
const CPX_FEASOPT_MIN_QUAD = convert(Cint,4)
const CPX_FEASOPT_OPT_QUAD = convert(Cint,5)
const CPXERR_IIS_NO_INFO = convert(Cint,1701)
const CPXERR_IIS_NO_SOLN = convert(Cint,1702)
const CPXERR_IIS_FEAS = convert(Cint,1703)
const CPXERR_IIS_NOT_INFEAS = convert(Cint,1704)
const CPXERR_IIS_OPT_INFEAS = convert(Cint,1705)
const CPXERR_IIS_DEFAULT = convert(Cint,1706)
const CPXERR_IIS_NO_BASIC = convert(Cint,1707)
const CPXERR_IIS_NO_LOAD = convert(Cint,1709)
const CPXERR_IIS_SUB_OBJ_LIM = convert(Cint,1710)
const CPXERR_IIS_SUB_IT_LIM = convert(Cint,1711)
const CPXERR_IIS_SUB_TIME_LIM = convert(Cint,1712)
const CPXERR_IIS_NUM_BEST = convert(Cint,1713)
const CPXERR_IIS_SUB_ABORT = convert(Cint,1714)
const CPXERR_IIS_SUB_DETTIME_LIM = convert(Cint,1715)
const CPXIIS_COMPLETE = convert(Cint,1)
const CPXIIS_PARTIAL = convert(Cint,2)
const CPXIIS_AT_LOWER = convert(Cint,0)
const CPXIIS_FIXED = convert(Cint,1)
const CPXIIS_AT_UPPER = convert(Cint,2)
#const CPX_BARCONST_H = convert(Cint,)
const CPX_PARAM_BAREPCOMP = convert(Cint,3002)
const CPX_PARAM_BARGROWTH = convert(Cint,3003)
const CPX_PARAM_BAROBJRNG = convert(Cint,3004)
const CPX_PARAM_BARALG = convert(Cint,3007)
const CPX_PARAM_BARCOLNZ = convert(Cint,3009)
const CPX_PARAM_BARDISPLAY = convert(Cint,3010)
const CPX_PARAM_BARITLIM = convert(Cint,3012)
const CPX_PARAM_BARMAXCOR = convert(Cint,3013)
const CPX_PARAM_BARORDER = convert(Cint,3014)
const CPX_PARAM_BARSTARTALG = convert(Cint,3017)
const CPX_PARAM_BARCROSSALG = convert(Cint,3018)
const CPX_PARAM_BARQCPEPCOMP = convert(Cint,3020)
const CPX_BARORDER_AUTO = convert(Cint,0)
const CPX_BARORDER_AMD = convert(Cint,1)
const CPX_BARORDER_AMF = convert(Cint,2)
const CPX_BARORDER_ND = convert(Cint,3)
# const CPX_MIPCONST_H = convert(Cint,)
const CPX_MIPEMPHASIS_BALANCED = convert(Cint,0)
const CPX_MIPEMPHASIS_FEASIBILITY = convert(Cint,1)
const CPX_MIPEMPHASIS_OPTIMALITY = convert(Cint,2)
const CPX_MIPEMPHASIS_BESTBOUND = convert(Cint,3)
const CPX_MIPEMPHASIS_HIDDENFEAS = convert(Cint,4)
const CPX_TYPE_VAR = convert(Cchar,'0')
const CPX_TYPE_SOS1 = convert(Cchar,'1')
const CPX_TYPE_SOS2 = convert(Cchar,'2')
const CPX_TYPE_USER = convert(Cchar,'X')
const CPX_TYPE_ANY = convert(Cchar,'A')
const CPX_VARSEL_MININFEAS = convert(Cint,-1)
const CPX_VARSEL_DEFAULT = convert(Cint,0)
const CPX_VARSEL_MAXINFEAS = convert(Cint,1)
const CPX_VARSEL_PSEUDO = convert(Cint,2)
const CPX_VARSEL_STRONG = convert(Cint,3)
const CPX_VARSEL_PSEUDOREDUCED = convert(Cint,4)
const CPX_NODESEL_DFS = convert(Cint,0)
const CPX_NODESEL_BESTBOUND = convert(Cint,1)
const CPX_NODESEL_BESTEST = convert(Cint,2)
const CPX_NODESEL_BESTEST_ALT = convert(Cint,3)
const CPX_MIPORDER_COST = convert(Cint,1)
const CPX_MIPORDER_BOUNDS = convert(Cint,2)
const CPX_MIPORDER_SCALEDCOST = convert(Cint,3)
const CPX_BRANCH_GLOBAL = convert(Cint,0)
const CPX_BRANCH_DOWN = convert(Cint,-1)
const CPX_BRANCH_UP = convert(Cint,1)
const CPX_BRDIR_DOWN = convert(Cint,-1)
const CPX_BRDIR_AUTO = convert(Cint,0)
const CPX_BRDIR_UP = convert(Cint,1)
const CPX_CUT_COVER = convert(Cint,0)
const CPX_CUT_GUBCOVER = convert(Cint,1)
const CPX_CUT_FLOWCOVER = convert(Cint,2)
const CPX_CUT_CLIQUE = convert(Cint,3)
const CPX_CUT_FRAC = convert(Cint,4)
const CPX_CUT_MIR = convert(Cint,5)
const CPX_CUT_FLOWPATH = convert(Cint,6)
const CPX_CUT_DISJ = convert(Cint,7)
const CPX_CUT_IMPLBD = convert(Cint,8)
const CPX_CUT_ZEROHALF = convert(Cint,9)
const CPX_CUT_MCF = convert(Cint,10)
const CPX_CUT_LOCALCOVER = convert(Cint,11)
const CPX_CUT_TIGHTEN = convert(Cint,12)
const CPX_CUT_OBJDISJ = convert(Cint,13)
const CPX_CUT_LANDP = convert(Cint,14)
const CPX_CUT_USER = convert(Cint,15)
const CPX_CUT_TABLE = convert(Cint,16)
const CPX_CUT_SOLNPOOL = convert(Cint,17)
const CPX_CUT_LOCALIMPLBD = convert(Cint,18)
const CPX_CUT_NUM_TYPES = convert(Cint,19)
const CPX_MIPSEARCH_AUTO = convert(Cint,0)
const CPX_MIPSEARCH_TRADITIONAL = convert(Cint,1)
const CPX_MIPSEARCH_DYNAMIC = convert(Cint,2)
const CPX_MIPKAPPA_OFF = convert(Cint,-1)
const CPX_MIPKAPPA_AUTO = convert(Cint,0)
const CPX_MIPKAPPA_SAMPLE = convert(Cint,1)
const CPX_MIPKAPPA_FULL = convert(Cint,2)
const CPX_MIPSTART_AUTO = convert(Cint,0)
const CPX_MIPSTART_CHECKFEAS = convert(Cint,1)
const CPX_MIPSTART_SOLVEFIXED = convert(Cint,2)
const CPX_MIPSTART_SOLVEMIP = convert(Cint,3)
const CPX_MIPSTART_REPAIR = convert(Cint,4)
const CPX_CALLBACK_MIP = convert(Cint,101)
const CPX_CALLBACK_MIP_BRANCH = convert(Cint,102)
const CPX_CALLBACK_MIP_NODE = convert(Cint,103)
const CPX_CALLBACK_MIP_HEURISTIC = convert(Cint,104)
const CPX_CALLBACK_MIP_SOLVE = convert(Cint,105)
const CPX_CALLBACK_MIP_CUT_LOOP = convert(Cint,106)
const CPX_CALLBACK_MIP_PROBE = convert(Cint,107)
const CPX_CALLBACK_MIP_FRACCUT = convert(Cint,108)
const CPX_CALLBACK_MIP_DISJCUT = convert(Cint,109)
const CPX_CALLBACK_MIP_FLOWMIR = convert(Cint,110)
const CPX_CALLBACK_MIP_INCUMBENT_NODESOLN = convert(Cint,111)
const CPX_CALLBACK_MIP_DELETENODE = convert(Cint,112)
const CPX_CALLBACK_MIP_BRANCH_NOSOLN = convert(Cint,113)
const CPX_CALLBACK_MIP_CUT_LAST = convert(Cint,114)
const CPX_CALLBACK_MIP_CUT_FEAS = convert(Cint,115)
const CPX_CALLBACK_MIP_CUT_UNBD = convert(Cint,116)
const CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN = convert(Cint,117)
const CPX_CALLBACK_MIP_INCUMBENT_USERSOLN = convert(Cint,118)
const CPX_CALLBACK_INFO_BEST_INTEGER = convert(Cint,101)
const CPX_CALLBACK_INFO_BEST_REMAINING = convert(Cint,102)
const CPX_CALLBACK_INFO_NODE_COUNT = convert(Cint,103)
const CPX_CALLBACK_INFO_NODES_LEFT = convert(Cint,104)
const CPX_CALLBACK_INFO_MIP_ITERATIONS = convert(Cint,105)
const CPX_CALLBACK_INFO_CUTOFF = convert(Cint,106)
const CPX_CALLBACK_INFO_CLIQUE_COUNT = convert(Cint,107)
const CPX_CALLBACK_INFO_COVER_COUNT = convert(Cint,108)
const CPX_CALLBACK_INFO_MIP_FEAS = convert(Cint,109)
const CPX_CALLBACK_INFO_FLOWCOVER_COUNT = convert(Cint,110)
const CPX_CALLBACK_INFO_GUBCOVER_COUNT = convert(Cint,111)
const CPX_CALLBACK_INFO_IMPLBD_COUNT = convert(Cint,112)
const CPX_CALLBACK_INFO_PROBE_PHASE = convert(Cint,113)
const CPX_CALLBACK_INFO_PROBE_PROGRESS = convert(Cint,114)
const CPX_CALLBACK_INFO_FRACCUT_COUNT = convert(Cint,115)
const CPX_CALLBACK_INFO_FRACCUT_PROGRESS = convert(Cint,116)
const CPX_CALLBACK_INFO_DISJCUT_COUNT = convert(Cint,117)
const CPX_CALLBACK_INFO_DISJCUT_PROGRESS = convert(Cint,118)
const CPX_CALLBACK_INFO_FLOWPATH_COUNT = convert(Cint,119)
const CPX_CALLBACK_INFO_MIRCUT_COUNT = convert(Cint,120)
const CPX_CALLBACK_INFO_FLOWMIR_PROGRESS = convert(Cint,121)
const CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT = convert(Cint,122)
const CPX_CALLBACK_INFO_MY_THREAD_NUM = convert(Cint,123)
const CPX_CALLBACK_INFO_USER_THREADS = convert(Cint,124)
const CPX_CALLBACK_INFO_MIP_REL_GAP = convert(Cint,125)
const CPX_CALLBACK_INFO_MCFCUT_COUNT = convert(Cint,126)
const CPX_CALLBACK_INFO_KAPPA_STABLE = convert(Cint,127)
const CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS = convert(Cint,128)
const CPX_CALLBACK_INFO_KAPPA_UNSTABLE = convert(Cint,129)
const CPX_CALLBACK_INFO_KAPPA_ILLPOSED = convert(Cint,130)
const CPX_CALLBACK_INFO_KAPPA_MAX = convert(Cint,131)
const CPX_CALLBACK_INFO_KAPPA_ATTENTION = convert(Cint,132)
const CPX_CALLBACK_INFO_LANDPCUT_COUNT = convert(Cint,133)
const CPX_CALLBACK_INFO_USERCUT_COUNT = convert(Cint,134)
const CPX_CALLBACK_INFO_TABLECUT_COUNT = convert(Cint,135)
const CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT = convert(Cint,136)
const CPX_CALLBACK_INFO_NODE_COUNT_LONG = convert(Cint,140)
const CPX_CALLBACK_INFO_NODES_LEFT_LONG = convert(Cint,141)
const CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG = convert(Cint,142)
const CPX_CALLBACK_INFO_LAZY_SOURCE = convert(Cint,143)
const CPX_CALLBACK_INFO_NODE_SIINF = convert(Cint,201)
const CPX_CALLBACK_INFO_NODE_NIINF = convert(Cint,202)
const CPX_CALLBACK_INFO_NODE_ESTIMATE = convert(Cint,203)
const CPX_CALLBACK_INFO_NODE_DEPTH = convert(Cint,204)
const CPX_CALLBACK_INFO_NODE_OBJVAL = convert(Cint,205)
const CPX_CALLBACK_INFO_NODE_TYPE = convert(Cint,206)
const CPX_CALLBACK_INFO_NODE_VAR = convert(Cint,207)
const CPX_CALLBACK_INFO_NODE_SOS = convert(Cint,208)
const CPX_CALLBACK_INFO_NODE_SEQNUM = convert(Cint,209)
const CPX_CALLBACK_INFO_NODE_USERHANDLE = convert(Cint,210)
const CPX_CALLBACK_INFO_NODE_NODENUM = convert(Cint,211)
const CPX_CALLBACK_INFO_NODE_SEQNUM_LONG = convert(Cint,220)
const CPX_CALLBACK_INFO_NODE_NODENUM_LONG = convert(Cint,221)
const CPX_CALLBACK_INFO_NODE_DEPTH_LONG = convert(Cint,222)
const CPX_CALLBACK_INFO_SOS_TYPE = convert(Cint,240)
const CPX_CALLBACK_INFO_SOS_SIZE = convert(Cint,241)
const CPX_CALLBACK_INFO_SOS_IS_FEASIBLE = convert(Cint,242)
const CPX_CALLBACK_INFO_SOS_MEMBER_INDEX = convert(Cint,244)
const CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL = convert(Cint,246)
const CPX_CALLBACK_INFO_SOS_NUM = convert(Cint,247)
const CPX_CALLBACK_INFO_IC_NUM = convert(Cint,260)
const CPX_CALLBACK_INFO_IC_IMPLYING_VAR = convert(Cint,261)
const CPX_CALLBACK_INFO_IC_IMPLIED_VAR = convert(Cint,262)
const CPX_CALLBACK_INFO_IC_SENSE = convert(Cint,263)
const CPX_CALLBACK_INFO_IC_COMPL = convert(Cint,264)
const CPX_CALLBACK_INFO_IC_RHS = convert(Cint,265)
const CPX_CALLBACK_INFO_IC_IS_FEASIBLE = convert(Cint,266)
const CPX_INCUMBENT_ID = convert(Cint,-1)
const CPX_RAMPUP_DISABLED = convert(Cint,-1)
const CPX_RAMPUP_AUTO = convert(Cint,0)
const CPX_RAMPUP_DYNAMIC = convert(Cint,1)
const CPX_RAMPUP_INFINITE = convert(Cint,2)
const CPX_CALLBACK_DEFAULT = convert(Cint,0)
const CPX_CALLBACK_FAIL = convert(Cint,1)
const CPX_CALLBACK_SET = convert(Cint,2)
const CPX_CALLBACK_ABORT_CUT_LOOP = convert(Cint,3)
const CPX_USECUT_FORCE = convert(Cint,0)
const CPX_USECUT_PURGE = convert(Cint,1)
const CPX_USECUT_FILTER = convert(Cint,2)
const CPX_INTEGER_FEASIBLE = convert(Cint,0)
const CPX_INTEGER_INFEASIBLE = convert(Cint,1)
const CPX_IMPLIED_INTEGER_FEASIBLE = convert(Cint,2)
const CPX_PARAM_BRDIR = convert(Cint,2001)
const CPX_PARAM_BTTOL = convert(Cint,2002)
const CPX_PARAM_CLIQUES = convert(Cint,2003)
const CPX_PARAM_COEREDIND = convert(Cint,2004)
const CPX_PARAM_COVERS = convert(Cint,2005)
const CPX_PARAM_CUTLO = convert(Cint,2006)
const CPX_PARAM_CUTUP = convert(Cint,2007)
const CPX_PARAM_EPAGAP = convert(Cint,2008)
const CPX_PARAM_EPGAP = convert(Cint,2009)
const CPX_PARAM_EPINT = convert(Cint,2010)
const CPX_PARAM_MIPDISPLAY = convert(Cint,2012)
const CPX_PARAM_MIPINTERVAL = convert(Cint,2013)
const CPX_PARAM_INTSOLLIM = convert(Cint,2015)
const CPX_PARAM_NODEFILEIND = convert(Cint,2016)
const CPX_PARAM_NODELIM = convert(Cint,2017)
const CPX_PARAM_NODESEL = convert(Cint,2018)
const CPX_PARAM_OBJDIF = convert(Cint,2019)
const CPX_PARAM_MIPORDIND = convert(Cint,2020)
const CPX_PARAM_RELOBJDIF = convert(Cint,2022)
const CPX_PARAM_STARTALG = convert(Cint,2025)
const CPX_PARAM_SUBALG = convert(Cint,2026)
const CPX_PARAM_TRELIM = convert(Cint,2027)
const CPX_PARAM_VARSEL = convert(Cint,2028)
const CPX_PARAM_BNDSTRENIND = convert(Cint,2029)
const CPX_PARAM_HEURFREQ = convert(Cint,2031)
const CPX_PARAM_MIPORDTYPE = convert(Cint,2032)
const CPX_PARAM_CUTSFACTOR = convert(Cint,2033)
const CPX_PARAM_RELAXPREIND = convert(Cint,2034)
const CPX_PARAM_PRESLVND = convert(Cint,2037)
const CPX_PARAM_BBINTERVAL = convert(Cint,2039)
const CPX_PARAM_FLOWCOVERS = convert(Cint,2040)
const CPX_PARAM_IMPLBD = convert(Cint,2041)
const CPX_PARAM_PROBE = convert(Cint,2042)
const CPX_PARAM_GUBCOVERS = convert(Cint,2044)
const CPX_PARAM_STRONGCANDLIM = convert(Cint,2045)
const CPX_PARAM_STRONGITLIM = convert(Cint,2046)
const CPX_PARAM_FRACCAND = convert(Cint,2048)
const CPX_PARAM_FRACCUTS = convert(Cint,2049)
const CPX_PARAM_FRACPASS = convert(Cint,2050)
const CPX_PARAM_FLOWPATHS = convert(Cint,2051)
const CPX_PARAM_MIRCUTS = convert(Cint,2052)
const CPX_PARAM_DISJCUTS = convert(Cint,2053)
const CPX_PARAM_AGGCUTLIM = convert(Cint,2054)
const CPX_PARAM_MIPCBREDLP = convert(Cint,2055)
const CPX_PARAM_CUTPASS = convert(Cint,2056)
const CPX_PARAM_MIPEMPHASIS = convert(Cint,2058)
const CPX_PARAM_SYMMETRY = convert(Cint,2059)
const CPX_PARAM_DIVETYPE = convert(Cint,2060)
const CPX_PARAM_RINSHEUR = convert(Cint,2061)
const CPX_PARAM_SUBMIPNODELIM = convert(Cint,2062)
const CPX_PARAM_LBHEUR = convert(Cint,2063)
const CPX_PARAM_REPEATPRESOLVE = convert(Cint,2064)
const CPX_PARAM_PROBETIME = convert(Cint,2065)
const CPX_PARAM_POLISHTIME = convert(Cint,2066)
const CPX_PARAM_REPAIRTRIES = convert(Cint,2067)
const CPX_PARAM_EPLIN = convert(Cint,2068)
const CPX_PARAM_EPRELAX = convert(Cint,2073)
const CPX_PARAM_FPHEUR = convert(Cint,2098)
const CPX_PARAM_EACHCUTLIM = convert(Cint,2102)
const CPX_PARAM_SOLNPOOLCAPACITY = convert(Cint,2103)
const CPX_PARAM_SOLNPOOLREPLACE = convert(Cint,2104)
const CPX_PARAM_SOLNPOOLGAP = convert(Cint,2105)
const CPX_PARAM_SOLNPOOLAGAP = convert(Cint,2106)
const CPX_PARAM_SOLNPOOLINTENSITY = convert(Cint,2107)
const CPX_PARAM_POPULATELIM = convert(Cint,2108)
const CPX_PARAM_MIPSEARCH = convert(Cint,2109)
const CPX_PARAM_MIQCPSTRAT = convert(Cint,2110)
const CPX_PARAM_ZEROHALFCUTS = convert(Cint,2111)
const CPX_PARAM_POLISHAFTEREPAGAP = convert(Cint,2126)
const CPX_PARAM_POLISHAFTEREPGAP = convert(Cint,2127)
const CPX_PARAM_POLISHAFTERNODE = convert(Cint,2128)
const CPX_PARAM_POLISHAFTERINTSOL = convert(Cint,2129)
const CPX_PARAM_POLISHAFTERTIME = convert(Cint,2130)
const CPX_PARAM_MCFCUTS = convert(Cint,2134)
const CPX_PARAM_MIPKAPPASTATS = convert(Cint,2137)
const CPX_PARAM_AUXROOTTHREADS = convert(Cint,2139)
const CPX_PARAM_INTSOLFILEPREFIX = convert(Cint,2143)
const CPX_PARAM_PROBEDETTIME = convert(Cint,2150)
const CPX_PARAM_POLISHAFTERDETTIME = convert(Cint,2151)
const CPX_PARAM_LANDPCUTS = convert(Cint,2152)
const CPX_PARAM_RAMPUPDURATION = convert(Cint,2163)
const CPX_PARAM_RAMPUPDETTILIM = convert(Cint,2164)
const CPX_PARAM_RAMPUPTILIM = convert(Cint,2165)
const CPX_PARAM_LOCALIMPLBD = convert(Cint,2181)
const CPX_PARAM_BQPCUTS = convert(Cint,2195)
# const CPX_GCCONST_H = convert(Cint,)
const CPX_CON_LOWER_BOUND = convert(Cint,1)
const CPX_CON_UPPER_BOUND = convert(Cint,2)
const CPX_CON_LINEAR = convert(Cint,3)
const CPX_CON_QUADRATIC = convert(Cint,4)
const CPX_CON_SOS = convert(Cint,5)
const CPX_CON_INDICATOR = convert(Cint,6)
const CPX_CON_MINEXPR = convert(Cint,7)
const CPX_CON_MAXEXPR = convert(Cint,8)
const CPX_CON_PWL = convert(Cint,9)
const CPX_CON_ABS = convert(Cint,9)
const CPX_CON_DISJCST = convert(Cint,10)
const CPX_CON_INDDISJCST = convert(Cint,11)
const CPX_CON_SETVAR = convert(Cint,12)
const CPX_CON_SETVARMEMBER = convert(Cint,13)
const CPX_CON_SETVARCARD = convert(Cint,14)
const CPX_CON_SETVARSUM = convert(Cint,15)
const CPX_CON_SETVARMIN = convert(Cint,16)
const CPX_CON_SETVARMAX = convert(Cint,17)
const CPX_CON_SETVARSUBSET = convert(Cint,18)
const CPX_CON_SETVARDOMAIN = convert(Cint,19)
const CPX_CON_SETVARUNION = convert(Cint,20)
const CPX_CON_SETVARINTERSECTION = convert(Cint,21)
const CPX_CON_SETVARNULLINTERSECT = convert(Cint,22)
const CPX_CON_SETVARINTERSECT = convert(Cint,23)
const CPX_CON_SETVAREQ = convert(Cint,24)
const CPX_CON_SETVARNEQ = convert(Cint,25)
const CPX_CON_SETVARNEQCST = convert(Cint,26)
const CPX_CON_LAST_CONTYPE = convert(Cint,27)
const CPX_INDICATOR_IF = convert(Cint,1)
const CPX_INDICATOR_ONLYIF = convert(Cint,2)
const CPX_INDICATOR_IFANDONLYIF = convert(Cint,3)
# const CPX_NETCONST_H = convert(Cint,)
const CPX_PARAM_NETITLIM = convert(Cint,5001)
const CPX_PARAM_NETEPOPT = convert(Cint,5002)
const CPX_PARAM_NETEPRHS = convert(Cint,5003)
const CPX_PARAM_NETPPRIIND = convert(Cint,5004)
const CPX_PARAM_NETDISPLAY = convert(Cint,5005)
const CPXNET_NO_DISPLAY_OBJECTIVE = convert(Cint,0)
const CPXNET_TRUE_OBJECTIVE = convert(Cint,1)
const CPXNET_PENALIZED_OBJECTIVE = convert(Cint,2)
const CPXNET_PRICE_AUTO = convert(Cint,0)
const CPXNET_PRICE_PARTIAL = convert(Cint,1)
const CPXNET_PRICE_MULT_PART = convert(Cint,2)
const CPXNET_PRICE_SORT_MULT_PART = convert(Cint,3)
# const CPX_QPCONST_H = convert(Cint,)
const CPX_QCPDUALS_NO = convert(Cint,0)
const CPX_QCPDUALS_IFPOSSIBLE = convert(Cint,1)
const CPX_QCPDUALS_FORCE = convert(Cint,2)
const CPX_PARAM_QPNZREADLIM = convert(Cint,4001)
const CPX_PARAM_CALCQCPDUALS = convert(Cint,4003)
const CPX_PARAM_QPMAKEPSDIND = convert(Cint,4010)
const CPX_PARAM_QTOLININD = convert(Cint,4012)
# const CPX_SOCPCONST_H = convert(Cint,)
const CPX_BIGINT = convert(Cint,2100000000)
# const CPX_BIGLONG = convert(Cint,9223372036800000000LL)
const CPX_DUAL_OBJ = convert(Cint,41)
const CPX_EXACT_KAPPA = convert(Cint,51)
const CPX_KAPPA = convert(Cint,39)
const CPX_KAPPA_ATTENTION = convert(Cint,57)
const CPX_KAPPA_ILLPOSED = convert(Cint,55)
const CPX_KAPPA_MAX = convert(Cint,56)
const CPX_KAPPA_STABLE = convert(Cint,52)
const CPX_KAPPA_SUSPICIOUS = convert(Cint,53)
const CPX_KAPPA_UNSTABLE = convert(Cint,54)
const CPX_LAZYCONSTRAINTCALLBACK_HEUR = convert(Cint,CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN)
const CPX_LAZYCONSTRAINTCALLBACK_NODE = convert(Cint,CPX_CALLBACK_MIP_INCUMBENT_NODESOLN)
const CPX_MAX_COMP_SLACK = convert(Cint,19)
const CPX_MAX_DUAL_INFEAS = convert(Cint,5)
const CPX_MAX_DUAL_RESIDUAL = convert(Cint,15)
const CPX_MAX_INDSLACK_INFEAS = convert(Cint,49)
const CPX_MAX_INT_INFEAS = convert(Cint,9)
const CPX_MAX_PI = convert(Cint,25)
const CPX_MAX_PRIMAL_INFEAS = convert(Cint,1)
const CPX_MAX_PRIMAL_RESIDUAL = convert(Cint,11)
const CPX_MAX_QCPRIMAL_RESIDUAL = convert(Cint,43)
const CPX_MAX_QCSLACK = convert(Cint,47)
const CPX_MAX_QCSLACK_INFEAS = convert(Cint,45)
const CPX_MAX_RED_COST = convert(Cint,29)
const CPX_MAX_SCALED_DUAL_INFEAS = convert(Cint,6)
const CPX_MAX_SCALED_DUAL_RESIDUAL = convert(Cint,16)
const CPX_MAX_SCALED_PI = convert(Cint,26)
const CPX_MAX_SCALED_PRIMAL_INFEAS = convert(Cint,2)
const CPX_MAX_SCALED_PRIMAL_RESIDUAL = convert(Cint,12)
const CPX_MAX_SCALED_RED_COST = convert(Cint,30)
const CPX_MAX_SCALED_SLACK = convert(Cint,28)
const CPX_MAX_SCALED_X = convert(Cint,24)
const CPX_MAX_SLACK = convert(Cint,27)
const CPX_MAX_X = convert(Cint,23)
const CPX_OBJ_GAP = convert(Cint,40)
const CPX_PRIMAL_OBJ = convert(Cint,42)
const CPX_SOLNPOOL_DIV = convert(Cint,2)
const CPX_SOLNPOOL_FIFO = convert(Cint,0)
const CPX_SOLNPOOL_FILTER_DIVERSITY = convert(Cint,1)
const CPX_SOLNPOOL_FILTER_RANGE = convert(Cint,2)
const CPX_SOLNPOOL_OBJ = convert(Cint,1)
const CPX_STAT_ABORT_DETTIME_LIM = convert(Cint,25)
const CPX_STAT_ABORT_DUAL_OBJ_LIM = convert(Cint,22)
const CPX_STAT_ABORT_IT_LIM = convert(Cint,10)
const CPX_STAT_ABORT_OBJ_LIM = convert(Cint,12)
const CPX_STAT_ABORT_PRIM_OBJ_LIM = convert(Cint,21)
const CPX_STAT_ABORT_TIME_LIM = convert(Cint,11)
const CPX_STAT_ABORT_USER = convert(Cint,13)
const CPX_STAT_CONFLICT_ABORT_CONTRADICTION = convert(Cint,32)
const CPX_STAT_CONFLICT_ABORT_DETTIME_LIM = convert(Cint,39)
const CPX_STAT_CONFLICT_ABORT_IT_LIM = convert(Cint,34)
const CPX_STAT_CONFLICT_ABORT_MEM_LIM = convert(Cint,37)
const CPX_STAT_CONFLICT_ABORT_NODE_LIM = convert(Cint,35)
const CPX_STAT_CONFLICT_ABORT_OBJ_LIM = convert(Cint,36)
const CPX_STAT_CONFLICT_ABORT_TIME_LIM = convert(Cint,33)
const CPX_STAT_CONFLICT_ABORT_USER = convert(Cint,38)
const CPX_STAT_CONFLICT_FEASIBLE = convert(Cint,30)
const CPX_STAT_CONFLICT_MINIMAL = convert(Cint,31)
const CPX_STAT_FEASIBLE = convert(Cint,23)
const CPX_STAT_FEASIBLE_RELAXED_INF = convert(Cint,16)
const CPX_STAT_FEASIBLE_RELAXED_QUAD = convert(Cint,18)
const CPX_STAT_FEASIBLE_RELAXED_SUM = convert(Cint,14)
const CPX_STAT_FIRSTORDER = convert(Cint,24)
const CPX_STAT_INFEASIBLE = convert(Cint,3)
const CPX_STAT_INForUNBD = convert(Cint,4)
const CPX_STAT_NUM_BEST = convert(Cint,6)
const CPX_STAT_OPTIMAL = convert(Cint,1)
const CPX_STAT_OPTIMAL_FACE_UNBOUNDED = convert(Cint,20)
const CPX_STAT_OPTIMAL_INFEAS = convert(Cint,5)
const CPX_STAT_OPTIMAL_RELAXED_INF = convert(Cint,17)
const CPX_STAT_OPTIMAL_RELAXED_QUAD = convert(Cint,19)
const CPX_STAT_OPTIMAL_RELAXED_SUM = convert(Cint,15)
const CPX_STAT_UNBOUNDED = convert(Cint,2)
const CPX_SUM_COMP_SLACK = convert(Cint,21)
const CPX_SUM_DUAL_INFEAS = convert(Cint,7)
const CPX_SUM_DUAL_RESIDUAL = convert(Cint,17)
const CPX_SUM_INDSLACK_INFEAS = convert(Cint,50)
const CPX_SUM_INT_INFEAS = convert(Cint,10)
const CPX_SUM_PI = convert(Cint,33)
const CPX_SUM_PRIMAL_INFEAS = convert(Cint,3)
const CPX_SUM_PRIMAL_RESIDUAL = convert(Cint,13)
const CPX_SUM_QCPRIMAL_RESIDUAL = convert(Cint,44)
const CPX_SUM_QCSLACK = convert(Cint,48)
const CPX_SUM_QCSLACK_INFEAS = convert(Cint,46)
const CPX_SUM_RED_COST = convert(Cint,37)
const CPX_SUM_SCALED_DUAL_INFEAS = convert(Cint,8)
const CPX_SUM_SCALED_DUAL_RESIDUAL = convert(Cint,18)
const CPX_SUM_SCALED_PI = convert(Cint,34)
const CPX_SUM_SCALED_PRIMAL_INFEAS = convert(Cint,4)
const CPX_SUM_SCALED_PRIMAL_RESIDUAL = convert(Cint,14)
const CPX_SUM_SCALED_RED_COST = convert(Cint,38)
const CPX_SUM_SCALED_SLACK = convert(Cint,36)
const CPX_SUM_SCALED_X = convert(Cint,32)
const CPX_SUM_SLACK = convert(Cint,35)
const CPX_SUM_X = convert(Cint,31)
const CPXERR_ABORT_STRONGBRANCH = convert(Cint,1263)
const CPXERR_ADJ_SIGN_QUAD = convert(Cint,1606)
const CPXERR_ADJ_SIGN_SENSE = convert(Cint,1604)
const CPXERR_ADJ_SIGNS = convert(Cint,1602)
const CPXERR_ALGNOTLICENSED = convert(Cint,32024)
const CPXERR_ARC_INDEX_RANGE = convert(Cint,1231)
const CPXERR_ARRAY_BAD_SOS_TYPE = convert(Cint,3009)
const CPXERR_ARRAY_NOT_ASCENDING = convert(Cint,1226)
const CPXERR_ARRAY_TOO_LONG = convert(Cint,1208)
const CPXERR_BAD_ARGUMENT = convert(Cint,1003)
const CPXERR_BAD_BOUND_SENSE = convert(Cint,1622)
const CPXERR_BAD_BOUND_TYPE = convert(Cint,1457)
const CPXERR_BAD_CHAR = convert(Cint,1537)
const CPXERR_BAD_CTYPE = convert(Cint,3021)
const CPXERR_BAD_DIRECTION = convert(Cint,3012)
const CPXERR_BAD_EXPO_RANGE = convert(Cint,1435)
const CPXERR_BAD_EXPONENT = convert(Cint,1618)
const CPXERR_BAD_FILETYPE = convert(Cint,1424)
const CPXERR_BAD_ID = convert(Cint,1617)
const CPXERR_BAD_INDCONSTR = convert(Cint,1439)
const CPXERR_BAD_INDICATOR = convert(Cint,1551)
const CPXERR_BAD_LAZY_UCUT = convert(Cint,1438)
const CPXERR_BAD_LUB = convert(Cint,1229)
const CPXERR_BAD_METHOD = convert(Cint,1292)
const CPXERR_BAD_NUMBER = convert(Cint,1434)
const CPXERR_BAD_OBJ_SENSE = convert(Cint,1487)
const CPXERR_BAD_PARAM_NAME = convert(Cint,1028)
const CPXERR_BAD_PARAM_NUM = convert(Cint,1013)
const CPXERR_BAD_PIVOT = convert(Cint,1267)
const CPXERR_BAD_PRIORITY = convert(Cint,3006)
const CPXERR_BAD_PROB_TYPE = convert(Cint,1022)
const CPXERR_BAD_ROW_ID = convert(Cint,1532)
const CPXERR_BAD_SECTION_BOUNDS = convert(Cint,1473)
const CPXERR_BAD_SECTION_ENDATA = convert(Cint,1462)
const CPXERR_BAD_SECTION_QMATRIX = convert(Cint,1475)
const CPXERR_BAD_SENSE = convert(Cint,1215)
const CPXERR_BAD_SOS_TYPE = convert(Cint,1442)
const CPXERR_BAD_STATUS = convert(Cint,1253)
const CPXERR_BADPRODUCT = convert(Cint,32023)
const CPXERR_BAS_FILE_SHORT = convert(Cint,1550)
const CPXERR_BAS_FILE_SIZE = convert(Cint,1555)
const CPXERR_CALLBACK = convert(Cint,1006)
const CPXERR_CANT_CLOSE_CHILD = convert(Cint,1021)
const CPXERR_CHILD_OF_CHILD = convert(Cint,1019)
const CPXERR_COL_INDEX_RANGE = convert(Cint,1201)
const CPXERR_COL_REPEAT_PRINT = convert(Cint,1478)
const CPXERR_COL_REPEATS = convert(Cint,1446)
const CPXERR_COL_ROW_REPEATS = convert(Cint,1443)
const CPXERR_COL_UNKNOWN = convert(Cint,1449)
const CPXERR_CONFLICT_UNSTABLE = convert(Cint,1720)
const CPXERR_COUNT_OVERLAP = convert(Cint,1228)
const CPXERR_COUNT_RANGE = convert(Cint,1227)
const CPXERR_CPUBINDING_FAILURE = convert(Cint,3700)
const CPXERR_DBL_MAX = convert(Cint,1233)
const CPXERR_DECOMPRESSION = convert(Cint,1027)
const CPXERR_DETTILIM_STRONGBRANCH = convert(Cint,1270)
const CPXERR_DUP_ENTRY = convert(Cint,1222)
const CPXERR_DYNFUNC = convert(Cint,1815)
const CPXERR_DYNLOAD = convert(Cint,1814)
const CPXERR_ENCODING_CONVERSION = convert(Cint,1235)
const CPXERR_EXTRA_BV_BOUND = convert(Cint,1456)
const CPXERR_EXTRA_FR_BOUND = convert(Cint,1455)
const CPXERR_EXTRA_FX_BOUND = convert(Cint,1454)
const CPXERR_EXTRA_INTEND = convert(Cint,1481)
const CPXERR_EXTRA_INTORG = convert(Cint,1480)
const CPXERR_EXTRA_SOSEND = convert(Cint,1483)
const CPXERR_EXTRA_SOSORG = convert(Cint,1482)
const CPXERR_FAIL_OPEN_READ = convert(Cint,1423)
const CPXERR_FAIL_OPEN_WRITE = convert(Cint,1422)
const CPXERR_FILE_ENTRIES = convert(Cint,1553)
const CPXERR_FILE_FORMAT = convert(Cint,1563)
const CPXERR_FILE_IO = convert(Cint,1426)
const CPXERR_FILTER_VARIABLE_TYPE = convert(Cint,3414)
const CPXERR_ILL_DEFINED_PWL = convert(Cint,1213)
const CPXERR_ILOG_LICENSE = convert(Cint,32201)
const CPXERR_IN_INFOCALLBACK = convert(Cint,1804)
const CPXERR_INDEX_NOT_BASIC = convert(Cint,1251)
const CPXERR_INDEX_RANGE = convert(Cint,1200)
const CPXERR_INDEX_RANGE_HIGH = convert(Cint,1206)
const CPXERR_INDEX_RANGE_LOW = convert(Cint,1205)
const CPXERR_INT_TOO_BIG = convert(Cint,3018)
const CPXERR_INT_TOO_BIG_INPUT = convert(Cint,1463)
const CPXERR_INVALID_NUMBER = convert(Cint,1650)
const CPXERR_LIMITS_TOO_BIG = convert(Cint,1012)
const CPXERR_LINE_TOO_LONG = convert(Cint,1465)
const CPXERR_LO_BOUND_REPEATS = convert(Cint,1459)
const CPXERR_LOCK_CREATE = convert(Cint,1808)
const CPXERR_LP_NOT_IN_ENVIRONMENT = convert(Cint,1806)
const CPXERR_MIPSEARCH_WITH_CALLBACKS = convert(Cint,1805)
const CPXERR_MISS_SOS_TYPE = convert(Cint,3301)
const CPXERR_MSG_NO_CHANNEL = convert(Cint,1051)
const CPXERR_MSG_NO_FILEPTR = convert(Cint,1052)
const CPXERR_MSG_NO_FUNCTION = convert(Cint,1053)
const CPXERR_MULTIPLE_PROBS_IN_REMOTE_ENVIRONMENT = convert(Cint,1816)
const CPXERR_NAME_CREATION = convert(Cint,1209)
const CPXERR_NAME_NOT_FOUND = convert(Cint,1210)
const CPXERR_NAME_TOO_LONG = convert(Cint,1464)
const CPXERR_NAN = convert(Cint,1225)
const CPXERR_NEED_OPT_SOLN = convert(Cint,1252)
const CPXERR_NEGATIVE_SURPLUS = convert(Cint,1207)
const CPXERR_NET_DATA = convert(Cint,1530)
const CPXERR_NET_FILE_SHORT = convert(Cint,1538)
const CPXERR_NO_BARRIER_SOLN = convert(Cint,1223)
const CPXERR_NO_BASIC_SOLN = convert(Cint,1261)
const CPXERR_NO_BASIS = convert(Cint,1262)
const CPXERR_NO_BOUND_SENSE = convert(Cint,1621)
const CPXERR_NO_BOUND_TYPE = convert(Cint,1460)
const CPXERR_NO_COLUMNS_SECTION = convert(Cint,1472)
const CPXERR_NO_CONFLICT = convert(Cint,1719)
const CPXERR_NO_DUAL_SOLN = convert(Cint,1232)
const CPXERR_NO_ENDATA = convert(Cint,1552)
const CPXERR_NO_ENVIRONMENT = convert(Cint,1002)
const CPXERR_NO_FILENAME = convert(Cint,1421)
const CPXERR_NO_ID = convert(Cint,1616)
const CPXERR_NO_ID_FIRST = convert(Cint,1609)
const CPXERR_NO_INT_X = convert(Cint,3023)
const CPXERR_NO_KAPPASTATS = convert(Cint,1269)
const CPXERR_NO_LU_FACTOR = convert(Cint,1258)
const CPXERR_NO_MEMORY = convert(Cint,1001)
const CPXERR_NO_MIPSTART = convert(Cint,3020)
const CPXERR_NO_NAME_SECTION = convert(Cint,1441)
const CPXERR_NO_NAMES = convert(Cint,1219)
const CPXERR_NO_NORMS = convert(Cint,1264)
const CPXERR_NO_NUMBER = convert(Cint,1615)
const CPXERR_NO_NUMBER_BOUND = convert(Cint,1623)
const CPXERR_NO_NUMBER_FIRST = convert(Cint,1611)
const CPXERR_NO_OBJ_SENSE = convert(Cint,1436)
const CPXERR_NO_OBJECTIVE = convert(Cint,1476)
const CPXERR_NO_OP_OR_SENSE = convert(Cint,1608)
const CPXERR_NO_OPERATOR = convert(Cint,1607)
const CPXERR_NO_ORDER = convert(Cint,3016)
const CPXERR_NO_PROBLEM = convert(Cint,1009)
const CPXERR_NO_QP_OPERATOR = convert(Cint,1614)
const CPXERR_NO_QUAD_EXP = convert(Cint,1612)
const CPXERR_NO_RHS_COEFF = convert(Cint,1610)
const CPXERR_NO_RHS_IN_OBJ = convert(Cint,1211)
const CPXERR_NO_RNGVAL = convert(Cint,1216)
const CPXERR_NO_ROW_NAME = convert(Cint,1486)
const CPXERR_NO_ROW_SENSE = convert(Cint,1453)
const CPXERR_NO_ROWS_SECTION = convert(Cint,1471)
const CPXERR_NO_SENSIT = convert(Cint,1260)
const CPXERR_NO_SOLN = convert(Cint,1217)
const CPXERR_NO_SOLNPOOL = convert(Cint,3024)
const CPXERR_NO_SOS = convert(Cint,3015)
const CPXERR_NO_TREE = convert(Cint,3412)
const CPXERR_NO_VECTOR_SOLN = convert(Cint,1556)
const CPXERR_NODE_INDEX_RANGE = convert(Cint,1230)
const CPXERR_NODE_ON_DISK = convert(Cint,3504)
const CPXERR_NOT_DUAL_UNBOUNDED = convert(Cint,1265)
const CPXERR_NOT_FIXED = convert(Cint,1221)
const CPXERR_NOT_FOR_MIP = convert(Cint,1017)
const CPXERR_NOT_FOR_QCP = convert(Cint,1031)
const CPXERR_NOT_FOR_QP = convert(Cint,1018)
const CPXERR_NOT_MILPCLASS = convert(Cint,1024)
const CPXERR_NOT_MIN_COST_FLOW = convert(Cint,1531)
const CPXERR_NOT_MIP = convert(Cint,3003)
const CPXERR_NOT_MIQPCLASS = convert(Cint,1029)
const CPXERR_NOT_ONE_PROBLEM = convert(Cint,1023)
const CPXERR_NOT_QP = convert(Cint,5004)
const CPXERR_NOT_SAV_FILE = convert(Cint,1560)
const CPXERR_NOT_UNBOUNDED = convert(Cint,1254)
const CPXERR_NULL_NAME = convert(Cint,1224)
const CPXERR_NULL_POINTER = convert(Cint,1004)
const CPXERR_ORDER_BAD_DIRECTION = convert(Cint,3007)
const CPXERR_OVERFLOW = convert(Cint,1810)
const CPXERR_PARAM_INCOMPATIBLE = convert(Cint,1807)
const CPXERR_PARAM_TOO_BIG = convert(Cint,1015)
const CPXERR_PARAM_TOO_SMALL = convert(Cint,1014)
const CPXERR_PRESLV_ABORT = convert(Cint,1106)
const CPXERR_PRESLV_BAD_PARAM = convert(Cint,1122)
const CPXERR_PRESLV_BASIS_MEM = convert(Cint,1107)
const CPXERR_PRESLV_COPYORDER = convert(Cint,1109)
const CPXERR_PRESLV_COPYSOS = convert(Cint,1108)
const CPXERR_PRESLV_CRUSHFORM = convert(Cint,1121)
const CPXERR_PRESLV_DETTIME_LIM = convert(Cint,1124)
const CPXERR_PRESLV_DUAL = convert(Cint,1119)
const CPXERR_PRESLV_FAIL_BASIS = convert(Cint,1114)
const CPXERR_PRESLV_INF = convert(Cint,1117)
const CPXERR_PRESLV_INForUNBD = convert(Cint,1101)
const CPXERR_PRESLV_NO_BASIS = convert(Cint,1115)
const CPXERR_PRESLV_NO_PROB = convert(Cint,1103)
const CPXERR_PRESLV_SOLN_MIP = convert(Cint,1110)
const CPXERR_PRESLV_SOLN_QP = convert(Cint,1111)
const CPXERR_PRESLV_START_LP = convert(Cint,1112)
const CPXERR_PRESLV_TIME_LIM = convert(Cint,1123)
const CPXERR_PRESLV_UNBD = convert(Cint,1118)
const CPXERR_PRESLV_UNCRUSHFORM = convert(Cint,1120)
const CPXERR_PRIIND = convert(Cint,1257)
const CPXERR_PRM_DATA = convert(Cint,1660)
const CPXERR_PRM_HEADER = convert(Cint,1661)
const CPXERR_PROTOCOL = convert(Cint,1812)
const CPXERR_PTHREAD_CREATE = convert(Cint,3603)
const CPXERR_PTHREAD_MUTEX_INIT = convert(Cint,3601)
const CPXERR_Q_DIVISOR = convert(Cint,1619)
const CPXERR_Q_DUP_ENTRY = convert(Cint,5011)
const CPXERR_Q_NOT_INDEF = convert(Cint,5014)
const CPXERR_Q_NOT_POS_DEF = convert(Cint,5002)
const CPXERR_Q_NOT_SYMMETRIC = convert(Cint,5012)
const CPXERR_QCP_SENSE = convert(Cint,6002)
const CPXERR_QCP_SENSE_FILE = convert(Cint,1437)
const CPXERR_QUAD_EXP_NOT_2 = convert(Cint,1613)
const CPXERR_QUAD_IN_ROW = convert(Cint,1605)
const CPXERR_RANGE_SECTION_ORDER = convert(Cint,1474)
const CPXERR_RESTRICTED_VERSION = convert(Cint,1016)
const CPXERR_RHS_IN_OBJ = convert(Cint,1603)
const CPXERR_RIM_REPEATS = convert(Cint,1447)
const CPXERR_RIM_ROW_REPEATS = convert(Cint,1444)
const CPXERR_RIMNZ_REPEATS = convert(Cint,1479)
const CPXERR_ROW_INDEX_RANGE = convert(Cint,1203)
const CPXERR_ROW_REPEAT_PRINT = convert(Cint,1477)
const CPXERR_ROW_REPEATS = convert(Cint,1445)
const CPXERR_ROW_UNKNOWN = convert(Cint,1448)
const CPXERR_SAV_FILE_DATA = convert(Cint,1561)
const CPXERR_SAV_FILE_VALUE = convert(Cint,1564)
const CPXERR_SAV_FILE_WRITE = convert(Cint,1562)
const CPXERR_SBASE_ILLEGAL = convert(Cint,1554)
const CPXERR_SBASE_INCOMPAT = convert(Cint,1255)
const CPXERR_SINGULAR = convert(Cint,1256)
const CPXERR_STR_PARAM_TOO_LONG = convert(Cint,1026)
const CPXERR_SUBPROB_SOLVE = convert(Cint,3019)
const CPXERR_SYNCPRIM_CREATE = convert(Cint,1809)
const CPXERR_SYSCALL = convert(Cint,1813)
const CPXERR_THREAD_FAILED = convert(Cint,1234)
const CPXERR_TILIM_CONDITION_NO = convert(Cint,1268)
const CPXERR_TILIM_STRONGBRANCH = convert(Cint,1266)
const CPXERR_TOO_MANY_COEFFS = convert(Cint,1433)
const CPXERR_TOO_MANY_COLS = convert(Cint,1432)
const CPXERR_TOO_MANY_RIMNZ = convert(Cint,1485)
const CPXERR_TOO_MANY_RIMS = convert(Cint,1484)
const CPXERR_TOO_MANY_ROWS = convert(Cint,1431)
const CPXERR_TOO_MANY_THREADS = convert(Cint,1020)
const CPXERR_TREE_MEMORY_LIMIT = convert(Cint,3413)
const CPXERR_TUNE_MIXED = convert(Cint,1730)
const CPXERR_UNIQUE_WEIGHTS = convert(Cint,3010)
const CPXERR_UNSUPPORTED_CONSTRAINT_TYPE = convert(Cint,1212)
const CPXERR_UNSUPPORTED_OPERATION = convert(Cint,1811)
const CPXERR_UP_BOUND_REPEATS = convert(Cint,1458)
const CPXERR_WORK_FILE_OPEN = convert(Cint,1801)
const CPXERR_WORK_FILE_READ = convert(Cint,1802)
const CPXERR_WORK_FILE_WRITE = convert(Cint,1803)
const CPXERR_XMLPARSE = convert(Cint,1425)
const CPXMESSAGEBUFSIZE = convert(Cint,1024)
const CPXMIP_ABORT_FEAS = convert(Cint,113)
const CPXMIP_ABORT_INFEAS = convert(Cint,114)
const CPXMIP_ABORT_RELAXATION_UNBOUNDED = convert(Cint,133)
const CPXMIP_ABORT_RELAXED = convert(Cint,126)
const CPXMIP_DETTIME_LIM_FEAS = convert(Cint,131)
const CPXMIP_DETTIME_LIM_INFEAS = convert(Cint,132)
const CPXMIP_FAIL_FEAS = convert(Cint,109)
const CPXMIP_FAIL_FEAS_NO_TREE = convert(Cint,116)
const CPXMIP_FAIL_INFEAS = convert(Cint,110)
const CPXMIP_FAIL_INFEAS_NO_TREE = convert(Cint,117)
const CPXMIP_FEASIBLE = convert(Cint,127)
const CPXMIP_FEASIBLE_RELAXED_INF = convert(Cint,122)
const CPXMIP_FEASIBLE_RELAXED_QUAD = convert(Cint,124)
const CPXMIP_FEASIBLE_RELAXED_SUM = convert(Cint,120)
const CPXMIP_INFEASIBLE = convert(Cint,103)
const CPXMIP_INForUNBD = convert(Cint,119)
const CPXMIP_MEM_LIM_FEAS = convert(Cint,111)
const CPXMIP_MEM_LIM_INFEAS = convert(Cint,112)
const CPXMIP_NODE_LIM_FEAS = convert(Cint,105)
const CPXMIP_NODE_LIM_INFEAS = convert(Cint,106)
const CPXMIP_OPTIMAL = convert(Cint,101)
const CPXMIP_OPTIMAL_INFEAS = convert(Cint,115)
const CPXMIP_OPTIMAL_POPULATED = convert(Cint,129)
const CPXMIP_OPTIMAL_POPULATED_TOL = convert(Cint,130)
const CPXMIP_OPTIMAL_RELAXED_INF = convert(Cint,123)
const CPXMIP_OPTIMAL_RELAXED_QUAD = convert(Cint,125)
const CPXMIP_OPTIMAL_RELAXED_SUM = convert(Cint,121)
const CPXMIP_OPTIMAL_TOL = convert(Cint,102)
const CPXMIP_POPULATESOL_LIM = convert(Cint,128)
const CPXMIP_SOL_LIM = convert(Cint,104)
const CPXMIP_TIME_LIM_FEAS = convert(Cint,107)
const CPXMIP_TIME_LIM_INFEAS = convert(Cint,108)
const CPXMIP_UNBOUNDED = convert(Cint,118)
# const CPXPARAM_H = convert(Cint,)
const CPXPARAM_Advance = convert(Cint,1001)
const CPXPARAM_Barrier_Algorithm = convert(Cint,3007)
const CPXPARAM_Barrier_ColNonzeros = convert(Cint,3009)
const CPXPARAM_Barrier_ConvergeTol = convert(Cint,3002)
const CPXPARAM_Barrier_Crossover = convert(Cint,3018)
const CPXPARAM_Barrier_Display = convert(Cint,3010)
const CPXPARAM_Barrier_Limits_Corrections = convert(Cint,3013)
const CPXPARAM_Barrier_Limits_Growth = convert(Cint,3003)
const CPXPARAM_Barrier_Limits_Iteration = convert(Cint,3012)
const CPXPARAM_Barrier_Limits_ObjRange = convert(Cint,3004)
const CPXPARAM_Barrier_Ordering = convert(Cint,3014)
const CPXPARAM_Barrier_QCPConvergeTol = convert(Cint,3020)
const CPXPARAM_Barrier_StartAlg = convert(Cint,3017)
const CPXPARAM_ClockType = convert(Cint,1006)
const CPXPARAM_Conflict_Algorithm = convert(Cint,1073)
const CPXPARAM_Conflict_Display = convert(Cint,1074)
const CPXPARAM_CPUmask = convert(Cint,1144)
const CPXPARAM_DetTimeLimit = convert(Cint,1127)
const CPXPARAM_DistMIP_Rampup_DetTimeLimit = convert(Cint,2164)
const CPXPARAM_DistMIP_Rampup_Duration = convert(Cint,2163)
const CPXPARAM_DistMIP_Rampup_TimeLimit = convert(Cint,2165)
const CPXPARAM_Emphasis_Memory = convert(Cint,1082)
const CPXPARAM_Emphasis_MIP = convert(Cint,2058)
const CPXPARAM_Emphasis_Numerical = convert(Cint,1083)
const CPXPARAM_Feasopt_Mode = convert(Cint,1084)
const CPXPARAM_Feasopt_Tolerance = convert(Cint,2073)
const CPXPARAM_LPMethod = convert(Cint,1062)
const CPXPARAM_MIP_Cuts_BQP = convert(Cint,2195)
const CPXPARAM_MIP_Cuts_Cliques = convert(Cint,2003)
const CPXPARAM_MIP_Cuts_Covers = convert(Cint,2005)
const CPXPARAM_MIP_Cuts_Disjunctive = convert(Cint,2053)
const CPXPARAM_MIP_Cuts_FlowCovers = convert(Cint,2040)
const CPXPARAM_MIP_Cuts_Gomory = convert(Cint,2049)
const CPXPARAM_MIP_Cuts_GUBCovers = convert(Cint,2044)
const CPXPARAM_MIP_Cuts_Implied = convert(Cint,2041)
const CPXPARAM_MIP_Cuts_LiftProj = convert(Cint,2152)
const CPXPARAM_MIP_Cuts_LocalImplied = convert(Cint,2181)
const CPXPARAM_MIP_Cuts_MCFCut = convert(Cint,2134)
const CPXPARAM_MIP_Cuts_MIRCut = convert(Cint,2052)
const CPXPARAM_MIP_Cuts_PathCut = convert(Cint,2051)
const CPXPARAM_MIP_Cuts_ZeroHalfCut = convert(Cint,2111)
const CPXPARAM_MIP_Display = convert(Cint,2012)
const CPXPARAM_MIP_Interval = convert(Cint,2013)
const CPXPARAM_MIP_Limits_AggForCut = convert(Cint,2054)
const CPXPARAM_MIP_Limits_AuxRootThreads = convert(Cint,2139)
const CPXPARAM_MIP_Limits_CutPasses = convert(Cint,2056)
const CPXPARAM_MIP_Limits_CutsFactor = convert(Cint,2033)
const CPXPARAM_MIP_Limits_EachCutLimit = convert(Cint,2102)
const CPXPARAM_MIP_Limits_GomoryCand = convert(Cint,2048)
const CPXPARAM_MIP_Limits_GomoryPass = convert(Cint,2050)
const CPXPARAM_MIP_Limits_Nodes = convert(Cint,2017)
const CPXPARAM_MIP_Limits_PolishTime = convert(Cint,2066)
const CPXPARAM_MIP_Limits_Populate = convert(Cint,2108)
const CPXPARAM_MIP_Limits_ProbeDetTime = convert(Cint,2150)
const CPXPARAM_MIP_Limits_ProbeTime = convert(Cint,2065)
const CPXPARAM_MIP_Limits_RepairTries = convert(Cint,2067)
const CPXPARAM_MIP_Limits_Solutions = convert(Cint,2015)
const CPXPARAM_MIP_Limits_StrongCand = convert(Cint,2045)
const CPXPARAM_MIP_Limits_StrongIt = convert(Cint,2046)
const CPXPARAM_MIP_Limits_SubMIPNodeLim = convert(Cint,2062)
const CPXPARAM_MIP_Limits_TreeMemory = convert(Cint,2027)
const CPXPARAM_MIP_OrderType = convert(Cint,2032)
const CPXPARAM_MIP_PolishAfter_AbsMIPGap = convert(Cint,2126)
const CPXPARAM_MIP_PolishAfter_DetTime = convert(Cint,2151)
const CPXPARAM_MIP_PolishAfter_MIPGap = convert(Cint,2127)
const CPXPARAM_MIP_PolishAfter_Nodes = convert(Cint,2128)
const CPXPARAM_MIP_PolishAfter_Solutions = convert(Cint,2129)
const CPXPARAM_MIP_PolishAfter_Time = convert(Cint,2130)
const CPXPARAM_MIP_Pool_AbsGap = convert(Cint,2106)
const CPXPARAM_MIP_Pool_Capacity = convert(Cint,2103)
const CPXPARAM_MIP_Pool_Intensity = convert(Cint,2107)
const CPXPARAM_MIP_Pool_RelGap = convert(Cint,2105)
const CPXPARAM_MIP_Pool_Replace = convert(Cint,2104)
const CPXPARAM_MIP_Strategy_Backtrack = convert(Cint,2002)
const CPXPARAM_MIP_Strategy_BBInterval = convert(Cint,2039)
const CPXPARAM_MIP_Strategy_Branch = convert(Cint,2001)
const CPXPARAM_MIP_Strategy_CallbackReducedLP = convert(Cint,2055)
const CPXPARAM_MIP_Strategy_Dive = convert(Cint,2060)
const CPXPARAM_MIP_Strategy_File = convert(Cint,2016)
const CPXPARAM_MIP_Strategy_FPHeur = convert(Cint,2098)
const CPXPARAM_MIP_Strategy_HeuristicFreq = convert(Cint,2031)
const CPXPARAM_MIP_Strategy_KappaStats = convert(Cint,2137)
const CPXPARAM_MIP_Strategy_LBHeur = convert(Cint,2063)
const CPXPARAM_MIP_Strategy_MIQCPStrat = convert(Cint,2110)
const CPXPARAM_MIP_Strategy_NodeSelect = convert(Cint,2018)
const CPXPARAM_MIP_Strategy_Order = convert(Cint,2020)
const CPXPARAM_MIP_Strategy_PresolveNode = convert(Cint,2037)
const CPXPARAM_MIP_Strategy_Probe = convert(Cint,2042)
const CPXPARAM_MIP_Strategy_RINSHeur = convert(Cint,2061)
const CPXPARAM_MIP_Strategy_Search = convert(Cint,2109)
const CPXPARAM_MIP_Strategy_StartAlgorithm = convert(Cint,2025)
const CPXPARAM_MIP_Strategy_SubAlgorithm = convert(Cint,2026)
const CPXPARAM_MIP_Strategy_VariableSelect = convert(Cint,2028)
const CPXPARAM_MIP_Tolerances_AbsMIPGap = convert(Cint,2008)
const CPXPARAM_MIP_Tolerances_Integrality = convert(Cint,2010)
const CPXPARAM_MIP_Tolerances_LowerCutoff = convert(Cint,2006)
const CPXPARAM_MIP_Tolerances_MIPGap = convert(Cint,2009)
const CPXPARAM_MIP_Tolerances_ObjDifference = convert(Cint,2019)
const CPXPARAM_MIP_Tolerances_RelObjDifference = convert(Cint,2022)
const CPXPARAM_MIP_Tolerances_UpperCutoff = convert(Cint,2007)
const CPXPARAM_Network_Display = convert(Cint,5005)
const CPXPARAM_Network_Iterations = convert(Cint,5001)
const CPXPARAM_Network_NetFind = convert(Cint,1022)
const CPXPARAM_Network_Pricing = convert(Cint,5004)
const CPXPARAM_Network_Tolerances_Feasibility = convert(Cint,5003)
const CPXPARAM_Network_Tolerances_Optimality = convert(Cint,5002)
const CPXPARAM_OptimalityTarget = convert(Cint,1131)
const CPXPARAM_Output_CloneLog = convert(Cint,1132)
const CPXPARAM_Output_IntSolFilePrefix = convert(Cint,2143)
const CPXPARAM_Output_MPSLong = convert(Cint,1081)
const CPXPARAM_Output_WriteLevel = convert(Cint,1114)
const CPXPARAM_Parallel = convert(Cint,1109)
const CPXPARAM_Preprocessing_Aggregator = convert(Cint,1003)
const CPXPARAM_Preprocessing_BoundStrength = convert(Cint,2029)
const CPXPARAM_Preprocessing_CoeffReduce = convert(Cint,2004)
const CPXPARAM_Preprocessing_Dependency = convert(Cint,1008)
const CPXPARAM_Preprocessing_Dual = convert(Cint,1044)
const CPXPARAM_Preprocessing_Fill = convert(Cint,1002)
const CPXPARAM_Preprocessing_Linear = convert(Cint,1058)
const CPXPARAM_Preprocessing_NumPass = convert(Cint,1052)
const CPXPARAM_Preprocessing_Presolve = convert(Cint,1030)
const CPXPARAM_Preprocessing_QCPDuals = convert(Cint,4003)
const CPXPARAM_Preprocessing_QPMakePSD = convert(Cint,4010)
const CPXPARAM_Preprocessing_QToLin = convert(Cint,4012)
const CPXPARAM_Preprocessing_Reduce = convert(Cint,1057)
const CPXPARAM_Preprocessing_Relax = convert(Cint,2034)
const CPXPARAM_Preprocessing_RepeatPresolve = convert(Cint,2064)
const CPXPARAM_Preprocessing_Symmetry = convert(Cint,2059)
const CPXPARAM_QPMethod = convert(Cint,1063)
const CPXPARAM_RandomSeed = convert(Cint,1124)
const CPXPARAM_Read_APIEncoding = convert(Cint,1130)
const CPXPARAM_Read_Constraints = convert(Cint,1021)
const CPXPARAM_Read_DataCheck = convert(Cint,1056)
const CPXPARAM_Read_FileEncoding = convert(Cint,1129)
const CPXPARAM_Read_Nonzeros = convert(Cint,1024)
const CPXPARAM_Read_QPNonzeros = convert(Cint,4001)
const CPXPARAM_Read_Scale = convert(Cint,1034)
const CPXPARAM_Read_Variables = convert(Cint,1023)
const CPXPARAM_ScreenOutput = convert(Cint,1035)
const CPXPARAM_Sifting_Algorithm = convert(Cint,1077)
const CPXPARAM_Sifting_Display = convert(Cint,1076)
const CPXPARAM_Sifting_Iterations = convert(Cint,1078)
const CPXPARAM_Simplex_Crash = convert(Cint,1007)
const CPXPARAM_Simplex_DGradient = convert(Cint,1009)
const CPXPARAM_Simplex_Display = convert(Cint,1019)
const CPXPARAM_Simplex_Limits_Iterations = convert(Cint,1020)
const CPXPARAM_Simplex_Limits_LowerObj = convert(Cint,1025)
const CPXPARAM_Simplex_Limits_Perturbation = convert(Cint,1028)
const CPXPARAM_Simplex_Limits_Singularity = convert(Cint,1037)
const CPXPARAM_Simplex_Limits_UpperObj = convert(Cint,1026)
const CPXPARAM_Simplex_Perturbation_Constant = convert(Cint,1015)
const CPXPARAM_Simplex_Perturbation_Indicator = convert(Cint,1027)
const CPXPARAM_Simplex_PGradient = convert(Cint,1029)
const CPXPARAM_Simplex_Pricing = convert(Cint,1010)
const CPXPARAM_Simplex_Refactor = convert(Cint,1031)
const CPXPARAM_Simplex_Tolerances_Feasibility = convert(Cint,1016)
const CPXPARAM_Simplex_Tolerances_Markowitz = convert(Cint,1013)
const CPXPARAM_Simplex_Tolerances_Optimality = convert(Cint,1014)
const CPXPARAM_SolutionType = convert(Cint,1147)
const CPXPARAM_SolutionTarget = convert(Cint,1148)
const CPXPARAM_Threads = convert(Cint,1067)
const CPXPARAM_TimeLimit = convert(Cint,1039)
const CPXPARAM_Tune_DetTimeLimit = convert(Cint,1139)
const CPXPARAM_Tune_Display = convert(Cint,1113)
const CPXPARAM_Tune_Measure = convert(Cint,1110)
const CPXPARAM_Tune_Repeat = convert(Cint,1111)
const CPXPARAM_Tune_TimeLimit = convert(Cint,1112)
const CPXPARAM_WorkDir = convert(Cint,1064)
const CPXPARAM_WorkMem = convert(Cint,1065)


text:
using Plots

x = 1:1:10
y = z = rand(10)
p = plot(x, y, [z, z], layout = 2)
plot!(p[1], camera = (20,50))
p

ext: jl

max_stars_repo_name: terasakisatoshi/juliaExer

max_issues_repo_name: terasakisatoshi/juliaExer

max_forks_repo_name: terasakisatoshi/juliaExer


text:
# ---
# title: 984. String Without AAA or BBB
# id: problem984
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: Greedy
# link: <https://leetcode.com/problems/string-without-aaa-or-bbb/description/>
# hidden: true
# ---
#
# Given two integers `A` and `B`, return **any** string `S` such that:
#
#   * `S` has length `A + B` and contains exactly `A` `'a'` letters, and exactly `B` `'b'` letters;
#   * The substring `'aaa'` does not occur in `S`;
#   * The substring `'bbb'` does not occur in `S`.
#
#
#
# **Example 1:**
#
#
#
#     Input: A = 1, B = 2
#     Output: "abb"
#     Explanation: "abb", "bab" and "bba" are all correct answers.
#
#
# **Example 2:**
#
#
#
#     Input: A = 4, B = 1
#     Output: "aabaa"
#
#
#
# **Note:**
#
#   1. `0 <= A <= 100`
#   2. `0 <= B <= 100`
#   3. It is guaranteed such an `S` exists for the given `A` and `B`.
#
#
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end


text:
# Benchmarking samplers

using BenchmarkLite
using Distributions

### define benchmark tasks

type UnivariateSamplerRun{Spl} <: Proc end

const batch_unit = 1000

Base.isvalid(::UnivariateSamplerRun, cfg) = true
Base.length(p::UnivariateSamplerRun, cfg) = batch_unit
Base.string{Spl}(p::UnivariateSamplerRun{Spl}) = getname(Spl)

Base.start{Spl}(p::UnivariateSamplerRun{Spl}, cfg) = getsampler(Spl, cfg)
Base.done(p::UnivariateSamplerRun, cfg, s) = nothing

getsampler{Spl<:Sampleable}(::Type{Spl}, cfg) = Spl(cfg...)

function Base.run(p::UnivariateSamplerRun, cfg, s)
    for i = 1:batch_unit
        rand(s)
    end
end

make_procs(spltypes...) = Proc[UnivariateSamplerRun{T}() for T in spltypes]

### specific benchmarking program

## categorical

import Distributions: AliasTable, CategoricalDirectSampler
getsampler(::Type{CategoricalDirectSampler}, k::Int) = CategoricalDirectSampler(fill(1/k, k))
getsampler(::Type{AliasTable}, k::Int) = AliasTable(fill(1/k, k))

getname(::Type{CategoricalDirectSampler}) = "direct"
getname(::Type{AliasTable}) = "alias"

benchmark_categorical() = (
    make_procs(CategoricalDirectSampler, AliasTable),
    "K", 2 .^ (1:12))

## binomial

import Distributions: BinomialRmathSampler, BinomialAliasSampler
import Distributions: BinomialGeomSampler, BinomialTPESampler, BinomialPolySampler

getname(::Type{BinomialRmathSampler}) = "rmath"
getname(::Type{BinomialAliasSampler}) = "alias"
getname(::Type{BinomialGeomSampler}) = "Geom"
getname(::Type{BinomialTPESampler}) = "BTPE"
getname(::Type{BinomialPolySampler}) = "Poly"

benchmark_binomial() = (
    make_procs(BinomialRmathSampler,
               BinomialAliasSampler,
               BinomialGeomSampler,
               BinomialTPESampler,
               BinomialPolySampler),
    "(n, p)", vec([(n, p) for p in [0.3, 0.5, 0.9], n in 2.^(1:12)]))

## poisson

import Distributions: PoissonRmathSampler, PoissonCountSampler, PoissonADSampler

getname(::Type{PoissonRmathSampler}) = "rmath"
getname(::Type{PoissonCountSampler}) = "count"
getname(::Type{PoissonADSampler}) = "AD"

Base.isvalid(::UnivariateSamplerRun{PoissonADSampler}, mu) = (mu >= 5.0)

benchmark_poisson() = (
    make_procs(PoissonRmathSampler, PoissonCountSampler, PoissonADSampler),
    "μ", [0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 15.0, 20.0, 30.0])

## exponential

import Distributions: ExponentialSampler, ExponentialLogUSampler

getname(::Type{ExponentialSampler}) = "base"
getname(::Type{ExponentialLogUSampler}) = "logu"

benchmark_exponential() = (
    make_procs(ExponentialSampler, ExponentialLogUSampler),
    "scale", [1.0])

## gamma

import Distributions: GammaRmathSampler, GammaMTSampler

getname(::Type{GammaRmathSampler}) = "rmath"
getname(::Type{GammaMTSampler}) = "MT"

benchmark_gamma() = (
    make_procs(GammaRmathSampler, GammaMTSampler),
    "(α, scale)", [(α, 1.0) for α in [0.5, 1.0, 2.0, 5.0, 20.0]])

### main

const dnames = ["categorical",
                "binomial",
                "poisson",
                "exponential",
                "gamma"]

function printhelp()
    println("Require exactly one argument. Usage:")
    println()
    println("   julia <path>/sampler.jl <distrname>")
    println()
    println("   <distrname> can be:")
    println()
    for dname in dnames
        println("      - $dname")
    end
    println()
end

function getarg(args)
    if length(args) == 1
        dname = args[1]
        if dname in dnames
            return dname
        else
            printhelp()
            exit(1)
        end
    else
        printhelp()
        exit(1)
    end
end

dname = getarg(ARGS)

function do_benchmark(dname; verbose::Int=2)
    (procs, cfghead, cfgs) =
        dname == "categorical" ? benchmark_categorical() :
        dname == "binomial"    ? benchmark_binomial() :
        dname == "poisson"     ? benchmark_poisson() :
        dname == "exponential" ? benchmark_exponential() :
        dname == "gamma"       ? benchmark_gamma() :
        error("benchmarking function for $dname has not been implemented.")

    r = run(procs, cfgs; duration=0.2, verbose=verbose)
    println()
    show(r; unit=:mps, cfghead=cfghead)
end

do_benchmark(dname)
println()


text:
function estimate(model::String,
				number_of_components::Int64,
				Lx::Float64,
				Ly::Float64,
				Lz::Float64,
				kmin::Int64,
				number_of_de_bins::Int64,
				ub_de::Float64,
				lb_m::Float64,
				ub_m::Float64,
				lb_c::Float64,
				ub_c::Float64,
				lb_az::Float64,
				ub_az::Float64,
				number_of_abc_samples::Int64,
				gamma_initial::Float64,
				gamma_adaptive::Bool,
				delta_gamma::Float64,
				weighting_scheme::String,
				ub_average_number_of_trials::Int64,
				ax::Float64,
				ay::Float64,
				number_of_frames::Array{Int64, 1},
				deltat::Float64,
				K::Array{Int64, 1},
				DE::Array{Float64, 1})

	number_of_workers::Int64 = nworkers() # Number of CPUs/threads.

	# Distance function histogram bin width.
	d_de::Float64 = ub_de / convert(Float64, number_of_de_bins)

	# Convert data to histogram form.
	kmax::Int64 = maximum(number_of_frames)
	H::Array{Int64, 2} = zeros(kmax, number_of_de_bins)
	idx::Int64 = 0
	for i = 1:length(K)
		idx = convert(Int64, ceil(DE[i] / d_de))
		if 1 <= idx <= number_of_de_bins
			H[K[i], idx] += 1
		end
	end

	# Convert concentration bounds to log scale.
	lb_log10c::Float64 = log10(lb_c)
	ub_log10c::Float64 = log10(ub_c)

	# Variables for population parameter values.
	m::Array{Float64, 2} = zeros(number_of_components, number_of_abc_samples)
	log10c::Array{Float64, 2} = zeros(number_of_components, number_of_abc_samples)
	az::Array{Float64, 2} = zeros(number_of_components, number_of_abc_samples)
	dist::Array{Float64, 1} = zeros(number_of_abc_samples)

	m_star::SharedArray{Float64, 2} = zeros(number_of_components, number_of_abc_samples)
	log10c_star::SharedArray{Float64, 2} = zeros(number_of_components, number_of_abc_samples)
	az_star::SharedArray{Float64, 2} = zeros(number_of_components, number_of_abc_samples)
	dist_star::SharedArray{Float64, 1} = zeros(number_of_abc_samples)

	# Initialize assuming that gamma = inf so that everything is accepted.
	m = lb_m + (ub_m - lb_m) * rand(number_of_components, number_of_abc_samples)
	log10c = lb_log10c + (ub_log10c - lb_log10c) * rand(number_of_components, number_of_abc_samples)
	if model == "discrete-fixed-depth"
		az = lb_az + (ub_az - lb_az) * repmat(rand(1, number_of_abc_samples), 2)
	elseif model == "discrete-variable-depth"
		az = lb_az + (ub_az - lb_az) * rand(number_of_components, number_of_abc_samples)
	end

	w::Array{Float64, 1} = ones(number_of_abc_samples) / convert(Float64, number_of_abc_samples)
	cum_w::Array{Float64, 1} = cumsum(w)
	w_star::Array{Float64, 1} = zeros(number_of_abc_samples)
	term::Float64 = 0.0

	# Displacement standard deviations.
	tau_m::Array{Float64, 1} = zeros(number_of_components)
	tau_log10c::Array{Float64, 1} = zeros(number_of_components)
	tau_az::Array{Float64, 1} = zeros(number_of_components)
	for current_component = 1:number_of_components
		tau_m[current_component] = sqrt( 2.0 * var(m[current_component, :], corrected = false) )
		tau_log10c[current_component] = sqrt( 2.0 * var(log10c[current_component, :], corrected = false) )
		tau_az[current_component] = sqrt( 2.0 * var(az[current_component, :], corrected = false) )
	end

	number_of_simulations::Int64 = 0

	# Adaptive gamma selection
	gamma::Float64 = 0.0
	if gamma_adaptive
		@sync @parallel for current_abc_sample = 1:number_of_abc_samples
			H_sim = simulate(	model,
								m[:, current_abc_sample],
								log10c[:, current_abc_sample],
								ax,
								ay,
								az[:, current_abc_sample],
								Lx,
								Ly,
								Lz,
								number_of_frames,
								deltat,
								kmin,
								number_of_de_bins,
								ub_de)

			dist_star[current_abc_sample] = distance(H, H_sim)
		end
		gamma = median(dist_star)

		number_of_simulations = number_of_abc_samples
	else
		gamma = gamma_initial
	end

	# The rest of the iterations.
	trial_count::Int64 = 0
	is_converged::Bool = false
	number_of_iterations::Int64 = 0
	number_of_accepted_samples::Int64 = 0

	m_bis::SharedArray{Float64, 2} = zeros(number_of_components, number_of_workers)
	log10c_bis::SharedArray{Float64, 2} = zeros(number_of_components, number_of_workers)
	az_bis::SharedArray{Float64, 2} = zeros(number_of_components, number_of_workers)
	dist_bis::SharedArray{Float64, 1} = zeros(number_of_workers)

	while !is_converged
		trial_count = 0
		gamma = gamma - delta_gamma
		cum_w = cumsum(w)

		number_of_accepted_samples = 0

		while number_of_accepted_samples < number_of_abc_samples && trial_count <= number_of_abc_samples * ub_average_number_of_trials
			@sync @parallel for current_worker = 1:number_of_workers # As many as available cores/threads.
				# Randomly select sample from previous iteration.
				idx = rand_weighted_index(cum_w)
				m_prim = m[:, idx]
				log10c_prim = log10c[:, idx]
				az_prim = az[:, idx]

				# Create new candidate sample by perturbing with Gaussian displacements.
				if model == "discrete-fixed-depth"
					for current_component = 1:number_of_components
						m_bis[current_component, current_worker] = displace(m_prim[current_component], tau_m[current_component], lb_m, ub_m)
						log10c_bis[current_component, current_worker] = displace(log10c_prim[current_component], tau_log10c[current_component], lb_log10c, ub_log10c)
					end
					az_bis[1, current_worker] = displace(az_prim[1], tau_az[1], lb_az, ub_az)
					az_bis[2:end, current_worker] = az_bis[1, current_worker]
				elseif model == "discrete-variable-depth"
					for current_component = 1:number_of_components
						m_bis[current_component, current_worker] = displace(m_prim[current_component], tau_m[current_component], lb_m, ub_m)
						log10c_bis[current_component, current_worker] = displace(log10c_prim[current_component], tau_log10c[current_component], lb_log10c, ub_log10c)
						az_bis[current_component, current_worker] = displace(az_prim[current_component], tau_az[current_component], lb_az, ub_az)
					end
				end

				# Sort components by diffusion coefficient to avoid label switching problems.
				p = sortperm(m_bis[:, current_worker])
				m_bis[:, current_worker] = m_bis[p, current_worker]
				log10c_bis[:, current_worker] = log10c_bis[p, current_worker]
				az_bis[:, current_worker] = az_bis[p, current_worker]

				# Simulate and compute distance.
				H_sim = simulate(	model,
									m_bis[:, current_worker],
									10.^log10c_bis[:, current_worker]+,
									ax,
									ay,
									az_bis[:, current_worker],
									Lx,
									Ly,
									Lz,
									number_of_frames,
									deltat,
									kmin,
									number_of_de_bins,
									ub_de)

				dist_bis[current_worker] = distance(H, H_sim)

			end
			trial_count += number_of_workers

			for current_worker = 1:number_of_workers
				if dist_bis[current_worker] <= gamma && number_of_accepted_samples < number_of_abc_samples
					current_abc_sample = number_of_accepted_samples + 1
					m_star[:, current_abc_sample] = m_bis[:, current_worker]
					log10c_star[:, current_abc_sample] = log10c_bis[:, current_worker]
					az_star[:, current_abc_sample] = az_bis[:, current_worker]
					dist_star[current_abc_sample] = dist_bis[current_worker]

					number_of_accepted_samples += 1
					println(number_of_accepted_samples)
				end
			end
		end

		number_of_simulations += trial_count
		number_of_iterations += 1

		if trial_count >= number_of_abc_samples * ub_average_number_of_trials
			is_converged = true
			println("Converged.")
		end

		if !is_converged # Only compute new stuff if we are going to do one more iteration.
			if weighting_scheme == "pmc-standard"
				for current_abc_sample = 1:number_of_abc_samples
					w_star[current_abc_sample] = 0.0
					for i = 1:number_of_abc_samples
						term = 1.0
						for current_component = 1:number_of_components
							term = term * normpdf(m_star[current_component, current_abc_sample] - m[current_component, i], 0.0, tau_m[current_component])
							term = term * normpdf(log10c_star[current_component, current_abc_sample] - log10c[current_component, i], 0.0, tau_log10c[current_component])
							term = term * normpdf(az_star[current_component, current_abc_sample] - az[current_component, i], 0.0, tau_az[current_component])
						end
						w_star[current_abc_sample] = w_star[current_abc_sample] + w[i] * term
					end
					w_star[current_abc_sample] = 1.0 / w_star[current_abc_sample]
				end
				w = w_star / sum(w_star)
			elseif weighting_scheme == "inverse-distance-squared"
				w = 1 ./ dist_star.^2
				w = w / sum(w)
			end

			m = convert(Array{Float64, 2}, m_star)
			log10c = convert(Array{Float64, 2}, log10c_star)
			az = convert(Array{Float64, 2}, az_star)
			dist = convert(Array{Float64, 1}, dist_star)

			for current_component = 1:number_of_components
				tau_m[current_component] = sqrt( 2.0 * var(m[current_component, :], corrected = false) )
				tau_log10c[current_component] = sqrt( 2.0 * var(log10c[current_component, :], corrected = false) )
				tau_az[current_component] = sqrt( 2.0 * var(az[current_component, :], corrected = false) )
			end

			if model == "discrete-fixed-depth" || model == "discrete-variable-depth"
				if number_of_components == 1
					println((round(gamma, 2), trial_count, round(trial_count/number_of_abc_samples, 2) , round(mean(m), 2), round(mean(10.^log10c), 2), round(mean(az), 2)))
				elseif number_of_components == 2
					println((round(gamma, 2), trial_count, round(trial_count/number_of_abc_samples, 2), round(mean(m[1, :]), 2), round(mean(m[2, :]), 2), round(mean(10.^log10c[1, :]), 2), round(mean(10.^log10c[2, :]), 2), round(mean(az[1, :]), 2), round(mean(az[2, :]), 2)))
				end
			end
		end
	end

	gamma = gamma + delta_gamma # Save the gamma value for the last complete iteration.

	return (m, 10.^log10c, az, dist, w, gamma, number_of_iterations, number_of_simulations)
end


text:
import .CuArrays: CuArray
import .CuArrays.CUDAdrv: CuPtr, synchronize
import .CuArrays.CUDAdrv.Mem: DeviceBuffer

function Base.cconvert(::Type{MPIPtr}, buf::CuArray{T}) where T
    Base.cconvert(CuPtr{T}, buf) # returns DeviceBuffer
end

function Base.unsafe_convert(::Type{MPIPtr}, buf::DeviceBuffer)
    reinterpret(MPIPtr, buf.ptr)
end


text:
using DryRun

@testset "@dryer deactivated" begin
    DryRun.deactivate()

    f_return_value = :test

    function f(foo, bar)
        return f_return_value
    end

    function test_dryer(foo, bar)
        return @dryer f(foo, bar)
    end

    value = test_dryer(:foo, 378)

    @test value == f_return_value

end

@testset "@dryer activated" begin
    DryRun.activate()

    f_return_value = :test

    function f(foo, bar)
        return f_return_value
    end

    function test_dryer(foo, bar)
        return @dryer f(foo, bar)
    end

    mktemp() do path, io
        redirect_stdout(io) do
            value = test_dryer(:foo, 378)
        end

        seekstart(io)
        captured = read(io, String)
        @test captured == "f(:foo, 378)\n"
    end

end


text:
"""
$(SIGNATURES)

Checks for a `config.md` file in `PATHS[:src]` and uses it to set the global variables referenced
in `GLOBAL_PAGE_VARS` it also sets the global latex commands via `GLOBAL_LXDEFS`. If the configuration
file is not found a warning is shown.
"""
function process_config()::Nothing
    # read the config.md file if it is present
    config_path = joinpath(PATHS[:src], "config.md")
    if isfile(config_path)
        convert_md(read(config_path, String) * EOS; isconfig=true)
    else
        @warn "I didn't find a config file. Ignoring."
    end
    return nothing
end

"""
$(SIGNATURES)

Take a path to an input markdown file (via `root` and `file`), then construct the appropriate HTML
page (inserting `head`, `pg_foot` and `foot`) and finally write it at the appropriate place.
"""
function write_page(root::String, file::String, head::String, pg_foot::String, foot::String;
                    prerender::Bool=false, isoptim::Bool=false)::Nothing
    # 0. create a dictionary with all the variables available to the page
    # 1. read the markdown into string, convert it and extract definitions
    # 2. eval the definitions and update the variable dictionary, also retrieve
    # document variables (time of creation, time of last modif) and add those
    # to the dictionary.
    jd_vars = merge(GLOBAL_PAGE_VARS, copy(LOCAL_PAGE_VARS))
    fpath   = joinpath(root, file)
     # The curpath is the relative path starting after /src/ so for instance:
     # f1/blah/page1.md or index.md etc... this is useful in the code evaluation and management
     # of paths
    CUR_PATH[] = fpath[lastindex(PATHS[:src])+length(PATH_SEP)+1:end]

    (content, jd_vars) = convert_md(read(fpath, String) * EOS, collect(values(GLOBAL_LXDEFS)))

    # adding document variables to the dictionary
    # note that some won't change and so it's not necessary to do this every time
    # but it takes negligible time to do this so ¯\_(ツ)_/¯ (and it's less annoying
    # than keeping tabs on which file has already been treated etc).
    s = stat(fpath)
    set_var!(jd_vars, "jd_ctime", jd_date(unix2datetime(s.ctime)))
    set_var!(jd_vars, "jd_mtime", jd_date(unix2datetime(s.mtime)))
    set_var!(jd_vars, "jd_rpath", CUR_PATH[])

    # 3. process blocks in the html infra elements based on `jd_vars`
    # (e.g.: add the date in the footer)
    content = convert_html(str(content), jd_vars)
    head, pg_foot, foot = (e->convert_html(e, jd_vars)).([head, pg_foot, foot])

    # 4. construct the page proper & prerender if needed
    pg = build_page(head, content, pg_foot, foot)
    if prerender
        # KATEX
        pg = js_prerender_katex(pg)
        # HIGHLIGHT
        if JD_CAN_HIGHLIGHT
            pg = js_prerender_highlight(pg)
            # remove script
            pg = replace(pg, r"


text:
function get_atlas(;
        timestep=0.01,
        gravity=-9.81,
        friction_coefficient=0.8,
        spring=0.0,
        damper=0.0,
        contact_feet=true,
        contact_body=false,
        model_type=:simple,
        T=Float64)

    path = joinpath(@__DIR__, "../deps/atlas_$(string(model_type)).urdf")
    mech = Mechanism(path, !(model_type==:armless), T,
        gravity=gravity,
        timestep=timestep,
        spring=spring,
        damper=damper)

    # Adding springs and dampers
    for joint in mech.joints[2:end]
        joint.damper = true
        joint.spring = true
        joint.translational.spring=spring
        joint.translational.damper=damper
        joint.rotational.spring=spring
        joint.rotational.damper=damper
    end

    origin = Origin{T}()
    bodies = mech.bodies
    eqs = mech.joints

    contacts = ContactConstraint{T}[]

    if contact_feet
        # Foot contact
        locations = [
            [-0.08; -0.04; 0.015],
            [+0.12; -0.02; 0.015],
            [-0.08; +0.04; 0.015],
            [+0.12; +0.02; 0.015],
            ]
        n = length(locations)
        normal = [[0.0; 0.0; 1.0] for i = 1:n]
        contact_radius = [0.025 for i = 1:n]
        friction_coefficients = friction_coefficient * ones(T, n)

        names = ["RR", "FR", "RL", "RR"]

        foot_contacts1 = contact_constraint(get_body(mech, :l_foot), normal,
            friction_coefficient=friction_coefficients,
            contact_origins=locations,
            contact_radius=contact_radius,
            names=[Symbol("l_" .* name) for name in names])
        foot_contacts2 = contact_constraint(get_body(mech, :r_foot), normal,
            friction_coefficient=friction_coefficients,
            contact_origins=locations,
            contact_radius=contact_radius,
            names=[Symbol("r_" .* name) for name in names])
        contacts = [contacts..., foot_contacts1..., foot_contacts2...]
    end

    if contact_body
        # Hands
        location = [0.0; 0.0; 0.0]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.06
        name = "hand"

        push!(contacts, contact_constraint(get_body(mech, :l_hand), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol("l_" .* name)))
        push!(contacts, contact_constraint(get_body(mech, :r_hand), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol("r_" .* name)))

        # knee
        location = [0.025; 0.0; 0.175]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.075
        name = "knee"

        push!(contacts, contact_constraint(get_body(mech, :l_lleg), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol("l_" .* name)))
        push!(contacts, contact_constraint(get_body(mech, :r_lleg), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol("r_" .* name)))

        # clavicals
        location_l = [0.0; -0.05; -0.075]
        location_r = [0.0; -0.05; -0.075]

        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.11
        name = "clav"

        push!(contacts, contact_constraint(get_body(mech, :l_clav), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location_l,
            contact_radius=contact_radius,
            name=Symbol("l_" .* name)))
        push!(contacts, contact_constraint(get_body(mech, :r_clav), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location_r,
            contact_radius=contact_radius,
            name=Symbol("r_" .* name)))

        # pelvis
        location = [0.0; 0.0; 0.05]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.19
        name = "pelvis"

        push!(contacts, contact_constraint(get_body(mech, :pelvis), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol(name)))

        # elbow
        location = [0.0; -0.185; 0.0]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.085
        name = "elbow"

        push!(contacts, contact_constraint(get_body(mech, :l_uarm), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol("l_" .* name)))
        push!(contacts, contact_constraint(get_body(mech, :r_uarm), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol("r_" .* name)))

        # head
        location = [0.0; 0.0; 0.0]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.175
        name = "head"

        push!(contacts, contact_constraint(get_body(mech, :head), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol(name)))

        # backpack
        location = [-0.095; 0.0; 0.25]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.15
        name = "backpack_bottom"

        push!(contacts, contact_constraint(get_body(mech, :utorso), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol(name)))

        location = [-0.095; 0.0; -0.2]
        normal = [0.0; 0.0; 1.0]
        contact_radius = 0.15
        name = "backpack_top"

        push!(contacts, contact_constraint(get_body(mech, :utorso), normal,
            friction_coefficient=friction_coefficient,
            contact_origin=location,
            contact_radius=contact_radius,
            name=Symbol(name)))
    end

    set_minimal_coordinates!(mech, get_joint(mech, :floating_base), [0.0; 0.0; 0.9385; 0.0; 0.0; 0.0])

    mech = Mechanism(origin, bodies, eqs, contacts,
        gravity=gravity,
        timestep=timestep,
        spring=spring,
        damper=damper)

    return mech
end

function initialize_atlas!(mechanism::Mechanism;
    model_type=:simple,
    body_position=[0.0, 0.0, 0.2],
    body_orientation=[0.0, 0.0, 0.0],
    link_linear_velocity=[zeros(3)  for i=1:length(mechanism.bodies)],
    link_angular_velocity=[zeros(3) for i=1:length(mechanism.bodies)],
    hip_orientation=0.0,
    knee_orientation=0.0) where T

    body_position += (model_type == :armless) ? [0.0, 0.0, 0.9385 + 0.14853] : [0.0, 0.0, 0.9385]

    # positions
    try
        set_minimal_coordinates!(mechanism,
                get_joint(mechanism, :floating_base),
                [body_position; body_orientation])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :back_bkxyz), [0.0, 0.0, 0.0])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :l_leg_hpxyz), [0.0, -hip_orientation, 0.0])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :r_leg_hpxyz), [0.0, -hip_orientation, 0.0])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :l_leg_kny), [knee_orienation])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :r_leg_kny), [knee_orienation])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :l_leg_akxy), [hip_orientation-knee_orienation, 0.0])
        set_minimal_coordinates!(mechanism, get_joint(mechanism, :r_leg_akxy), [hip_orientation-knee_orienation, 0.0])
    catch
        nothing
    end

    zero_velocity!(mechanism)

    return nothing
end

function initialize_atlas_stance!(mech::Mechanism;
    body_position=[0.0, 0.0, 0.2],
    body_orientation=[0.0, 0.0, 0.0],
    link_linear_velocity=[zeros(3)  for i=1:length(mech.bodies)],
    link_angular_velocity=[zeros(3) for i=1:length(mech.bodies)],
    hip_orientation=0.0,
    knee_orienation=0.0) where T

    body_position += [0.0, 0.0, 0.9385]

    # positions
    try
        set_minimal_coordinates!(mech, get_joint(mech, :floating_base), [body_position; body_orientation])

        # set_minimal_coordinates!(mech, get_joint(mech, :l_leg_hpxyz), [0.0, -hip_orientation, 0.0])
        # set_minimal_coordinates!(mech, get_joint(mech, :r_leg_hpxyz), [0.0, -hip_orientation, 0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :l_leg_kny), [knee_orienation])
        set_minimal_coordinates!(mech, get_joint(mech, :r_leg_kny), [knee_orienation])
        # set_minimal_coordinates!(mech, get_joint(mech, :l_leg_akxy), [hip_orientation - knee_orienation, 0.0])
        # set_minimal_coordinates!(mech, get_joint(mech, :r_leg_akxy), [hip_orientation - knee_orienation, 0.0])

        set_minimal_coordinates!(mech, get_joint(mech, :back_bkx), [0.0  * π])
        set_minimal_coordinates!(mech, get_joint(mech, :back_bky), [0.04 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :back_bkz), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :l_arm_elx), [0.25 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :l_arm_ely), [0.5 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :l_arm_shx), [-0.5 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :l_arm_shz), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :l_arm_mwx), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :l_arm_uwy), [0.0 * π])
        # set_minimal_coordinates!(mech, get_joint(mech, :l_arm_lwy), [0.0])
        # set_minimal_coordinates!(mech, get_joint(mech, :l_leg_akx), [0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :l_leg_aky), [-0.1 * π])
        # set_minimal_coordinates!(mech, get_joint(mech, :l_leg_hpx), [0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :l_leg_hpy), [-0.1 * π])
        # set_minimal_coordinates!(mech, get_joint(mech, :l_leg_hpz), [0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :l_leg_kny), [0.2 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :neck_ay), [0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_elx), [-0.25 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_ely), [0.5 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_shx), [0.5 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_shz), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_mwx), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_uwy), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_arm_lwy), [0.0 * π])
        # set_minimal_coordinates!(mech, get_joint(mech, :r_leg_akx), [0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :r_leg_aky), [-0.1 * π])
        # set_minimal_coordinates!(mech, get_joint(mech, :r_leg_hpx), [0.0])
        set_minimal_coordinates!(mech, get_joint(mech, :r_leg_hpy), [-0.1 * π])
        # set_minimal_coordinates!(mech, get_joint(mech, :r_leg_hpz), [0.0 * π])
        set_minimal_coordinates!(mech, get_joint(mech, :r_leg_kny), [0.2 * π])
    catch
        nothing
    end

    zero_velocity!(mech)

    return nothing
end


text:
using CommonLH, Test

function compare_test()
	@testset "Comparisons" begin
		x = [1.0 1.1 1.2; 2.0 2.1 2.2];
		@test any_greater(x, 2.1999)
		@test !any_greater(x, 2.2)
		@test !any_greater(x, 2.1999; atol = 0.001)

		@test any_less(x, 1.001)
		@test !any_less(x, 1.0)
		@test !any_less(x, 1.0001; atol = 0.001)

		@test all_greater(x, 0.9999)
		@test !all_greater(x, 1.0)
		@test all_greater(x, 1.0; atol = 0.0001)

		@test all_less(x, 2.2001)
		@test !all_less(x, 2.2)
		@test all_less(x, 2.2; atol = 0.0001)

		@test all_greater(x, x .- 0.001)
		@test !all_greater(x, x)
		@test all_greater(x, x .- 0.001; atol = 0.003)

		@test all_less(x, x .+ 0.001)
		@test !all_less(x, x)
		@test all_less(x, x .+ 0.001; atol = 0.003)
	end
end

function bisecting_test()
	@testset "Bisecting indices" begin
		println("Bisecting indices")
		@test bisecting_indices(1, 1) == [1]
		@test bisecting_indices(2, 3) == [2, 3]
		@test bisecting_indices(12, 14) == [12, 14, 13]
		@test bisecting_indices(12, 16) == [12, 16, 14, 13, 15]

		@test sort(bisecting_indices(12, 35)) == collect(12 : 35)
	end
end

function find_indices_test()
	@testset "find_indices" begin
		gridV = collect(2 : 2 : 10);

		# All on the grid
		valueV = [2, 10];
		idxV = @inferred find_indices(valueV, gridV);
		@test idxV == [1, length(gridV)]

		# Top above the grid
		idxV = find_indices([2, 6, 11], gridV);
		@test idxV == [1, 3, 0]

		# All below the grid
		idxV = find_indices([-3, 0], gridV);
		@test idxV == [0, 0]

		# Above and below the grid
		idxV = find_indices([0, 4, 11], gridV);
		@test idxV == [0, 2, 0]

		# Scalar input
		idxV = find_indices(4, gridV);
		@test length(idxV) == 1
		@test gridV[idxV[1]] == 4

		idx = find_index(4, gridV);
		@test isa(idx, Integer)
		@test gridV[idx] == 4
	end
end

# @testset "VectorLH" begin
# 	@testset "count_bool" begin
# 		xV = [true, false, true, false];
# 		@test countbool(xV) == 2
# 	end

# 	@testset "count_elem" begin
# 		omitNan = true;
# 		xV = [7,1,3,1,1,3,4,NaN];
# 		countM = count_elem(xV, omitNan);
# 		@test countM == [1 3;  3 2; 4 1; 7 1]

# 		xV = [7,1,3,1,1,3,4];
# 		countV = count_indices(xV);
# 		@test countV == [3, 0, 2, 1, 0, 0, 1]
# 	end

# 	@testset "counts_from_fractions" begin
# 		fracV = [0.21, 0.0, 0.79];
# 		n = 17;
# 		countV = counts_from_fractions(fracV, n, dbg = true);
# 		@test countV == [4, 0, 13]
# 	end

# 	@testset "counts_to_indices" begin
# 		countV = [1, 0, 2, 0];
# 		outV = counts_to_indices(countV, dbg = true);
# 		@test outV[1] == [1, 1]
# 		@test isempty(outV[2])
# 		@test outV[3] == [2, 3]
# 		@test isempty(outV[4])

# 		out2V = counts_to_indices([0, 0], dbg = true);
# 		@test (isempty(out2V[1]) && isempty(out2V[2]))
# 	end

# 	@testset "scale_vector" begin
# 		v = collect(1 : 0.1 : 2);
# 		v2 = copy(v);
# 		scale_vector!(v2, dbg = true);
# 		@test v2 ≈ v

# 		v2 = copy(v);
# 		scale_vector!(v2, xMin = 1.05, xMax = 1.8, dbg = true);
# 		@test validate_vector(v2, xMin = 1.05, xMax = 1.8);

# 		v2 = copy(v);
# 		scale_vector!(v2, xMin = 1.05, xMax = 1.8, vSum = 15.0, dbg = true);
# 		# Cannot guarantee bounds when a sum is given
# 		@test validate_vector(v2, vSum = 15.0);
# 	end
# end

@testset "vectorLH" begin
	println("Test set vectorLH")
	find_indices_test()
	bisecting_test();
	compare_test();
end

# ----------


text:
# p is number of features
# S is number of epochs
function sgd(loss::Function, grad!::Function, data::Matrix, theta::Vector, config::Dict, diagnostics::HDF5Group)
  @printf("===== running the stochastic gradient method =====\n")
  n = size(data, 2)
  theta = copy(theta)
  dtheta = Array(Float64, length(theta))
  eta = config["stepsize"]
  S = config["epochs"]
  verbose = true
  T = S*n
  for t in 1:T
    eta_t = eta / sqrt(t)
    fill!(dtheta, 0.0)
    index = rand(1:n)
    grad!(vec(data[:,index]), theta, config["lambda"], dtheta)
    if verbose && mod(t, n) == 0
      l = loss(data, theta, config["lambda"])
      @printf "%4d | %9.4E \n" t/n l
      diagnostics[@sprintf "%04d" t/n] = l
    end
    theta -= eta_t * dtheta
  end
  return theta
end

max_stars_repo_name: pcmoritz/slbfgs

max_issues_repo_name: pcmoritz/slbfgs

max_forks_repo_name: pcmoritz/slbfgs


text:
using Test

for testscen in 1:2
    valdir, scenario, use_permafrost, use_seaice = get_scenario(testscen)
    println(scenario)

    m = page_model()
    include("../src/components/Discontinuity.jl")

    add_comp!(m, Discontinuity)

    set_param!(m, :Discontinuity, :rt_g_globaltemperature, readpagedata(m, "test/validationdata/$valdir/rt_g_globaltemperature.csv"))
    ##set_param!(m, :Discontinuity, :rt_g_globaltemperature, [0.75,0.77,0.99,1.27,1.62,1.99,3.07,3.90,5.10,6.03])
    set_param!(m, :Discontinuity, :y_year_0, 2015.)
    set_param!(m, :Discontinuity, :y_year, [2020, 2030, 2040, 2050, 2075, 2100, 2150, 2200, 2250, 2300])
    set_param!(m, :Discontinuity, :rgdp_per_cap_NonMarketRemainGDP, readpagedata(m, "test/validationdata/$valdir/rgdp_per_cap_NonMarketRemainGDP.csv"))
    set_param!(m, :Discontinuity, :rcons_per_cap_NonMarketRemainConsumption, readpagedata(m, "test/validationdata/$valdir/rcons_per_cap_NonMarketRemainConsumption.csv"))
    set_param!(m, :Discontinuity, :wincf_weightsfactor_sea, readpagedata(m, "data/wincf_weightsfactor_sea.csv"))
    set_param!(m, :Discontinuity, :isatg_saturationmodification, 28.333333333333336)
    ##running Model
    run(m)

    @test !isnan(m[:Discontinuity, :irefeqdis_eqdiscimpact][8])
    @test !isnan(m[:Discontinuity, :igdpeqdis_eqdiscimpact][10,8])
    @test !isnan(m[:Discontinuity, :igdp_realizeddiscimpact][10,8])
    @test !isnan(m[:Discontinuity, :occurdis_occurrencedummy][10])
    @test !isnan(m[:Discontinuity, :expfdis_discdecay][10])
    @test !isnan(m[:Discontinuity, :idis_lossfromdisc][10])
    @test !isnan(m[:Discontinuity, :isat_satdiscimpact][10,8])
    @test !isnan(m[:Discontinuity, :isat_per_cap_DiscImpactperCapinclSaturation][10,8])
    @test !isnan(m[:Discontinuity, :rcons_per_cap_DiscRemainConsumption][10])

    #validating - comparison spreadsheet has discontinuity occuring in 2200
    #keep running model until m[:Discontinuity,:occurdis_occurrencedummy] shows discontiuity occuring in 2200
    output=m[:Discontinuity,:rcons_per_cap_DiscRemainConsumption]
    validation=readpagedata(m,"test/validationdata/$valdir/rcons_per_cap_DiscRemainConsumption.csv")

    @test output ≈ validation rtol=1e-2
end

max_stars_repo_name: lrennels/PAGE-ICE

max_issues_repo_name: lrennels/PAGE-ICE

max_forks_repo_name: lrennels/PAGE-ICE


text:
module Encode
include("constant.jl")

using Printf
using .Constant: NONO_SIZE

"""
Encode the clues with random distributing the "availableBlock"(empty space) to the clues\n
If "availableBlock" are enough to give each clues, "preserves" will provide least block(s) to each clues\n
If need to perform incompletely distribution(also "availableBlock" > 0), "denominatorExtends" will increase the loss chance\n
If "isReversed" is true, all blocks will be reversed order\n
Return permutated clues and if it is determined exactly one(according to "availableBlock", which subtracted by preserves),
    return true(to prevent from unnecessarily repeating encoding)

*** Example => block = 'b', clue = 'c', availableBlock = 10(calculated), '1' is necessary interval(excluded from blocks) ***
Generate initial clue:
    if `preserves == 0`:
        c 1 c 1 c
    if `preserves == 1`:
        b c 1 b c 1 b c
Stage on encode:
    assume staged = b c 1 b c 1 b c, availableBlock => 10 - 3 = 7:
        without denominatorExtends:
            may rolled to be: b b b b c 1 b b c 1 b b b b c ''(no back block)
        with denominatorExtends:
            may rolled to be: b b c 1 b b c 1 b b b b c 'b b'(have back blocks)
Final result in return:
    assume encoded = b b b c 1 b c 1 b b b b c b b
        if `isReversed == true`:
            b b c 1 b b b b c 1 b c b b b

`Noted: if denominatorExtends is 1, the distribution is most equality`
"""
function dist_random_encode!(clues::Array{Int,1}, preserves::Int, denominatorExtends::Int, isReversed::Bool = false)::Tuple{UInt128,Bool}
    len = length(clues)
    availPreserve, availableBlock = __get_available_status(len, sum(clues), preserves)
    blocks = fill(availPreserve, len)
    # choose index of blocks to push value
    for i in rand(1:(len + denominatorExtends), availableBlock)
        if i > len
            continue
        end
        blocks[i] += 1
    end
    return __get_result!(clues, blocks, availableBlock - sum(blocks), isReversed), (availableBlock == 0)
end

"""
Encode the clues with step by step and fill them in permutations, the first will get rolled blocks from "availableBlock",
    and remained "availableBlock" will give to next one to roll\n
If "availableBlock" are enough to give each clues, "preserves" will provide least block(s) to each clues\n
If "isLastTakeRemains" are true, the last clue will take all of the remained "availableBlock"\n
If "isReversed" is true, all blocks will be reversed order\n
Return permutated clues and if it is determined exactly one(according to "availableBlock", which subtracted by preserves),
    return true(to prevent from unnecessarily repeating encoding)

*** Example => block = 'b', clue = 'c', availableBlock = 10(calculated), '1' is necessary interval(excluded from blocks) ***
Generate initial clue:
    if `preserves == 0`:
        c 1 c 1 c
    if `preserves == 1`:
        b c 1 b c 1 b c
Stage on encode:
    assume staged = c 1 c 1 c, remainBlock = availableBlock = 10:
        first clue takes roll from 0 ~ 10 => 6:
            => b b b b b b c 1 c 1 c => remainBlock - 6 = 4
        second clue takes roll from 0 ~ 4 => 1:
            => b b b b b b c 1 b c 1 c => remainBlock - 1 = 3
        last clue takes:
        if `isLastTakeRemains` => takes all:
            => b b b b b b c 1 b c 1 b b b c ''(no back block)
        if `not isLastTakeRemains` => takes roll from 0 ~ 3 => 2:
            => b b b b b b c 1 b c 1 b b c 'b'(remainBlock - 2 = '1' back block)
Final result in return:
    assume encoded = b b b c 1 b c 1 b b b b c b b
        if use `isReversed`:
            b b c 1 b b b b c 1 b c b b b

`Noted: this encode method is not an equality distribution, it may tend to the first to having more blocks`
"""
function step_random_encode!(clues::Array{Int,1}, preserves::Int, isLastTakeRemains::Bool, isReversed::Bool = false)::Tuple{UInt128,Bool}
    len = length(clues)
    availPreserve, availableBlock = __get_available_status(len, sum(clues), preserves)
    blocks = fill(availPreserve, len)
    remainBlock = availableBlock
    # step by step to fill blocks from remained blocks
    for i in 1:len
        if remainBlock == 0
            break
        end
        fillBlock = ((i == len && isLastTakeRemains) ? remainBlock : rand(0:remainBlock))
        blocks[i] += fillBlock
        remainBlock -= fillBlock
    end
    return __get_result!(clues, blocks, remainBlock, isReversed), (availableBlock == 0)
end

function __get_available_status(length::Int, sum::Int, expectPreserve::Int)::Tuple{Int,Int}
    # calc the remain blocks in clues
    availableBlock = NONO_SIZE - sum - (length - 1)
    while availableBlock < expectPreserve * length && expectPreserve > 0
        expectPreserve -= 1
        # debug feature
        # println(@sprintf("Restricting preserves value to %d.", preserves))
    end
    availableBlock -= expectPreserve * length
    # available preserves and available blocks
    return expectPreserve, availableBlock
end

function __get_result!(clues::Array{Int,1}, blocks::Array{Int,1}, remainBlock::Int, isReversed::Bool)::UInt128
    result = UInt128(0)
    len = length(clues)
    push!(blocks, remainBlock)
    if isReversed
        reverse!(blocks)
    end
    for (i, clue) in enumerate(clues)
        result = (result << (blocks[i] + clue + 1)) | ((UInt128(1) << clue) - 1)
    end
    return (result << last(blocks))
end
end


text:
using Bridge
using Random
using DataFrames
using CSV
using BridgeSDEInference

# Home directory ".../BridgeSDEInference"
OUT_DIR ="./output"
mkpath(OUT_DIR)
FILENAME_OUT = joinpath(OUT_DIR, "jr_path_part_obs_3n.csv")

### parameters as Table 1  of
# https://mathematical-neuroscience.springeropen.com/articles/10.1186/s13408-017-0046-4
P = JRNeuralDiffusion3n(3.25, 100.0, 22.0, 50.0 , 135.0, 5.0, 6.0, 0.56, 0.0, 220.0, 0.0, 0.01, 2000.0, 1.0)
# starting point under :regular parametrisation

x0 = ℝ{6}(0.08, 18, 15, -0.5, 0, 0)

dt = 0.000001
T = 2.0
tt = 0.0:dt:T

Random.seed!(4)
XX, _ = simulate_segment(ℝ{3}(0.0, 0.0, 0.0), x0, P, tt)

num_obs = 256*2
skip = div(length(tt), num_obs)
Time = collect(tt)[1:skip:end]
#observation x[2]- x[3]
df = DataFrame(time=Time, x1=[x[2] - x[3] for x in XX.yy[1:skip:end]])
CSV.write(FILENAME_OUT, df)

error("STOP HERE")
using Makie

p1 = Makie.scatter(df.time, df.x1,  markersize = 0.1)
axis = p1[Axis]
axis[:names][:axisnames] = ("t", "X_2 - X_3")
Makie.lines!(p1, XX.tt, [XX.yy[i][2] - XX.yy[i][3] for i in 1:length(XX.yy)], color = (:blue, 0.7))
#Makie.save("2_minus_3.png", a)

p2 = Makie.lines(XX.tt, [XX.yy[i][1] for i in 1:length(XX.yy)])
#Makie.save("1_Latent.png", a)
axis = p2[Axis]
axis[:names][:axisnames] = ("t", "X_1")

p3 = Makie.lines(XX.tt, [XX.yy[i][4] for i in 1:length(XX.yy)])
axis = p3[Axis]
axis[:names][:axisnames] = ("t", "X_4")
#Makie.save("4_latent.png", b)

p4 = Makie.lines(XX.tt, [XX.yy[i][5] for i in 1:length(XX.yy)])
axis = p4[Axis]
axis[:names][:axisnames] = ("t", "X_5")
#Makie.save("5_latent_5seconds.png", b)

p5 = Makie.lines(XX.tt, [XX.yy[i][6] for i in 1:length(XX.yy)])
axis = p5[Axis]
axis[:names][:axisnames] = ("t", "X_6")

pscene = hbox(
    vbox(p3, p5),
    p4,
    vbox(p1, p2)
)

Makie.save("./assets/simulated_data.png", pscene)