1/* BEGIN LICENSE BLOCK
2 * Version: CMPL 1.1
3 *
4 * The contents of this file are subject to the Cisco-style Mozilla Public
5 * License Version 1.1 (the "License"); you may not use this file except
6 * in compliance with the License.  You may obtain a copy of the License
7 * at www.eclipse-clp.org/license.
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11 * the License for the specific language governing rights and limitations
12 * under the License.
13 *
14 * The Original Code is  The ECLiPSe Constraint Logic Programming System.
15 * The Initial Developer of the Original Code is  Cisco Systems, Inc.
16 * Portions created by the Initial Developer are
17 * Copyright (C) 1995-2012 Cisco Systems, Inc.  All Rights Reserved.
18 *
19 * Contributor(s): Joachim Schimpf, Kish Shen and Andrew Eremin, IC-Parc
20 *
21 * END LICENSE BLOCK */
22
23/*
24 * ECLiPSe/XPRESSMP interface (for inclusion in eplex.c)
25 */
26
27#ifdef XPRESS
28
29static int
30xprs_getintattr(XPRSprob lp, int attr)
31{
32    int value;
33    XPRSgetintattrib(lp, attr, &value);
34    return value;
35}
36
37
38void XPRS_CC
39_get_xpress_sol(XPRSprob lp, void * solution)
40{
41    struct lp_sol *sol = (struct lp_sol *) solution;
42
43    XPRSgetsol(lp, sol->sols, sol->slacks, sol->pis, sol->djs);
44}
45
46
47static int
48cpx_prepare_solve(lp_desc* lpd, struct lp_meth *meth,
49	struct lp_sol *sol, double timeout)
50{
51#ifdef HAS_MIQP_CALLBACKBUG
52    /* too much trouble to support MIQP with older XPRESS with this bug;
53       the MIQP method is `not recommended' for use in these versions
54       by DASH in anycase
55    */
56    switch (lpd->prob_type)
57    {
58    case PROBLEM_MIQP:
59    case PROBLEM_FIXEDQ:
60    case PROBLEM_RELAXEDQ:
61	Fprintf(Current_Error, "Eplex error: quadratic MIP not supported for this solver because it is unstable.\n");
62	ec_flush(Current_Error);
63	return -1;
64    }
65#endif
66
67    CallN(XPRSsetintcontrol(lpd->lp, XPRS_SOLUTIONFILE, 0));
68
69    /* set up call-back to get solution state at each integer solution */
70    if (IsMIPProb(lpd->prob_type))
71    {
72	CallN(XPRSsetcbintsol(lpd->lp, _get_xpress_sol, (void *)sol));
73    }
74
75    if (timeout >= 0.0)
76    {
77	/* 0 is no timeout, negative for desired semantics */
78	int timeout_i;
79	timeout = ceil(timeout);	/* avoid round to zero and overflow */
80	timeout_i = timeout > INT_MAX ? INT_MAX : (int)timeout;
81	Log1(XPRSsetintcontrol(lpd->lp, XPRS_MAXTIME, %d), -timeout_i);
82	XPRSsetintcontrol(lpd->lp, XPRS_MAXTIME, -timeout_i);
83    }
84
85    /* meth, auxmeth, node_meth are kept upto-date as they may be required
86       to determine the actual method used to solve the problem
87    */
88    switch (meth->meth)
89    {
90    case METHOD_DEFAULT:        meth->meth_string = "";  break;
91    case METHOD_PRIMAL:		meth->meth_string = "p"; break;
92    case METHOD_DUAL:
93	if (IsQPProb(lpd->prob_type))
94	{
95	    Fprintf(Current_Error,
96		    "Eplex warning: Dual Simplex method not available to solve a quadratic"
97		    " problem for Xpress MP. Using Primal instead.\n");
98	    ec_flush(Current_Error);
99	    meth->meth_string = "p";
100	    meth->meth = METHOD_PRIMAL;
101	} else	meth->meth_string = "d";
102	break;
103    case METHOD_BAR:
104        meth->meth_string = "b";
105	switch (meth->auxmeth)
106	{
107	default:
108	case METHOD_DUAL:
109	    Fprintf(Current_Error,
110		    "Eplex warning: Specified crossover method unavilable for"
111		    " barrier method. Using Primal instead.\n");
112	    ec_flush(Current_Error);
113	case METHOD_DEFAULT:
114	    meth->auxmeth = METHOD_PRIMAL;
115	case METHOD_PRIMAL:
116	    /* Richard Laundy says primal Simplex is used to do crossover */
117	    XPRSsetintcontrol(lpd->lp, XPRS_CROSSOVER, 1);
118	    break;
119	case METHOD_NONE:
120	    switch (lpd->prob_type)
121	    {
122	    default:
123		XPRSsetintcontrol(lpd->lp, XPRS_CROSSOVER, 0);
124		break;
125	    case PROBLEM_MIP:
126	    case PROBLEM_FIXEDL:
127	    case PROBLEM_MIQP:
128	    case PROBLEM_FIXEDQ:
129		/* according to Richard Laundy @ DASH, 2004-03-26,
130                   turning off CROSSOVER for MIP case would lead to problems
131		*/
132		Fprintf(Current_Error,
133			"Eplex warning: For MIP problems, crossover must be "
134                        "enabled for barrier method. Using Primal crossover.\n");
135		ec_flush(Current_Error);
136		XPRSsetintcontrol(lpd->lp, XPRS_CROSSOVER, 1);
137		meth->auxmeth = METHOD_PRIMAL;
138		break;
139	    }
140	    break;
141	}
142	break;
143    default:
144	Fprintf(Current_Error, "Eplex warning: Specified method unavilable for"
145		    " solver. Using default instead.\n");
146	ec_flush(Current_Error);
147	meth->meth_string = "";
148	meth->meth = METHOD_DEFAULT;
149	break;
150    }
151
152    /* ignore node_auxmeth */
153    switch (meth->node_meth)
154    {
155    case METHOD_DEFAULT:        meth->node_meth_string = "g";  break;
156    case METHOD_PRIMAL:		meth->node_meth_string = "gp"; break;
157    case METHOD_DUAL:
158	if (IsQPProb(lpd->prob_type))
159	{
160	    Fprintf(Current_Error,
161		    "Eplex warning: Dual Simplex method not available to solve a quadratic"
162		    " problem for Xpress MP. Using Primal instead.\n");
163	    ec_flush(Current_Error);
164	    meth->meth_string = "gp";
165	    meth->node_meth = METHOD_PRIMAL;
166	} else	meth->meth_string = "gd";
167	break;
168    case METHOD_BAR:            meth->node_meth_string = "gb"; break;
169    default:
170	Fprintf(Current_Error, "Eplex warning: Specified node method unavilable for"
171		    " solver. Using default instead.\n");
172	ec_flush(Current_Error);
173	meth->node_meth_string = "";
174	meth->node_meth = METHOD_DEFAULT;
175	break;
176    }
177    return 0;
178}
179
180
181static int
182_mip_opt(lp_desc * lpd, struct lp_meth *meth, void * solution)
183{
184    int res;
185    struct lp_sol *sol = (struct lp_sol *) solution;
186
187    /* can use same probname as we are not going to solve using the original */
188    if (lpd->copystatus != XP_COPYOFF)
189    {
190	/* XPRScopyprob() should cleanup any existing problem
191	   According to Michael Perregaard@DASH, XPRScopycontrols() is
192	   no longer needed after an XPRScopyprob() in Xpress 14+, as
193	   controls are copied by the copyprob
194	*/
195	CallN(XPRScopyprob(lpd->lpcopy, lpd->lp, lpd->probname));
196	CallN(XPRScopycontrols(lpd->lpcopy, lpd->lp));
197	CallN(XPRScopycallbacks(lpd->lpcopy, lpd->lp));
198	lpd->copystatus = XP_COPYCURRENT;
199    }
200    else
201    {/* this turns off operations which might delete columns, to avoid
202	the problem of bounds being sent to the wrong column
203     */
204	XPRSsetintcontrol(lpd->lp, XPRS_PRESOLVEOPS,86);
205    }
206
207
208    /* the global optimisation is broken down into getting the initial
209       root LP relaxation and subsequent MIP so that the basis for
210       the root node can be obtained: this should be better than a solution
211    */
212    CallN(XPRSscale(lpd->lp, NULL, NULL));
213    if (lpd->sense == SENSE_MIN)
214    {
215
216	Log1(XPRSminim(lpd->lpcopy, "%s"), meth->meth_string);
217	res = XPRSminim(lpd->lpcopy, meth->meth_string);
218	if (res == 0)
219	{
220	    /* proceed with the global solve only if there is an optimal LP:
221	       otherwise the XPRS_MIPSTATUS loses its XPRS_MIP_LP_NOT_OPTIMAL
222               status when XPRSminim is called again
223	    */
224	    XPRSgetintattrib(lpd->lpcopy, XPRS_MIPSTATUS, &lpd->sol_state);
225	    if (lpd->sol_state != XPRS_MIP_LP_NOT_OPTIMAL)
226	    {
227		if (sol->cbase != NULL)
228		    XPRSgetbasis(lpd->lpcopy, sol->rbase, sol->cbase);
229		Log1(XPRSminim(lpd->lpcopy, "%s"), meth->node_meth_string);
230		res = XPRSminim(lpd->lpcopy, meth->node_meth_string);
231	    }
232	}
233    }
234    else
235    {
236	Log1(XPRSmaxim(lpd->lpcopy, "%s"), meth->meth_string);
237	res = XPRSmaxim(lpd->lpcopy, meth->meth_string);
238	if (res == 0)
239	{
240	    XPRSgetintattrib(lpd->lpcopy, XPRS_MIPSTATUS, &lpd->sol_state);
241	    if (lpd->sol_state != XPRS_MIP_LP_NOT_OPTIMAL)
242	    {
243		if (sol->cbase != NULL)
244		    XPRSgetbasis(lpd->lpcopy, sol->rbase, sol->cbase);
245		Log1(XPRSmaxim(lpd->lpcopy, "%s"), meth->node_meth_string);
246		res = XPRSmaxim(lpd->lpcopy, meth->node_meth_string);
247	    }
248	}
249    }
250    return res;
251}
252
253
254static int
255cpx_solve(lp_desc* lpd, struct lp_meth *meth, struct lp_sol *sol,
256	double* bestbound, double* worstbound)
257{
258    int res;
259
260    switch (lpd->prob_type)
261    {
262
263	case PROBLEM_FIXEDL:
264	case PROBLEM_FIXEDQ:
265	{
266	    int status;
267	    char c[1];
268	    double * oldsols;
269
270	    if (lpd->copystatus == XP_COPYOFF)
271	    {
272		return -1;
273	    }
274	    if (lpd->copystatus == XP_COPYCURRENT)
275	    {
276		XPRSgetintattrib(lpd->lpcopy, XPRS_MIPSTATUS, &status);
277		if (status == XPRS_MIP_OPTIMAL)
278		    oldsols = sol->oldsols;
279	    }
280	    else
281		status = XPRS_MIP_NOT_LOADED;
282	    if (status != XPRS_MIP_OPTIMAL)
283	    {/* solve the MIP first (no cutpool cstrs) */
284		CallN(XPRSsetcbintsol(lpd->lp, _get_xpress_sol, (void *)sol));
285		if (lpd->lpcopy == lpd->lp) CallN(XPRScreateprob(&lpd->lpcopy));
286		res = _mip_opt(lpd, meth, (void *)sol);
287		oldsols = sol->sols;
288		XPRSgetintattrib(lpd->lpcopy, XPRS_MIPSTATUS, &status);
289	    }
290
291	    /* solve the fixed LP if we have an optimal MIP */
292	    if (status == XPRS_MIP_OPTIMAL)
293	    {
294		int i;
295# ifdef HAS_MIQP_FIXEDCOPYBUG
296	   /* According to Richard Laundy@Dash, 2004-10-01, copying a prob.
297	      that originally has quadratic coeffs which has been zeroed
298	      (in our case because of a probe's linear objective) lead
299	      to the crash when trying to fix the columns.
300	      To work round this, we always put in a dummy
301	      quadratic term before copying, and remove it afterwards.
302	      This is only needed for changing quad. obj -> linear obj,
303	      but we can't determine this easily.
304	   */
305		if (lpd->prob_type == PROBLEM_FIXEDL) XPRSchgqobj(lpd->lp, 0, 0, 1.0);
306# endif
307		CallN(XPRScopyprob(lpd->lpcopy, lpd->lp, lpd->probname));
308		CallN(XPRScopycontrols(lpd->lpcopy, lpd->lp));
309		CallN(XPRScopycallbacks(lpd->lpcopy, lpd->lp));
310# ifdef HAS_MIQP_FIXEDCOPYBUG
311		/* now remove the dummy quadratic term */
312		if (lpd->prob_type == PROBLEM_FIXEDL)
313		{
314		    XPRSchgqobj(lpd->lpcopy, 0, 0, 0.0);
315		    XPRSchgqobj(lpd->lp, 0, 0, 0.0);
316		}
317# endif
318		lpd->copystatus = XP_COPYCURRENT;
319
320		for(i=SOLVER_MAT_BASE; i<lpd->mac; i++)
321		{
322		    XPRSgetcoltype(lpd->lpcopy, c, i, i);
323		    if (c[0] == 'I' || c[0] == 'B')
324		    {
325			Log2(
326			{\n\
327			int i = %d;\n\
328			double oldsols = %f;\n\
329			XPRSchgbounds(lpd->lpcopy, 1, &i, "B", &oldsols);\n\
330			}, i, oldsols[i]
331			    );
332			XPRSchgbounds(lpd->lpcopy, 1, &i, "B", &(oldsols[i]));
333		    }
334		}
335
336		CallN(XPRSscale(lpd->lp, NULL, NULL));
337		if (lpd->sense == SENSE_MIN)
338		{
339		    Log1(XPRSminim(lpd->lpcopy, "%s"), meth->meth_string);
340		    res = XPRSminim(lpd->lpcopy, meth->meth_string);
341		}
342		else
343		{
344		    Log1(XPRSmaxim(lpd->lpcopy, "%s"), meth->meth_string);
345		    res = XPRSmaxim(lpd->lpcopy, meth->meth_string);
346		}
347	    }
348	    break;
349	}
350
351	case PROBLEM_RELAXEDL:
352	case PROBLEM_RELAXEDQ:
353	    /* must solve a copy, as Xpress considers the MIP as started with
354	       the solving of the root node, and problem cannot be modified
355	    */
356	    if (lpd->copystatus == XP_COPYOFF)
357	    {
358		return -1;
359	    }
360	    if (lpd->lpcopy != lpd->lp)
361	    {
362		CallN(XPRScopyprob(lpd->lpcopy, lpd->lp, lpd->probname));
363		CallN(XPRScopycontrols(lpd->lpcopy, lpd->lp));
364		CallN(XPRScopycallbacks(lpd->lpcopy, lpd->lp));
365		lpd->copystatus = XP_COPYCURRENT;
366	    }
367	    CallN(XPRSscale(lpd->lp, NULL, NULL));
368	    if (lpd->sense == SENSE_MIN)
369	    {
370		Log1(XPRSminim(lpd->lpcopy,"%s"), meth->meth_string);
371		res = XPRSminim(lpd->lpcopy, meth->meth_string);
372	    }
373	    else
374	    {
375		Log1(XPRSmaxim(lpd->lpcopy,"%s"), meth->meth_string);
376		res = XPRSmaxim(lpd->lpcopy, meth->meth_string);
377	    }
378	    break;
379
380	case PROBLEM_LP:
381	    CallN(XPRSscale(lpd->lp, NULL, NULL));
382	    if (lpd->sense == SENSE_MIN)
383	    {
384		Log1(XPRSminim(lpd->lp,"%s"), meth->meth_string);
385		res = XPRSminim(lpd->lp, meth->meth_string);
386	    }
387	    else
388	    {
389		Log1(XPRSmaxim(lpd->lp,"%s"), meth->meth_string);
390		res = XPRSmaxim(lpd->lp, meth->meth_string);
391	    }
392	    break;
393
394	case PROBLEM_QP:
395	    CallN(XPRSscale(lpd->lp, NULL, NULL));
396	    if (lpd->sense == SENSE_MIN)
397	    {
398		Call(res, XPRSminim(lpd->lp, meth->meth_string));
399	    }
400	    else
401	    {
402		Call(res, XPRSmaxim(lpd->lp, meth->meth_string));
403	    }
404	    break;
405
406	case PROBLEM_MIP:
407	case PROBLEM_MIQP:
408	    res = _mip_opt(lpd, meth, (void *)sol);
409	    break;
410
411	default:
412	    return -1;
413    }
414
415    /*********************************************************************
416     *     Get State Information from External Solver                    *
417     *********************************************************************/
418
419    /* here lpcopy should be the problem that has been solved, either:
420	 a) It is the copy that is solved (MIP)
421	 b) It is the same as lp (non-MIP or if XP_COPYOFF)
422       so always obtain solution information from lpcopy
423    */
424    if (res)
425    {
426	int err;
427	char errmsg[256];
428
429	XPRSgetintattrib(lpd->lpcopy, XPRS_ERRORCODE,&err);
430	Fprintf(Current_Error, "XPRESS problem: %d\n", err);
431	XPRSgetlasterror(lpd->lpcopy, errmsg);
432	Fprintf(Current_Error, "problem: %s\n", errmsg);
433	ec_flush(Current_Error);
434    }
435    Get_Xp_Stat(lpd);
436    XPRSgetintattrib(lpd->lpcopy, XPRS_SIMPLEXITER, &lpd->sol_itcnt);
437    XPRSgetintattrib(lpd->lpcopy, XPRS_NODES, &lpd->sol_nodnum);
438
439/* Here we test for various states of the solution. The following macro tests
440are defined for all the solvers:
441  SuccessState: solution is `optimal' (may be optimal within tolerance)
442  FailState: problem is proven infeasible or no MIP solution is better
443	     than cutoff.
444  MIPSemiSuccessState: solution exist, but may be suboptimal (MIP only)
445  MIPSemiFailState: no solution found yet, but problem not proven
446		    infeasible (MIP only)
447  LPAbortedState: LP solve was aborted
448		  (for LP, or  root node LP solve for MIP (not CPLEX))
449  UnboundedState: problem is unbounded
450  MayBeFailState: problem is infeasible or unbounded, but solver cannot
451		  determine which
452*/
453
454    if (SuccessState(lpd)) {
455	lpd->descr_state = DESCR_SOLVED_SOL;
456	lpd->optimum_ctr++;
457	if (IsMIPProb(lpd->prob_type))
458	{
459	    CallN(CPXgetmipobjval(cpx_env, lpd->lpcopy, worstbound));
460	    /* bestbound may be different from objval because of tolerance */
461	    lpd->objval = *worstbound;
462	    CallN(Get_Best_Objbound(lpd->lpcopy, bestbound));
463	} else
464	{
465	    CallN(Get_LP_Objval(lpd, &lpd->objval));
466	    if (UsingBarrierNoCrossOver(lpd->lp))
467	    {
468		CallN(Get_Bar_Primal_Obj(lpd->lp, worstbound));
469		CallN(Get_Bar_Dual_Obj(lpd->lp, bestbound));
470	    } else
471	    {
472		CallN(Get_LP_Objval(lpd, bestbound));
473		*worstbound = *bestbound;
474	    }
475	}
476
477    } else if (FailState(lpd)) {
478	/* for MIP problems, the MIP search may have nodes that were not
479	   explored further because of cutoff -- i.e. they cannot lead to
480	   solutions better than the cutoff. If no solution is found, the
481	   problem is considered infeasible, but strictly it means there is
482	   no solution better than cutoff. Unfortunately, it is not easy to
483	   know if cutoff had occurred in a MIP search, so bestbound is set
484	   to cutoff unless we know otherwise
485	*/
486	if (DualMethod(lpd, meth->meth, meth->auxmeth)) {
487	    lpd->descr_state = DESCR_UNKNOWN_NOSOL;
488	    /* dual infeasible ==> primal infeasible or unbounded
489	       no information: full interval */
490	    *worstbound = (lpd->sense == SENSE_MIN ?  HUGE_VAL : -HUGE_VAL);
491	    *bestbound = (lpd->sense ==  SENSE_MIN ? -HUGE_VAL :  HUGE_VAL);
492	} else {
493	    lpd->descr_state = DESCR_SOLVED_NOSOL;
494	    *worstbound = (lpd->sense == SENSE_MIN ? -HUGE_VAL :  HUGE_VAL);
495
496	    /* In Xpress, we can get more information as we can tell if
497	       cutoff occurred at the root MIP node
498	    */
499	    if (IsMIPProb(lpd->prob_type))
500	    {
501		if (lpd->sol_state == XPRS_LP_CUTOFF) /* at root node */
502		{ /* primal or barrier - have a feasible root LP worse than
503		     cutoff */
504		    XPRSgetdblattrib(lpd->lpcopy, XPRS_MIPOBJVAL, bestbound);
505		} else if (lpd->sol_state == XPRS_LP_INFEAS)
506		{/* root is infesible => MIP is infeasible  */
507		    *bestbound = (lpd->sense ==  SENSE_MIN ?  HUGE_VAL : -HUGE_VAL);
508		} else
509		{/* safe option of returning cutoff as best bound */
510		    Get_MIPCutOff(lpd, bestbound);
511		}
512	    } else /* infeasible LP problem  */
513		/* infeasible LP for Xpress, infeasible LP/MIP for COIN */
514		*bestbound = (lpd->sense ==  SENSE_MIN ?  HUGE_VAL : -HUGE_VAL);
515
516	}
517	lpd->objval = *worstbound;
518	lpd->infeas_ctr++;
519    } else if (MIPSemiSuccessState(lpd)) {
520	lpd->descr_state = DESCR_ABORTED_SOL;
521	lpd->abort_ctr++;
522
523	CallN(Get_Best_Objbound(lpd->lpcopy, bestbound));
524	CallN(CPXgetmipobjval(cpx_env, lpd->lpcopy, worstbound));
525	lpd->objval = *worstbound;
526
527    } else if (MIPSemiFailState(lpd)) {
528    /* For Xpress and COIN, the MIPSemiFailState does not include
529       aborting/stopping at the root node solve */
530	CallN(Get_Best_Objbound(lpd->lpcopy, bestbound));
531	*worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
532
533	lpd->objval = *worstbound;
534	lpd->descr_state = DESCR_ABORTED_NOSOL;
535	lpd->abort_ctr++;
536
537    } else if (UnboundedState(lpd)) {
538	if (DualMethod(lpd, meth->meth, meth->auxmeth)) {
539	    lpd->descr_state = DESCR_SOLVED_NOSOL;
540	    lpd->infeas_ctr++;
541	    *bestbound = (lpd->sense ==  SENSE_MIN ?  -HUGE_VAL : HUGE_VAL);
542	    *worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
543	} else {
544	    lpd->descr_state = DESCR_UNBOUNDED_NOSOL;
545	    lpd->abort_ctr++;
546	    *bestbound = *worstbound = (lpd->sense == SENSE_MIN ? -HUGE_VAL : HUGE_VAL);
547	}
548	lpd->objval = *worstbound;
549
550    } else if (MaybeFailState(lpd)) {
551	lpd->descr_state = DESCR_UNKNOWN_NOSOL;
552	lpd->infeas_ctr++;
553	/* no information on bounds */
554	*worstbound = (lpd->sense == SENSE_MIN ?  HUGE_VAL : -HUGE_VAL);
555	*bestbound = (lpd->sense ==  SENSE_MIN ? -HUGE_VAL :  HUGE_VAL);
556	lpd->objval = *worstbound;
557    } else if (LPAbortedState(lpd)) {
558	/* The exact status of an aborted LP case depends on the solving
559	   method used */
560	/* Xpress can reach the LPAbortedState either when an LP
561	   solving was aborted for an LP problem, or if the root LP solve
562	   was aborted for a MIP problem
563	*/
564	int attr; /* variable for integer attribute */
565
566	/* meth is used for LP and root MIP LP */
567
568	if (meth->meth == METHOD_DEFAULT)
569	{/* turn `default' method into actual method used
570	    CAUTION: may need revising if Xpress changes the default
571	    method mapping! [they have no call to get actual method used]
572	 */
573	    int method;
574
575	    XPRSgetintcontrol(lpd->lpcopy, XPRS_DEFAULTALG, &method);
576	    switch (method)
577	    {
578	    case 1:
579		meth->meth = IsQPProb(lpd->prob_type) ? METHOD_BAR : METHOD_DUAL;
580		break;
581	    case 2: meth->meth = METHOD_DUAL; break;
582	    case 3: meth->meth = METHOD_PRIMAL; break;
583	    case 4: meth->meth = METHOD_BAR; break;
584	    }
585	}
586
587	if (IsMIPProb(lpd->prob_type))
588	{ /* MIP search aborted in root LP solve */
589	    lpd->descr_state = DESCR_ABORTED_NOSOL;
590	    lpd->objval = *worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
591	    CallN(Get_Best_Objbound(lpd->lpcopy, bestbound));
592	    if (meth->meth == METHOD_DUAL)
593	    {
594		Get_Dual_Infeas(lpd->lpcopy, &attr);
595		if (attr == 0)
596		{
597		    /* attr == 0 ==> we have a feasible dual `solution' for
598		       root node. This is superoptimal, and so can form the
599		       best bound for the MIP problem
600		    */
601		    Get_LP_Objval(lpd, bestbound);
602		}
603	    }
604	} else
605	{   /* !IsMIPProb */
606	    switch (meth->meth)
607	    {
608	    case METHOD_DUAL:
609		lpd->descr_state = DESCR_ABORTED_NOSOL;
610		Get_Dual_Infeas(lpd->lp, &attr);
611		/* attr == 0 ==> we have a feasible dual `solution' (i.e.
612		   we are in phase II of the Simplex). This
613		   is superoptimal for the original problem */
614		if (attr == 0)
615		    Get_LP_Objval(lpd, bestbound);
616		else /* no information on bestbound */
617		    *bestbound = (lpd->sense ==  SENSE_MIN ?  -HUGE_VAL : HUGE_VAL);
618		lpd->objval = *worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
619		break;
620	    case METHOD_BAR:
621	    /* In XPRESS, cross-over may be performed after aborting
622	       from a barrier solve. So we may arrive here if the
623	       cross-over (using primal simplex) was also aborted. We
624	       check if this is the case with SIMPLEXITER -- if non-zero,
625	       we fall through and treat like METHOD_PRIMAL
626	    */
627		lpd->descr_state = DESCR_ABORTED_NOSOL;
628		XPRSgetintattrib(lpd->lpcopy, XPRS_SIMPLEXITER, &attr);
629		if (attr == 0)
630		{
631		    double infeas;
632		    /* Oliver Bastert @ DASH, 2005-06 states that if the
633		       BARPRIMAL/DUAL infeasibilities are small enough,
634		       the solution can be considered primal and dual feasible
635		       respectively. Otherwise, the BARPRIMAL/DUAL objective
636		       is usually bounds on the optimal value, but this may
637		       be wrong in degenerate cases, so we don't use them
638		       here unless they are feasible
639		    */
640		    lpd->descr_state = DESCR_ABORTED_NOSOL;
641		    *bestbound = (lpd->sense ==  SENSE_MIN ?  -HUGE_VAL : HUGE_VAL);
642		    lpd->objval = *worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
643		    if (Bar_Is_Primal_Feasible(lpd))
644		    {/* primal feasible */
645			Get_Bar_Primal_Obj(lpd->lp, worstbound);
646			lpd->objval = *worstbound;
647			lpd->descr_state = DESCR_ABORTED_SOL;
648		    }
649		    if (Bar_Is_Dual_Feasible(lpd))
650		    {/* dual feasible */
651			Get_Bar_Dual_Obj(lpd->lp, bestbound);
652		    }
653		    break;
654		}
655		/* if the crossover simplex is performed, fall through and
656		   treat as primal simplex
657		*/
658	    case METHOD_PRIMAL:
659		Get_Primal_Infeas(lpd->lp, &attr);
660		/* attr == 0 ==> we have a feasible primal solution */
661		if (attr == 0)
662		{
663		    Get_LP_Objval(lpd, worstbound);
664		    lpd->objval = *worstbound;
665		    *bestbound = (lpd->sense ==  SENSE_MIN ? -HUGE_VAL :  HUGE_VAL);
666		    lpd->descr_state = DESCR_ABORTED_SOL;
667		} else
668		{
669		    lpd->descr_state = DESCR_ABORTED_NOSOL;
670		    *bestbound = (lpd->sense ==  SENSE_MIN ?  -HUGE_VAL : HUGE_VAL);
671		    lpd->objval = *worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
672		}
673		break;
674	    default:
675		/* this should not happen! */
676		Fprintf(Current_Error, "Eplex error: Unexpected method case while classifying results. Aborting.\n");
677		return -1;
678	    }
679
680	} /* !IsMIPProb() */
681
682	lpd->abort_ctr++;
683
684
685    } else {
686	/* fall back case where we don't have any information */
687	lpd->descr_state = DESCR_ABORTED_NOSOL;
688	*bestbound = (lpd->sense ==  SENSE_MIN ?  -HUGE_VAL : HUGE_VAL);
689	lpd->objval = *worstbound = (lpd->sense == SENSE_MIN ? HUGE_VAL :  -HUGE_VAL);
690    }
691
692    return 0;
693}
694
695
696static int
697cpx_get_soln_state(lp_desc* lpd, struct lp_sol *sol)
698{
699    int res;
700
701    /* if MIP callback is used, then the MIP solution state is already
702       gathered by the callbacks into the appropriate arrays for
703       the MIP case (and basis was obtained already from the root LP)
704    */
705    if (!IsMIPProb(lpd->prob_type))
706    {
707	/* using lpcopy because same as lp for LP and QP, but point at
708	   actual problem for FIXED
709	*/
710	res = XPRSgetsol(lpd->lpcopy, sol->sols, sol->slacks, sol->pis, sol->djs);
711	Log4(XPRSgetsol(lpd->lpcopy, (double *)malloc(%d*sizeof(double)),
712			(double *)malloc(%d*sizeof(double)),
713			(double *)malloc(%d*sizeof(double)),
714			(double *)malloc(%d*sizeof(double))),
715	     lpd->mac, lpd->mar, lpd->mar, lpd->mac);
716
717# ifdef HAS_POSTSOLVE
718	if (lpd->descr_state == DESCR_ABORTED_SOL)
719	    CallN(XPRSpostsolve(lpd->lp)); /* post-solve problem if possible */
720# endif
721	if ((sol->rbase || sol->cbase) && res == 0)
722	    res = XPRSgetbasis(lpd->lpcopy, sol->rbase, sol->cbase);
723	if (res)
724	    return -1;
725    }
726    return 0;
727}
728
729
730static int
731cpx_delsos(lp_desc *lpd, int from, int to)
732{
733#ifdef HAS_NO_ADDSOS
734    return UNIMPLEMENTED;
735#else
736    _grow_numbers_array(lpd, to);	/* if necessary */
737    return XPRSdelsets(lpd->lp, to-from, &lpd->numbers[from]);
738#endif
739}
740
741
742static int
743cpx_write(lp_desc *lpd, char *file, char *fmt)
744{
745    int res;
746
747    if (strcmp(fmt, "lp")==0 || strcmp(fmt, "mps")==0)
748    {
749	char *flag = strcmp(fmt,"lp")==0 ? "lp" : "p";
750
751	if (lpd->copystatus == XP_COPYCURRENT)
752	{
753	    Log2(XPRSwriteprob(lpd->lpcopy, "%s", "%s"), file, flag);
754	    res = XPRSwriteprob(lpd->lpcopy, file, flag);
755	} else
756	{
757	    Log2(XPRSwriteprob(lpd->lp, "%s", "%s"), file, flag);
758	    res = XPRSwriteprob(lpd->lp, file, flag);
759	}
760	if (res == 352)		/* not authorised in this version */
761	    res = 0;		/* ignore */
762    }
763    else if (strcmp(fmt, "svf")==0 || strcmp(fmt, "sav")==0)
764    {
765	if (strcmp(file, "") != 0)
766	{/* give a warning if a file name was given */
767	    Fprintf(Current_Error, "Eplex warning: filename %s ignored, as"
768		    " filenames cannot be given for Xpress MP's .svf format. "
769		    "The problem name %s is used instead.\n",
770		    file, lpd->probname);
771	    ec_flush(Current_Error);
772	}
773
774	if (lpd->copystatus == XP_COPYCURRENT)
775	{
776	    Call(res, XPRSsave(lpd->lpcopy));
777	} else
778	{
779	    Call(res, XPRSsave(lpd->lp));
780	}
781    }
782    else
783    	res = -1;
784
785    return res;
786}
787
788
789static int
790cpx_read(lp_desc *lpd, char *file, char *fmt)
791{
792    int res;
793
794    if (strlen(file) > XP_PROBNAME_MAX)
795    {
796	Fprintf(Current_Error, "Eplex error: filename for problem is too"
797		" long for Xpress MP.\n");
798	ec_flush(Current_Error);
799	return -1;
800    }
801
802    Call(res, XPRScreateprob(&lpd->lp));
803    if (res)
804    	return -1;
805    /* set the defaults *before* reading in the problem */
806    CallN(XPRScopycontrols(lpd->lp, cpx_env));
807
808    XPRSsetcbmessage(lpd->lp, eclipse_out, NULL);
809
810    if (strcmp(fmt,"lp")==0)
811    {
812	Call(res, XPRSreadprob(lpd->lp, file, "l"));
813    }
814    else if (strcmp(fmt,"svf")==0 || strcmp(fmt,"sav")==0)
815    {
816#if XPRESS < 20
817	Call(res, XPRSrestore(lpd->lp, file));
818#else
819	Call(res, XPRSrestore(lpd->lp, file, ""));
820#endif
821    }
822    else /* (strcmp(fmt,"mps")==0) */
823    {
824	Call(res, XPRSreadprob(lpd->lp, file, ""));
825    }
826    /* need to check for possible errors as XPress returns 0 for the
827       read functions even if a problem occurred.
828       This was suggested by Oliver Bastert @ DASH, 2004-12-08
829    */
830    if (res == 0) { XPRSgetintattrib(lpd->lp, XPRS_ERRORCODE, &res); }
831    if (res)
832    	return -1;
833
834    lpd->sense = SENSE_MIN; /* Xpress ignores the sense! */
835    CallN(XPRSgetintattrib(lpd->lp, XPRS_COLS, &(lpd->mac)));
836    CallN(XPRSgetintattrib(lpd->lp, XPRS_ROWS, &(lpd->mar)));
837    CallN(lpd->probname = (char *) Malloc((strlen(file) + 1) * sizeof(char)));
838    CallN(strcpy(lpd->probname, file));
839    {
840	int nmips, nq;
841
842	XPRSgetintattrib(lpd->lp, XPRS_MIPENTS, &nmips);
843	XPRSgetintattrib(lpd->lp, XPRS_QELEMS, &nq);
844	if (nq > 0)
845	{
846	    lpd->prob_type = (nmips == 0 ? PROBLEM_QP : PROBLEM_MIQP);
847	}
848	else
849	{
850	    lpd->prob_type = (nmips == 0 ? PROBLEM_LP : PROBLEM_MIP);
851	}
852    }
853
854    lpd->copystatus = XP_COPYINVALID;
855
856    if (lpd->copystatus != XP_COPYOFF)
857    {
858	Mark_Copy_As_Modified(lpd);
859	if (IsMIPProb(lpd->prob_type))
860	{
861	    Call(res, XPRScreateprob(&lpd->lpcopy));
862	    if (res)
863	    	return -1;
864	}
865	else
866	    CallN(lpd->lpcopy = lpd->lp);
867    }
868    else
869	CallN(lpd->lpcopy = lpd->lp);
870
871    return 0;
872}
873
874
875/*
876 * Parameter Table
877 *
878 * defines a table params[] which maps the symbolic names of the optimizer
879 * flags to the internal numbers. The set of flags and the numbers differ
880 * in each version, therefore this file has to be updated every time.
881 * For a new version do the following:
882 *
883 * extract the XPRS_ lines out of xprs.h (only the control variable ones)
884 * and substitute as follows:
885 *
886 *   s/^#define XPRS_\([^ ]*\).*$/{"\L\1\E", XPRS_\1, 0},/
887 *
888 * mark the int params with 0, the doubles with 1, the strings with 2
889 * count the lines and define NUMPARAMS accordingly!
890 * add the new section within the proper #if's
891 */
892
893#define NUMALIASES 13
894
895#if (XPRESS==13)
896
897#define NUMPARAMS 105
898static struct param_desc params[NUMPARAMS+NUMALIASES] = {
899{"mpsrhsname", XPRS_MPSRHSNAME, 2},
900{"mpsobjname", XPRS_MPSOBJNAME, 2},
901{"mpsrangename", XPRS_MPSRANGENAME, 2},
902{"mpsboundname", XPRS_MPSBOUNDNAME, 2},
903{"outputmask", XPRS_OUTPUTMASK, 2},
904{"omnidataname", XPRS_OMNIDATANAME, 2},
905{"matrixtol", XPRS_MATRIXTOL, 1},
906{"pivottol", XPRS_PIVOTTOL, 1},
907{"feastol", XPRS_FEASTOL, 1},
908{"outputtol", XPRS_OUTPUTTOL, 1},
909{"sosreftol", XPRS_SOSREFTOL, 1},
910{"optimalitytol", XPRS_OPTIMALITYTOL, 1},
911{"etatol", XPRS_ETATOL, 1},
912{"relpivottol", XPRS_RELPIVOTTOL, 1},
913{"miptol", XPRS_MIPTOL, 1},
914{"degradefactor", XPRS_DEGRADEFACTOR, 1},
915{"miptarget", XPRS_MIPTARGET, 1},
916{"mipaddcutoff", XPRS_MIPADDCUTOFF, 1},
917{"mipabscutoff", XPRS_MIPABSCUTOFF, 1},
918{"miprelcutoff", XPRS_MIPRELCUTOFF, 1},
919{"pseudocost", XPRS_PSEUDOCOST, 1},
920{"penalty", XPRS_PENALTY, 1},
921{"bigm", XPRS_BIGM, 1},
922{"mipabsstop", XPRS_MIPABSSTOP, 1},
923{"miprelstop", XPRS_MIPRELSTOP, 1},
924{"choleskytol", XPRS_CHOLESKYTOL, 1},
925{"bargapstop", XPRS_BARGAPSTOP, 1},
926{"bardualstop", XPRS_BARDUALSTOP, 1},
927{"barprimalstop", XPRS_BARPRIMALSTOP, 1},
928{"barstepstop", XPRS_BARSTEPSTOP, 1},
929{"elimtol", XPRS_ELIMTOL, 1},
930{"perturb", XPRS_PERTURB, 1},
931{"markowitztol", XPRS_MARKOWITZTOL, 1},
932{"recsteplength", XPRS_RECSTEPLENGTH, 1},
933{"recexpand", XPRS_RECEXPAND, 1},
934{"recshrink", XPRS_RECSHRINK, 1},
935{"recstop", XPRS_RECSTOP, 1},
936{"ppfactor", XPRS_PPFACTOR, 1},
937{"extrarows", XPRS_EXTRAROWS, 0},
938{"extracols", XPRS_EXTRACOLS, 0},
939{"extraelems", XPRS_EXTRAELEMS, 0},
940{"lpiterlimit", XPRS_LPITERLIMIT, 0},
941{"lplog", XPRS_LPLOG, 0},
942{"scaling", XPRS_SCALING, 0},
943{"presolve", XPRS_PRESOLVE, 0},
944{"crash", XPRS_CRASH, 0},
945{"pricingalg", XPRS_PRICINGALG, 0},
946{"invertfreq", XPRS_INVERTFREQ, 0},
947{"invertmin", XPRS_INVERTMIN, 0},
948{"maxnode", XPRS_MAXNODE, 0},
949{"maxtime", XPRS_MAXTIME, 0},
950{"maxmipsol", XPRS_MAXMIPSOL, 0},
951{"keepmipsol", XPRS_KEEPMIPSOL, 0},
952{"defaultalg", XPRS_DEFAULTALG, 0},
953{"varselection", XPRS_VARSELECTION, 0},
954{"nodeselection", XPRS_NODESELECTION, 0},
955{"backtrack", XPRS_BACKTRACK, 0},
956{"miplog", XPRS_MIPLOG, 0},
957{"mpserrignore", XPRS_MPSERRIGNORE, 0},
958{"keepnrows", XPRS_KEEPNROWS, 0},
959{"mpsecho", XPRS_MPSECHO, 0},
960{"maxpagelines", XPRS_MAXPAGELINES, 0},
961{"outputlog", XPRS_OUTPUTLOG, 0},
962{"extrapresolve", XPRS_EXTRAPRESOLVE, 0},
963{"cpmaxcuts", XPRS_CPMAXCUTS, 0},
964{"cpmaxelems", XPRS_CPMAXELEMS, 0},
965{"cpkeepallcuts", XPRS_CPKEEPALLCUTS, 0},
966{"cachesize", XPRS_CACHESIZE, 0},
967{"crossover", XPRS_CROSSOVER, 0},
968{"bariterlimit", XPRS_BARITERLIMIT, 0},
969{"choleskyalg", XPRS_CHOLESKYALG, 0},
970{"baroutput", XPRS_BAROUTPUT, 0},
971{"cstyle", XPRS_CSTYLE, 0},
972{"extramipents", XPRS_EXTRAMIPENTS, 0},
973{"refactor", XPRS_REFACTOR, 0},
974{"barthreads", XPRS_BARTHREADS, 0},
975{"keepbasis", XPRS_KEEPBASIS, 0},
976{"omniformat", XPRS_OMNIFORMAT, 0},
977{"version", XPRS_VERSION, 0},
978{"recmaxpasses", XPRS_RECMAXPASSES, 0},
979{"bigmmethod", XPRS_BIGMMETHOD, 0},
980{"rel10style", XPRS_REL10STYLE, 0},
981{"mpsnamelength", XPRS_MPSNAMELENGTH, 0},
982{"solutionfile", XPRS_SOLUTIONFILE, 0},
983{"presolveops", XPRS_PRESOLVEOPS, 0},
984{"mippresolve", XPRS_MIPPRESOLVE, 0},
985{"maxslave", XPRS_MAXSLAVE, 0},
986{"barorder", XPRS_BARORDER, 0},
987{"breadthfirst", XPRS_BREADTHFIRST, 0},
988{"autoperturb", XPRS_AUTOPERTURB, 0},
989{"densecollimit", XPRS_DENSECOLLIMIT, 0},
990{"cutfreq", XPRS_CUTFREQ, 0},
991{"trace", XPRS_TRACE, 0},
992{"maxiis", XPRS_MAXIIS, 0},
993{"cputime", XPRS_CPUTIME, 0},
994{"covercuts", XPRS_COVERCUTS, 0},
995{"gomcuts", XPRS_GOMCUTS, 0},
996{"mpsformat", XPRS_MPSFORMAT, 0},
997{"cutstrategy", XPRS_CUTSTRATEGY, 0},
998{"cutdepth", XPRS_CUTDEPTH, 0},
999{"treecovercuts", XPRS_TREECOVERCUTS, 0},
1000{"treegomcuts", XPRS_TREEGOMCUTS, 0},
1001{"barmemory", XPRS_BARMEMORY, 0},
1002/*{"dualgradient", XPRS_DUALGRADIENT, 0}, not in 13.10 */
1003{"sbiterlimit", XPRS_SBITERLIMIT, 0},
1004{"sbbest", XPRS_SBBEST, 0},
1005
1006#elif (XPRESS==14)
1007
1008#define NUMPARAMS 109
1009static struct param_desc params[NUMPARAMS+NUMALIASES] = {
1010{"mpsrhsname", XPRS_MPSRHSNAME, 2},
1011{"mpsobjname", XPRS_MPSOBJNAME, 2},
1012{"mpsrangename", XPRS_MPSRANGENAME, 2},
1013{"mpsboundname", XPRS_MPSBOUNDNAME, 2},
1014{"outputmask", XPRS_OUTPUTMASK, 2},
1015{"omnidataname", XPRS_OMNIDATANAME, 2},
1016{"matrixtol", XPRS_MATRIXTOL, 1},
1017{"pivottol", XPRS_PIVOTTOL, 1},
1018{"feastol", XPRS_FEASTOL, 1},
1019{"outputtol", XPRS_OUTPUTTOL, 1},
1020{"sosreftol", XPRS_SOSREFTOL, 1},
1021{"optimalitytol", XPRS_OPTIMALITYTOL, 1},
1022{"etatol", XPRS_ETATOL, 1},
1023{"relpivottol", XPRS_RELPIVOTTOL, 1},
1024{"miptol", XPRS_MIPTOL, 1},
1025{"degradefactor", XPRS_DEGRADEFACTOR, 1},
1026{"miptarget", XPRS_MIPTARGET, 1},
1027{"mipaddcutoff", XPRS_MIPADDCUTOFF, 1},
1028{"mipabscutoff", XPRS_MIPABSCUTOFF, 1},
1029{"miprelcutoff", XPRS_MIPRELCUTOFF, 1},
1030{"pseudocost", XPRS_PSEUDOCOST, 1},
1031{"penalty", XPRS_PENALTY, 1},
1032{"bigm", XPRS_BIGM, 1},
1033{"mipabsstop", XPRS_MIPABSSTOP, 1},
1034{"miprelstop", XPRS_MIPRELSTOP, 1},
1035{"choleskytol", XPRS_CHOLESKYTOL, 1},
1036{"bargapstop", XPRS_BARGAPSTOP, 1},
1037{"bardualstop", XPRS_BARDUALSTOP, 1},
1038{"barprimalstop", XPRS_BARPRIMALSTOP, 1},
1039{"barstepstop", XPRS_BARSTEPSTOP, 1},
1040{"elimtol", XPRS_ELIMTOL, 1},
1041{"perturb", XPRS_PERTURB, 1},
1042{"markowitztol", XPRS_MARKOWITZTOL, 1},
1043{"ppfactor", XPRS_PPFACTOR, 1},
1044{"extrarows", XPRS_EXTRAROWS, 0},
1045{"extracols", XPRS_EXTRACOLS, 0},
1046{"extraelems", XPRS_EXTRAELEMS, 0},
1047{"lpiterlimit", XPRS_LPITERLIMIT, 0},
1048{"lplog", XPRS_LPLOG, 0},
1049{"scaling", XPRS_SCALING, 0},
1050{"presolve", XPRS_PRESOLVE, 0},
1051{"crash", XPRS_CRASH, 0},
1052{"pricingalg", XPRS_PRICINGALG, 0},
1053{"invertfreq", XPRS_INVERTFREQ, 0},
1054{"invertmin", XPRS_INVERTMIN, 0},
1055{"maxnode", XPRS_MAXNODE, 0},
1056{"maxtime", XPRS_MAXTIME, 0},
1057{"maxmipsol", XPRS_MAXMIPSOL, 0},
1058{"keepmipsol", XPRS_KEEPMIPSOL, 0},
1059{"defaultalg", XPRS_DEFAULTALG, 0},
1060{"varselection", XPRS_VARSELECTION, 0},
1061{"nodeselection", XPRS_NODESELECTION, 0},
1062{"backtrack", XPRS_BACKTRACK, 0},
1063{"miplog", XPRS_MIPLOG, 0},
1064{"mpserrignore", XPRS_MPSERRIGNORE, 0},
1065{"keepnrows", XPRS_KEEPNROWS, 0},
1066{"mpsecho", XPRS_MPSECHO, 0},
1067{"maxpagelines", XPRS_MAXPAGELINES, 0},
1068{"outputlog", XPRS_OUTPUTLOG, 0},
1069{"extrapresolve", XPRS_EXTRAPRESOLVE, 0},
1070{"cpmaxcuts", XPRS_CPMAXCUTS, 0},
1071{"cpmaxelems", XPRS_CPMAXELEMS, 0},
1072{"cpkeepallcuts", XPRS_CPKEEPALLCUTS, 0},
1073{"cachesize", XPRS_CACHESIZE, 0},
1074{"crossover", XPRS_CROSSOVER, 0},
1075{"bariterlimit", XPRS_BARITERLIMIT, 0},
1076{"choleskyalg", XPRS_CHOLESKYALG, 0},
1077{"baroutput", XPRS_BAROUTPUT, 0},
1078{"cstyle", XPRS_CSTYLE, 0},
1079{"extramipents", XPRS_EXTRAMIPENTS, 0},
1080{"refactor", XPRS_REFACTOR, 0},
1081{"barthreads", XPRS_BARTHREADS, 0},
1082{"keepbasis", XPRS_KEEPBASIS, 0},
1083{"omniformat", XPRS_OMNIFORMAT, 0},
1084{"version", XPRS_VERSION, 0},
1085{"bigmmethod", XPRS_BIGMMETHOD, 0},
1086{"rel10style", XPRS_REL10STYLE, 0},
1087{"mpsnamelength", XPRS_MPSNAMELENGTH, 0},
1088{"solutionfile", XPRS_SOLUTIONFILE, 0},
1089{"presolveops", XPRS_PRESOLVEOPS, 0},
1090{"mippresolve", XPRS_MIPPRESOLVE, 0},
1091{"maxslave", XPRS_MAXSLAVE, 0},
1092{"barorder", XPRS_BARORDER, 0},
1093{"breadthfirst", XPRS_BREADTHFIRST, 0},
1094{"autoperturb", XPRS_AUTOPERTURB, 0},
1095{"densecollimit", XPRS_DENSECOLLIMIT, 0},
1096{"cutfreq", XPRS_CUTFREQ, 0},
1097{"trace", XPRS_TRACE, 0},
1098{"maxiis", XPRS_MAXIIS, 0},
1099{"cputime", XPRS_CPUTIME, 0},
1100{"covercuts", XPRS_COVERCUTS, 0},
1101{"gomcuts", XPRS_GOMCUTS, 0},
1102{"mpsformat", XPRS_MPSFORMAT, 0},
1103{"cutstrategy", XPRS_CUTSTRATEGY, 0},
1104{"cutdepth", XPRS_CUTDEPTH, 0},
1105{"treecovercuts", XPRS_TREECOVERCUTS, 0},
1106{"treegomcuts", XPRS_TREEGOMCUTS, 0},
1107{"barmemory", XPRS_BARMEMORY, 0},
1108{"dualgradient", XPRS_DUALGRADIENT, 0},
1109{"sbiterlimit", XPRS_SBITERLIMIT, 0},
1110{"sbbest", XPRS_SBBEST, 0},
1111{"maxcuttime", XPRS_MAXCUTTIME, 0},
1112{"activeset", XPRS_ACTIVESET, 0},
1113{"barindeflimit", XPRS_BARINDEFLIMIT, 0},
1114{"heurstrategy", XPRS_HEURSTRATEGY, 0},
1115{"heurfreq", XPRS_HEURFREQ, 0},
1116{"heurdepth", XPRS_HEURDEPTH, 0},
1117{"heurmaxsol", XPRS_HEURMAXSOL, 0},
1118{"heurnodes", XPRS_HEURNODES, 0},
1119
1120#elif XPRESS==15
1121
1122#define NUMPARAMS 114
1123static struct param_desc params[NUMPARAMS+NUMALIASES] = {
1124{"mpsrhsname", XPRS_MPSRHSNAME, 2},
1125{"mpsobjname", XPRS_MPSOBJNAME, 2},
1126{"mpsrangename", XPRS_MPSRANGENAME, 2},
1127{"mpsboundname", XPRS_MPSBOUNDNAME, 2},
1128{"outputmask", XPRS_OUTPUTMASK, 2},
1129{"omnidataname", XPRS_OMNIDATANAME, 2},
1130{"matrixtol", XPRS_MATRIXTOL, 1},
1131{"pivottol", XPRS_PIVOTTOL, 1},
1132{"feastol", XPRS_FEASTOL, 1},
1133{"outputtol", XPRS_OUTPUTTOL, 1},
1134{"sosreftol", XPRS_SOSREFTOL, 1},
1135{"optimalitytol", XPRS_OPTIMALITYTOL, 1},
1136{"etatol", XPRS_ETATOL, 1},
1137{"relpivottol", XPRS_RELPIVOTTOL, 1},
1138{"miptol", XPRS_MIPTOL, 1},
1139{"degradefactor", XPRS_DEGRADEFACTOR, 1},
1140{"miptarget", XPRS_MIPTARGET, 1},
1141{"mipaddcutoff", XPRS_MIPADDCUTOFF, 1},
1142{"mipabscutoff", XPRS_MIPABSCUTOFF, 1},
1143{"miprelcutoff", XPRS_MIPRELCUTOFF, 1},
1144{"pseudocost", XPRS_PSEUDOCOST, 1},
1145{"penalty", XPRS_PENALTY, 1},
1146{"bigm", XPRS_BIGM, 1},
1147{"mipabsstop", XPRS_MIPABSSTOP, 1},
1148{"miprelstop", XPRS_MIPRELSTOP, 1},
1149{"choleskytol", XPRS_CHOLESKYTOL, 1},
1150{"bargapstop", XPRS_BARGAPSTOP, 1},
1151{"bardualstop", XPRS_BARDUALSTOP, 1},
1152{"barprimalstop", XPRS_BARPRIMALSTOP, 1},
1153{"barstepstop", XPRS_BARSTEPSTOP, 1},
1154{"elimtol", XPRS_ELIMTOL, 1},
1155{"perturb", XPRS_PERTURB, 1},
1156{"markowitztol", XPRS_MARKOWITZTOL, 1},
1157{"ppfactor", XPRS_PPFACTOR, 1},
1158{"extrarows", XPRS_EXTRAROWS, 0},
1159{"extracols", XPRS_EXTRACOLS, 0},
1160{"extraelems", XPRS_EXTRAELEMS, 0},
1161{"lpiterlimit", XPRS_LPITERLIMIT, 0},
1162{"lplog", XPRS_LPLOG, 0},
1163{"scaling", XPRS_SCALING, 0},
1164{"presolve", XPRS_PRESOLVE, 0},
1165{"crash", XPRS_CRASH, 0},
1166{"pricingalg", XPRS_PRICINGALG, 0},
1167{"invertfreq", XPRS_INVERTFREQ, 0},
1168{"invertmin", XPRS_INVERTMIN, 0},
1169{"maxnode", XPRS_MAXNODE, 0},
1170{"maxtime", XPRS_MAXTIME, 0},
1171{"maxmipsol", XPRS_MAXMIPSOL, 0},
1172{"keepmipsol", XPRS_KEEPMIPSOL, 0},
1173{"defaultalg", XPRS_DEFAULTALG, 0},
1174{"varselection", XPRS_VARSELECTION, 0},
1175{"nodeselection", XPRS_NODESELECTION, 0},
1176{"backtrack", XPRS_BACKTRACK, 0},
1177{"miplog", XPRS_MIPLOG, 0},
1178{"mpserrignore", XPRS_MPSERRIGNORE, 0},
1179{"keepnrows", XPRS_KEEPNROWS, 0},
1180{"mpsecho", XPRS_MPSECHO, 0},
1181{"maxpagelines", XPRS_MAXPAGELINES, 0},
1182{"outputlog", XPRS_OUTPUTLOG, 0},
1183{"extrapresolve", XPRS_EXTRAPRESOLVE, 0},
1184{"cpmaxcuts", XPRS_CPMAXCUTS, 0},
1185{"cpmaxelems", XPRS_CPMAXELEMS, 0},
1186{"cpkeepallcuts", XPRS_CPKEEPALLCUTS, 0},
1187{"cachesize", XPRS_CACHESIZE, 0},
1188{"crossover", XPRS_CROSSOVER, 0},
1189{"bariterlimit", XPRS_BARITERLIMIT, 0},
1190{"choleskyalg", XPRS_CHOLESKYALG, 0},
1191{"baroutput", XPRS_BAROUTPUT, 0},
1192{"cstyle", XPRS_CSTYLE, 0},
1193{"extramipents", XPRS_EXTRAMIPENTS, 0},
1194{"refactor", XPRS_REFACTOR, 0},
1195{"barthreads", XPRS_BARTHREADS, 0},
1196{"keepbasis", XPRS_KEEPBASIS, 0},
1197{"omniformat", XPRS_OMNIFORMAT, 0},
1198{"version", XPRS_VERSION, 0},
1199{"bigmmethod", XPRS_BIGMMETHOD, 0},
1200{"rel10style", XPRS_REL10STYLE, 0},
1201{"mpsnamelength", XPRS_MPSNAMELENGTH, 0},
1202{"solutionfile", XPRS_SOLUTIONFILE, 0},
1203{"presolveops", XPRS_PRESOLVEOPS, 0},
1204{"mippresolve", XPRS_MIPPRESOLVE, 0},
1205{"maxslave", XPRS_MAXSLAVE, 0},
1206{"barorder", XPRS_BARORDER, 0},
1207{"breadthfirst", XPRS_BREADTHFIRST, 0},
1208{"autoperturb", XPRS_AUTOPERTURB, 0},
1209{"densecollimit", XPRS_DENSECOLLIMIT, 0},
1210{"cutfreq", XPRS_CUTFREQ, 0},
1211{"trace", XPRS_TRACE, 0},
1212{"maxiis", XPRS_MAXIIS, 0},
1213{"cputime", XPRS_CPUTIME, 0},
1214{"covercuts", XPRS_COVERCUTS, 0},
1215{"gomcuts", XPRS_GOMCUTS, 0},
1216{"mpsformat", XPRS_MPSFORMAT, 0},
1217{"cutstrategy", XPRS_CUTSTRATEGY, 0},
1218{"cutdepth", XPRS_CUTDEPTH, 0},
1219{"treecovercuts", XPRS_TREECOVERCUTS, 0},
1220{"treegomcuts", XPRS_TREEGOMCUTS, 0},
1221{"barmemory", XPRS_BARMEMORY, 0},
1222{"dualgradient", XPRS_DUALGRADIENT, 0},
1223{"sbiterlimit", XPRS_SBITERLIMIT, 0},
1224{"sbbest", XPRS_SBBEST, 0},
1225{"maxcuttime", XPRS_MAXCUTTIME, 0},
1226{"activeset", XPRS_ACTIVESET, 0},
1227{"barindeflimit", XPRS_BARINDEFLIMIT, 0},
1228{"heurstrategy", XPRS_HEURSTRATEGY, 0},
1229{"heurfreq", XPRS_HEURFREQ, 0},
1230{"heurdepth", XPRS_HEURDEPTH, 0},
1231{"heurmaxsol", XPRS_HEURMAXSOL, 0},
1232{"heurnodes", XPRS_HEURNODES, 0},
1233{"lnpbest", XPRS_LNPBEST, 0},
1234{"lnpiterlimit", XPRS_LNPITERLIMIT, 0},
1235{"branchchoice", XPRS_BRANCHCHOICE, 0},
1236{"sbselect", XPRS_SBSELECT, 0},
1237{"sbthreads", XPRS_SBTHREADS, 0},
1238
1239#elif XPRESS==16
1240
1241#define NUMPARAMS 115
1242static struct param_desc params[NUMPARAMS+NUMALIASES] = {
1243{"mpsrhsname", XPRS_MPSRHSNAME, 2},
1244{"mpsobjname", XPRS_MPSOBJNAME, 2},
1245{"mpsrangename", XPRS_MPSRANGENAME, 2},
1246{"mpsboundname", XPRS_MPSBOUNDNAME, 2},
1247{"outputmask", XPRS_OUTPUTMASK, 2},
1248{"omnidataname", XPRS_OMNIDATANAME, 2},
1249{"matrixtol", XPRS_MATRIXTOL, 1},
1250{"pivottol", XPRS_PIVOTTOL, 1},
1251{"feastol", XPRS_FEASTOL, 1},
1252{"outputtol", XPRS_OUTPUTTOL, 1},
1253{"sosreftol", XPRS_SOSREFTOL, 1},
1254{"optimalitytol", XPRS_OPTIMALITYTOL, 1},
1255{"etatol", XPRS_ETATOL, 1},
1256{"relpivottol", XPRS_RELPIVOTTOL, 1},
1257{"miptol", XPRS_MIPTOL, 1},
1258{"degradefactor", XPRS_DEGRADEFACTOR, 1},
1259{"miptarget", XPRS_MIPTARGET, 1},
1260{"mipaddcutoff", XPRS_MIPADDCUTOFF, 1},
1261{"mipabscutoff", XPRS_MIPABSCUTOFF, 1},
1262{"miprelcutoff", XPRS_MIPRELCUTOFF, 1},
1263{"pseudocost", XPRS_PSEUDOCOST, 1},
1264{"penalty", XPRS_PENALTY, 1},
1265{"bigm", XPRS_BIGM, 1},
1266{"mipabsstop", XPRS_MIPABSSTOP, 1},
1267{"miprelstop", XPRS_MIPRELSTOP, 1},
1268{"choleskytol", XPRS_CHOLESKYTOL, 1},
1269{"bargapstop", XPRS_BARGAPSTOP, 1},
1270{"bardualstop", XPRS_BARDUALSTOP, 1},
1271{"barprimalstop", XPRS_BARPRIMALSTOP, 1},
1272{"barstepstop", XPRS_BARSTEPSTOP, 1},
1273{"elimtol", XPRS_ELIMTOL, 1},
1274{"perturb", XPRS_PERTURB, 1},
1275{"markowitztol", XPRS_MARKOWITZTOL, 1},
1276{"ppfactor", XPRS_PPFACTOR, 1},
1277{"extrarows", XPRS_EXTRAROWS, 0},
1278{"extracols", XPRS_EXTRACOLS, 0},
1279{"extraelems", XPRS_EXTRAELEMS, 0},
1280{"lpiterlimit", XPRS_LPITERLIMIT, 0},
1281{"lplog", XPRS_LPLOG, 0},
1282{"scaling", XPRS_SCALING, 0},
1283{"presolve", XPRS_PRESOLVE, 0},
1284{"crash", XPRS_CRASH, 0},
1285{"pricingalg", XPRS_PRICINGALG, 0},
1286{"invertfreq", XPRS_INVERTFREQ, 0},
1287{"invertmin", XPRS_INVERTMIN, 0},
1288{"maxnode", XPRS_MAXNODE, 0},
1289{"maxtime", XPRS_MAXTIME, 0},
1290{"maxmipsol", XPRS_MAXMIPSOL, 0},
1291{"keepmipsol", XPRS_KEEPMIPSOL, 0},
1292{"defaultalg", XPRS_DEFAULTALG, 0},
1293{"varselection", XPRS_VARSELECTION, 0},
1294{"nodeselection", XPRS_NODESELECTION, 0},
1295{"backtrack", XPRS_BACKTRACK, 0},
1296{"miplog", XPRS_MIPLOG, 0},
1297{"mpserrignore", XPRS_MPSERRIGNORE, 0},
1298{"keepnrows", XPRS_KEEPNROWS, 0},
1299{"mpsecho", XPRS_MPSECHO, 0},
1300{"maxpagelines", XPRS_MAXPAGELINES, 0},
1301{"outputlog", XPRS_OUTPUTLOG, 0},
1302{"extrapresolve", XPRS_EXTRAPRESOLVE, 0},
1303{"cpmaxcuts", XPRS_CPMAXCUTS, 0},
1304{"cpmaxelems", XPRS_CPMAXELEMS, 0},
1305{"cpkeepallcuts", XPRS_CPKEEPALLCUTS, 0},
1306{"cachesize", XPRS_CACHESIZE, 0},
1307{"crossover", XPRS_CROSSOVER, 0},
1308{"bariterlimit", XPRS_BARITERLIMIT, 0},
1309{"choleskyalg", XPRS_CHOLESKYALG, 0},
1310{"baroutput", XPRS_BAROUTPUT, 0},
1311{"cstyle", XPRS_CSTYLE, 0},
1312{"extramipents", XPRS_EXTRAMIPENTS, 0},
1313{"refactor", XPRS_REFACTOR, 0},
1314{"barthreads", XPRS_BARTHREADS, 0},
1315{"keepbasis", XPRS_KEEPBASIS, 0},
1316{"omniformat", XPRS_OMNIFORMAT, 0},
1317{"version", XPRS_VERSION, 0},
1318{"bigmmethod", XPRS_BIGMMETHOD, 0},
1319{"rel10style", XPRS_REL10STYLE, 0},
1320{"mpsnamelength", XPRS_MPSNAMELENGTH, 0},
1321{"solutionfile", XPRS_SOLUTIONFILE, 0},
1322{"presolveops", XPRS_PRESOLVEOPS, 0},
1323{"mippresolve", XPRS_MIPPRESOLVE, 0},
1324{"mipthreads", XPRS_MIPTHREADS, 0},
1325{"barorder", XPRS_BARORDER, 0},
1326{"breadthfirst", XPRS_BREADTHFIRST, 0},
1327{"autoperturb", XPRS_AUTOPERTURB, 0},
1328{"densecollimit", XPRS_DENSECOLLIMIT, 0},
1329{"cutfreq", XPRS_CUTFREQ, 0},
1330{"trace", XPRS_TRACE, 0},
1331{"maxiis", XPRS_MAXIIS, 0},
1332{"cputime", XPRS_CPUTIME, 0},
1333{"covercuts", XPRS_COVERCUTS, 0},
1334{"gomcuts", XPRS_GOMCUTS, 0},
1335{"mpsformat", XPRS_MPSFORMAT, 0},
1336{"cutstrategy", XPRS_CUTSTRATEGY, 0},
1337{"cutdepth", XPRS_CUTDEPTH, 0},
1338{"treecovercuts", XPRS_TREECOVERCUTS, 0},
1339{"treegomcuts", XPRS_TREEGOMCUTS, 0},
1340{"dualgradient", XPRS_DUALGRADIENT, 0},
1341{"sbiterlimit", XPRS_SBITERLIMIT, 0},
1342{"sbbest", XPRS_SBBEST, 0},
1343{"maxcuttime", XPRS_MAXCUTTIME, 0},
1344{"activeset", XPRS_ACTIVESET, 0},
1345{"barindeflimit", XPRS_BARINDEFLIMIT, 0},
1346{"heurstrategy", XPRS_HEURSTRATEGY, 0},
1347{"heurfreq", XPRS_HEURFREQ, 0},
1348{"heurdepth", XPRS_HEURDEPTH, 0},
1349{"heurmaxsol", XPRS_HEURMAXSOL, 0},
1350{"heurnodes", XPRS_HEURNODES, 0},
1351{"lnpbest", XPRS_LNPBEST, 0},
1352{"lnpiterlimit", XPRS_LNPITERLIMIT, 0},
1353{"branchchoice", XPRS_BRANCHCHOICE, 0},
1354{"sbselect", XPRS_SBSELECT, 0},
1355{"sbthreads", XPRS_SBTHREADS, 0},
1356{"heurdivestrategy", XPRS_HEURDIVESTRATEGY, 0},
1357{"heurselect", XPRS_HEURSELECT, 0},
1358
1359#elif XPRESS==20
1360
1361#define NUMPARAMS 164
1362static struct param_desc params[NUMPARAMS+NUMALIASES] = {
1363{"mpsrhsname", XPRS_MPSRHSNAME, 2},
1364{"mpsobjname", XPRS_MPSOBJNAME, 2},
1365{"mpsrangename", XPRS_MPSRANGENAME, 2},
1366{"mpsboundname", XPRS_MPSBOUNDNAME, 2},
1367{"outputmask", XPRS_OUTPUTMASK, 2},
1368{"matrixtol", XPRS_MATRIXTOL, 1},
1369{"pivottol", XPRS_PIVOTTOL, 1},
1370{"feastol", XPRS_FEASTOL, 1},
1371{"outputtol", XPRS_OUTPUTTOL, 1},
1372{"sosreftol", XPRS_SOSREFTOL, 1},
1373{"optimalitytol", XPRS_OPTIMALITYTOL, 1},
1374{"etatol", XPRS_ETATOL, 1},
1375{"relpivottol", XPRS_RELPIVOTTOL, 1},
1376{"miptol", XPRS_MIPTOL, 1},
1377{"degradefactor", XPRS_DEGRADEFACTOR, 1},
1378{"miptarget", XPRS_MIPTARGET, 1},
1379{"mipaddcutoff", XPRS_MIPADDCUTOFF, 1},
1380{"mipabscutoff", XPRS_MIPABSCUTOFF, 1},
1381{"miprelcutoff", XPRS_MIPRELCUTOFF, 1},
1382{"pseudocost", XPRS_PSEUDOCOST, 1},
1383{"penalty", XPRS_PENALTY, 1},
1384{"bigm", XPRS_BIGM, 1},
1385{"mipabsstop", XPRS_MIPABSSTOP, 1},
1386{"miprelstop", XPRS_MIPRELSTOP, 1},
1387{"choleskytol", XPRS_CHOLESKYTOL, 1},
1388{"bargapstop", XPRS_BARGAPSTOP, 1},
1389{"bardualstop", XPRS_BARDUALSTOP, 1},
1390{"barprimalstop", XPRS_BARPRIMALSTOP, 1},
1391{"barstepstop", XPRS_BARSTEPSTOP, 1},
1392{"elimtol", XPRS_ELIMTOL, 1},
1393{"perturb", XPRS_PERTURB, 1},
1394{"markowitztol", XPRS_MARKOWITZTOL, 1},
1395{"ppfactor", XPRS_PPFACTOR, 1},
1396{"sbeffort", XPRS_SBEFFORT, 1},
1397{"heurdiverandomize", XPRS_HEURDIVERANDOMIZE, 1},
1398{"heursearcheffort", XPRS_HEURSEARCHEFFORT, 1},
1399{"cutfactor", XPRS_CUTFACTOR, 1},
1400{"eigenvaluetol", XPRS_EIGENVALUETOL, 1},
1401{"indlinbigm", XPRS_INDLINBIGM, 1},
1402{"treememorysavingtarget", XPRS_TREEMEMORYSAVINGTARGET, 1},
1403{"globalfilebias", XPRS_GLOBALFILEBIAS, 1},
1404{"extrarows", XPRS_EXTRAROWS, 0},
1405{"extracols", XPRS_EXTRACOLS, 0},
1406{"extraelems", XPRS_EXTRAELEMS, 0},
1407{"lpiterlimit", XPRS_LPITERLIMIT, 0},
1408{"lplog", XPRS_LPLOG, 0},
1409{"scaling", XPRS_SCALING, 0},
1410{"presolve", XPRS_PRESOLVE, 0},
1411{"crash", XPRS_CRASH, 0},
1412{"pricingalg", XPRS_PRICINGALG, 0},
1413{"invertfreq", XPRS_INVERTFREQ, 0},
1414{"invertmin", XPRS_INVERTMIN, 0},
1415{"maxnode", XPRS_MAXNODE, 0},
1416{"maxtime", XPRS_MAXTIME, 0},
1417{"maxmipsol", XPRS_MAXMIPSOL, 0},
1418{"keepmipsol", XPRS_KEEPMIPSOL, 0},
1419{"defaultalg", XPRS_DEFAULTALG, 0},
1420{"varselection", XPRS_VARSELECTION, 0},
1421{"nodeselection", XPRS_NODESELECTION, 0},
1422{"backtrack", XPRS_BACKTRACK, 0},
1423{"miplog", XPRS_MIPLOG, 0},
1424{"keepnrows", XPRS_KEEPNROWS, 0},
1425{"mpsecho", XPRS_MPSECHO, 0},
1426{"maxpagelines", XPRS_MAXPAGELINES, 0},
1427{"outputlog", XPRS_OUTPUTLOG, 0},
1428{"extrapresolve", XPRS_EXTRAPRESOLVE, 0},
1429{"cachesize", XPRS_CACHESIZE, 0},
1430{"crossover", XPRS_CROSSOVER, 0},
1431{"bariterlimit", XPRS_BARITERLIMIT, 0},
1432{"choleskyalg", XPRS_CHOLESKYALG, 0},
1433{"baroutput", XPRS_BAROUTPUT, 0},
1434{"cstyle", XPRS_CSTYLE, 0},
1435{"extramipents", XPRS_EXTRAMIPENTS, 0},
1436{"refactor", XPRS_REFACTOR, 0},
1437{"barthreads", XPRS_BARTHREADS, 0},
1438{"keepbasis", XPRS_KEEPBASIS, 0},
1439{"version", XPRS_VERSION, 0},
1440{"bigmmethod", XPRS_BIGMMETHOD, 0},
1441{"mpsnamelength", XPRS_MPSNAMELENGTH, 0},
1442{"solutionfile", XPRS_SOLUTIONFILE, 0},
1443{"presolveops", XPRS_PRESOLVEOPS, 0},
1444{"mippresolve", XPRS_MIPPRESOLVE, 0},
1445{"mipthreads", XPRS_MIPTHREADS, 0},
1446{"barorder", XPRS_BARORDER, 0},
1447{"breadthfirst", XPRS_BREADTHFIRST, 0},
1448{"autoperturb", XPRS_AUTOPERTURB, 0},
1449{"densecollimit", XPRS_DENSECOLLIMIT, 0},
1450{"cutfreq", XPRS_CUTFREQ, 0},
1451{"trace", XPRS_TRACE, 0},
1452{"maxiis", XPRS_MAXIIS, 0},
1453{"cputime", XPRS_CPUTIME, 0},
1454{"covercuts", XPRS_COVERCUTS, 0},
1455{"gomcuts", XPRS_GOMCUTS, 0},
1456{"mpsformat", XPRS_MPSFORMAT, 0},
1457{"cutstrategy", XPRS_CUTSTRATEGY, 0},
1458{"cutdepth", XPRS_CUTDEPTH, 0},
1459{"treecovercuts", XPRS_TREECOVERCUTS, 0},
1460{"treegomcuts", XPRS_TREEGOMCUTS, 0},
1461{"cutselect", XPRS_CUTSELECT, 0},
1462{"treecutselect", XPRS_TREECUTSELECT, 0},
1463{"dualize", XPRS_DUALIZE, 0},
1464{"dualgradient", XPRS_DUALGRADIENT, 0},
1465{"sbiterlimit", XPRS_SBITERLIMIT, 0},
1466{"sbbest", XPRS_SBBEST, 0},
1467{"maxcuttime", XPRS_MAXCUTTIME, 0},
1468{"activeset", XPRS_ACTIVESET, 0},
1469{"barindeflimit", XPRS_BARINDEFLIMIT, 0},
1470{"heurstrategy", XPRS_HEURSTRATEGY, 0},
1471{"heurfreq", XPRS_HEURFREQ, 0},
1472{"heurdepth", XPRS_HEURDEPTH, 0},
1473{"heurmaxsol", XPRS_HEURMAXSOL, 0},
1474{"heurnodes", XPRS_HEURNODES, 0},
1475{"lnpbest", XPRS_LNPBEST, 0},
1476{"lnpiterlimit", XPRS_LNPITERLIMIT, 0},
1477{"branchchoice", XPRS_BRANCHCHOICE, 0},
1478{"sbselect", XPRS_SBSELECT, 0},
1479{"localchoice", XPRS_LOCALCHOICE, 0},
1480{"localbacktrack", XPRS_LOCALBACKTRACK, 0},
1481{"dualstrategy", XPRS_DUALSTRATEGY, 0},
1482{"l1cache", XPRS_L1CACHE, 0},
1483{"heurdivestrategy", XPRS_HEURDIVESTRATEGY, 0},
1484{"heurselect", XPRS_HEURSELECT, 0},
1485{"extrasets", XPRS_EXTRASETS, 0},
1486{"extrasetelems", XPRS_EXTRASETELEMS, 0},
1487{"feasibilitypump", XPRS_FEASIBILITYPUMP, 0},
1488{"precoefelim", XPRS_PRECOEFELIM, 0},
1489{"predomcol", XPRS_PREDOMCOL, 0},
1490{"heursearchfreq", XPRS_HEURSEARCHFREQ, 0},
1491{"heurdivespeedup", XPRS_HEURDIVESPEEDUP, 0},
1492{"sbestimate", XPRS_SBESTIMATE, 0},
1493{"historycosts", XPRS_HISTORYCOSTS, 0},
1494{"algaftercrossover", XPRS_ALGAFTERCROSSOVER, 0},
1495{"linelength", XPRS_LINELENGTH, 0},
1496{"mutexcallbacks", XPRS_MUTEXCALLBACKS, 0},
1497{"barcrash", XPRS_BARCRASH, 0},
1498{"heursearchrootselect", XPRS_HEURSEARCHROOTSELECT, 0},
1499{"heursearchtreeselect", XPRS_HEURSEARCHTREESELECT, 0},
1500{"mps18compatible", XPRS_MPS18COMPATIBLE, 0},
1501{"rootpresolve", XPRS_ROOTPRESOLVE, 0},
1502{"crossoverdrp", XPRS_CROSSOVERDRP, 0},
1503{"forceoutput", XPRS_FORCEOUTPUT, 0},
1504{"deterministic", XPRS_DETERMINISTIC, 0},
1505{"preprobing", XPRS_PREPROBING, 0},
1506{"extraqcelements", XPRS_EXTRAQCELEMENTS, 0},
1507{"extraqcrows", XPRS_EXTRAQCROWS, 0},
1508{"treememorylimit", XPRS_TREEMEMORYLIMIT, 0},
1509{"treecompression", XPRS_TREECOMPRESSION, 0},
1510{"treediagnostics", XPRS_TREEDIAGNOSTICS, 0},
1511{"maxglobalfilesize", XPRS_MAXGLOBALFILESIZE, 0},
1512{"tempbounds", XPRS_TEMPBOUNDS, 0},
1513{"ifcheckconvexity", XPRS_IFCHECKCONVEXITY, 0},
1514{"primalunshift", XPRS_PRIMALUNSHIFT, 0},
1515{"repairindefiniteq", XPRS_REPAIRINDEFINITEQ, 0},
1516{"maxlocalbacktrack", XPRS_MAXLOCALBACKTRACK, 0},
1517{"backtracktie", XPRS_BACKTRACKTIE, 0},
1518{"branchdisj", XPRS_BRANCHDISJ, 0},
1519{"lpthreads", XPRS_LPTHREADS, 0},
1520{"maxscalefactor", XPRS_MAXSCALEFACTOR, 0},
1521{"heurthreads", XPRS_HEURTHREADS, 0},
1522{"threads", XPRS_THREADS, 0},
1523{"predomrow", XPRS_PREDOMROW, 0},
1524{"branchstructural", XPRS_BRANCHSTRUCTURAL, 0},
1525{"quadraticunshift", XPRS_QUADRATICUNSHIFT, 0},
1526{"barpresolveops", XPRS_BARPRESOLVEOPS, 0},
1527
1528#endif
1529
1530
1531/*
1532 * Add some version-independent aliases to the table
1533 * This must remain at the end of the table!!!
1534 * If you add lines here, update NUMALIASES above!
1535 * NUMALIASES lines follow
1536 */
1537
1538{"timelimit", XPRS_MAXTIME, 0},
1539{"time_limit", XPRS_MAXTIME, 0},
1540{"feasibility_tol", XPRS_FEASTOL, 1},
1541{"integrality", XPRS_MIPTOL, 1},
1542{"objdifference", XPRS_MIPADDCUTOFF, 1},
1543{"iteration_limit", XPRS_LPITERLIMIT, 0},
1544{"presolve", XPRS_PRESOLVE, 0},
1545{"crash", XPRS_CRASH, 0},
1546{"refactor", XPRS_INVERTFREQ, 0},
1547{"node_limit", XPRS_MAXNODE, 0},
1548{"scrind", XPRS_OUTPUTLOG, 0},
1549{"logfile", 0, 3},		/* special */
1550{"subalgorithm", XPRS_DEFAULTALG, 0},
1551
1552};
1553
1554#endif /*XPRESS*/
1555