Xpress Appendix D: Difference between revisions

From TomWiki
Jump to navigationJump to search
(Created page with " ==Appendix D - The Matlab Interface Routines - Callback Routines== ==xpcb_bl== ===Purpose=== Xpress''MP'' Barrier Log Callback routine ===Calling Syntax=== <pre> [quit,xpc...")
 
No edit summary
 
Line 1: Line 1:
{{Part Of Manual|title=the Xpress Manual|link=[[Xpress|Xpress Manual]]}}
==The Matlab Interface Routines - Callback  Routines==


==Appendix D - The Matlab Interface Routines - Callback  Routines==
===xpcb_bl===


==xpcb_bl==
====Purpose====
 
===Purpose===


Xpress''MP'' Barrier Log Callback routine
Xpress''MP'' Barrier Log Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
Line 14: Line 14:
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
!Input||Description
!Input||Description
|-valign="top"
|''x''||Solution vector ''x ''with decision variable values (''n × ''1 vector)
|''x''||Solution vector ''x ''with decision variable values (''n × ''1 vector)
|-valign="top"
|-valign="top"
|''slack''||Vector of slack variables.
|''slack''||Vector of slack variables.
|-valign="top"
|-valign="top"
||''pi''|Lagrange multipliers for the linear constraints, i.e. the dual variables.
|''pi''||Lagrange multipliers for the linear constraints, i.e. the dual variables.
|-valign="top"
|-valign="top"
|''rc''||Lagrange multipliers for the inequality variable constraints, i.e. the reduced costs.
|''rc''||Lagrange multipliers for the inequality variable constraints, i.e. the reduced costs.
|-valign="top"
|-valign="top"
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.  Also ''Prob.MIP.KNAPSACK ''is set and variables defining the set of integer variables.
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob._U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.  Also ''Prob.MIP.KNAPSACK ''is set and variables defining the set of integer variables.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
!Output||Description
!Output||Description
|-valign="top"
|-valign="top"
|''quit''||Return flag. If non-zero, Xpress''M P ''will exit.
|''quit''||Return flag. If non-zero, Xpress<sup>''M P''</sup> will exit.
|-valign="top"
|-valign="top"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
|-valign="top"
|-valign="top"
|''xpControlVariables''||Structure with all Xpress''M P ''ontrol variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''roblem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


===Description===
====Description====


At each iteration running the barrier algorithm, this routine is called.
At each iteration running the barrier algorithm, this routine is called.


===Examples===
====Examples====


Default some printing is done, and the user should instead write the Matlab statements wanted. The definition of a few control variables are shown as comments.
Default some printing is done, and the user should instead write the Matlab statements wanted. The definition of a few control variables are shown as comments.


===See Also===
====See Also====


See the documentation for the Xpress ''MP'' routine ''XPRSsetcbbarlog''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbbarlog''.


==xpcb_gl==
===xpcb_gl===


===Purpose===
====Purpose====


Xpress''MP'' Global Log Callback routine
Xpress''MP'' Global Log Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
Line 72: Line 73:
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
!Input||Description
!Input||Description
|-valign="top"
|''x''||Latest  solution vector ''x ''with  decision variable  values (''n × ''1 vector).  If control variable ''MIPINFEAS ''= 0, then ''x ''is a new integer solution. If ''MIPINFEAS > ''0, then ''x ''is the latest simplex solution.
|''x''||Latest  solution vector ''x ''with  decision variable  values (''n × ''1 vector).  If control variable ''MIPINFEAS ''= 0, then ''x ''is a new integer solution. If ''MIPINFEAS > ''0, then ''x ''is the latest simplex solution.
|-valign="top"
|-valign="top"
|''xBIS''||Solution vector ''xBI S ''with best integer solution found (''n × ''1 vector), otherwise empty.  If control variable ''M I P I N F EAS ''= 0, then ''xBI S ''is the best integer solution found before this step. The new integer solution might or might not be an improvement. If ''M I P I N F EAS >'' 0, then ''xBI S ''is either empty, or the best integer solution found so far.
|''xBIS''||Solution vector ''xBIS ''with best integer solution found (''n × ''1 vector), otherwise empty.  If control variable ''MIPINFEAS ''= 0, then ''xBIS ''is the best integer solution found before this step. The new integer solution might or might not be an improvement. If ''MIPINFEAS >'' 0, then ''xBI S ''is either empty, or the best integer solution found so far.
|}
|}


===Description  of Input===
====Description  of Input====


{|class="wikitable"
{|class="wikitable"
!Input||Description
!Input||Description
|-valign="top"
|-valign="top"
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set: ''P rob.P  ''= ''ProblemNumber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set: ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
|''quit''||Return flag. If non-zero, Xpress''M P ''will exit.
|''quit''||Return flag. If non-zero, Xpress<sup>'M P''</sup> will exit.
|-valign="top"
|-valign="top"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
|-valign="top"
|-valign="top"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes. Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes. Set before the callback.
|}
|}


===Description===
====Description====


This is the global log callback routine. How often it is called is dependent on the control variable ''MIPLOG'':
This is the global log callback routine. How often it is called is dependent on the control variable ''MIPLOG'':
Line 138: Line 140:
</pre>
</pre>


===Examples===
====Examples====


The routine writes out the node number, the node depth, the best bound and the  best  integer  solution so far found. The Matlab code shows an implementation of a simple heuristic, an Xpress ''MP'' standard example similar to the example file:
The routine writes out the node number, the node depth, the best bound and the  best  integer  solution so far found. The Matlab code shows an implementation of a simple heuristic, an Xpress ''MP'' standard example similar to the example file:
Line 146: Line 148:
This implementation assumes that a minimum problem is solved. The heuristic is used if ''Prob.MIP.KNAPSACK'' is ''true''.  Also ''xpcontrol.M I P LOG ''= 3 must be set.
This implementation assumes that a minimum problem is solved. The heuristic is used if ''Prob.MIP.KNAPSACK'' is ''true''.  Also ''xpcontrol.M I P LOG ''= 3 must be set.


===See Also===
====See Also====


See the documentation for the Xpress''MP'' routine ''XPRSsetcbgloballog''.
See the documentation for the Xpress''MP'' routine ''XPRSsetcbgloballog''.


===xpcb_il===


==xpcb_il==
====Purpose====
 
===Purpose===


Xpress''MP'' Simplex Log Callback routine
Xpress''MP'' Simplex Log Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
Line 163: Line 164:
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
Line 175: Line 176:
|''rc''||Lagrange multipliers for the inequality variable constraints, i.e. the reduced costs.
|''rc''||Lagrange multipliers for the inequality variable constraints, i.e. the reduced costs.
|-valign="top"
|-valign="top"
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
!Output||Description
!Output||Description
|-valign="top"
|-valign="top"
|''quit''||Return flag. If non-zero, Xpress''M P ''will exit.
|''quit''||Return flag. If non-zero, Xpress<sup>''M P''</sup> will exit.
|-valign="top"
|-valign="top"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|-valign="top"
|-valign="top"
|colspan="2"|'''Global Parameters  Used'''
|colspan="2"|'''Global Parameters  Used'''
|-valign="top"
|-valign="top"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


===Description===
====Description====


Called at the 0 and last simplex iteration, as well as each LPLOG iteration, where LPLOG is the XPRS LPLOG control variable.
Called at the 0 and last simplex iteration, as well as each LPLOG iteration, where LPLOG is the XPRS LPLOG control variable.


===Examples===
====Examples====


Default the routine prints the problem number, the iteration number and the current value of the objective function. The user could instead write the Matlab statements wanted. The definition of a few control variables are shown as comments.
Default the routine prints the problem number, the iteration number and the current value of the objective function. The user could instead write the Matlab statements wanted. The definition of a few control variables are shown as comments.


===See Also===
====See Also====


See the documentation for the Xpress''M P ''routine ''XPRSsetcblplog''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcblplog''.


'''Bugs'''
'''Bugs'''
Line 210: Line 211:
The variables ''x'', ''slack'', ''pi ''and ''rc ''are just set as empty.  It is not possible to retrieve these variables during the simplex iterations.  They will probably be deleted later on.
The variables ''x'', ''slack'', ''pi ''and ''rc ''are just set as empty.  It is not possible to retrieve these variables during the simplex iterations.  They will probably be deleted later on.


==xpcb_ucb==
===xpcb_ucb===


===Purpose===
====Purpose====


Xpress ''MP'' User Choose Branching Variable Callback routine
Xpress ''MP'' User Choose Branching Variable Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
Line 222: Line 223:
</pre>
</pre>


===Description  of Input===
====Description  of Input====


{|class="wikitable"
{|class="wikitable"
Line 233: Line 234:
|''estdeg''||Estimated degradation using the selected variable or set.
|''estdeg''||Estimated degradation using the selected variable or set.
|-valign="top"
|-valign="top"
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set: ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set: ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
Line 247: Line 248:
|''estdeg''||Estimated degradation using the selected variable or set.
|''estdeg''||Estimated degradation using the selected variable or set.
|-valign="top"
|-valign="top"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


===Description===
====Description====


At each global iteration,  the  User Choose Branching Variable Callback routine  is called.  It gives the  user the possibility to set the wanted branching variable. New values for the control variables are also possible to return.
At each global iteration,  the  User Choose Branching Variable Callback routine  is called.  It gives the  user the possibility to set the wanted branching variable. New values for the control variables are also possible to return.


'''Examples'''
====Examples====


Default the node number, the branch pointer, the direction and the estimated degradation is printed.  The user should instead write the Matlab statements to set the branch pointer, the direction and the estimated degradation.
Default the node number, the branch pointer, the direction and the estimated degradation is printed.  The user should instead write the Matlab statements to set the branch pointer, the direction and the estimated degradation.


'''See Also'''
====See Also====


See the documentation for the Xpress''M P ''routine ''XPRSsetcbchgbranch''. It is demonstrated how to choose branching on the most fractional integer.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbchgbranch''. It is demonstrated how to choose branching on the most fractional integer.


==xpcb ucn==
===xpcb_ucn===


===Purpose===
====Purpose====


Xpress''MP'' User Node Cut-Off Callback routine
Xpress''MP'' User Node Cut-Off Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
[xpcontrol] = xpcb ucn(node, Prob)
[xpcontrol] = xpcb_ucn(node, Prob)
</pre>
</pre>


===Description  of Input===
====Description  of Input====


{|Input||Description
{|Input||Description
Line 288: Line 289:
|''node''||Node selected by Xpress''M P''
|''node''||Node selected by Xpress''M P''
|-valign="top"
|-valign="top"
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set: ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set: ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
!Parameter||Description
!Parameter||Description
|-valign="top"
|-valign="top"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


'''Description'''
====Description====


Declares a user node cutoff callback function, called every time a node is cut off as a result of an improved integer solution being found during the Branch and Bound search. New values for the control variables may be returned as sub fields in the ''xpcontrol ''variable.
Declares a user node cutoff callback function, called every time a node is cut off as a result of an improved integer solution being found during the Branch and Bound search. New values for the control variables may be returned as sub fields in the ''xpcontrol ''variable.


'''Examples'''
====Examples====


Default the node number is printed.
Default the node number is printed.


'''See Also'''
====See Also====


See the documentation for the Xpress''M P ''routine ''XPRSsetcbnodecutoff''. User 1s'' Guide  for TOMLAB /Xpress R2004 ''67
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbnodecutoff''. User 1s'' Guide  for TOMLAB /Xpress R2004 ''67


==xpcb_uin==
===xpcb_uin===


===Purpose===
====Purpose====


XpressMP User Infeasible Node Callback routine
XpressMP User Infeasible Node Callback routine


===Calling  Syntax===
====Calling  Syntax====


<pre>
<pre>
[xpcontrol] = xpcb uin(Prob)
[xpcontrol] = xpcb_uin(Prob)
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
Line 337: Line 338:
!Input||Description
!Input||Description
|-valign="top"
|-valign="top"
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure. If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set:  ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description  of Output===
====Description  of Output====


{|class="wikitable"
{|class="wikitable"
!Output||Descripion
!Output||Descripion
|-valign="top"
|-valign="top"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
!Parameter||Description
!Parameter||Description
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes. Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes. Set before the callback.
|}
|}


===Description===
====Description====


At each global iteration, when an infeasible node is found the User Infeasible Node Callback routine  is called. The infeasible node is picked up using the global structure ''xpP roblemAttrib.N ODES''. New values for the control variables is returned as sub fields in the ''xpcontrol ''variable.
At each global iteration, when an infeasible node is found the User Infeasible Node Callback routine  is called. The infeasible node is picked up using the global structure ''xpProblemAttrib.NODES''. New values for the control variables is returned as sub fields in the ''xpcontrol ''variable.


===Examples===
====Examples====


Default the infeasible node number is printed.
Default the infeasible node number is printed.


===See Also===
====See Also====


See the documentation for the Xpress''M P ''routine ''XPRSsetcbinfnode''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbinfnode''.


==xpcb_uis==
===xpcb_uis===


===Purpose===
====Purpose====


Xpress''MP'' User Integer Solution Callback routine
Xpress<sup>''M P''</sup> User Integer Solution Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
[xpcontrol] = xpcb uis(Prob)
[xpcontrol] = xpcb_uis(Prob)
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set: ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set: ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
!Output||Description
!Output||Description
|-valign="top"
|-valign="top"
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


===Description===
====Description====


At each global iteration, when an integer solution is found the User Integer Solution Callback routine is called. The integer valued node is picked up using the global structure ''xpP roblemAttrib.N ODES''.  New values for the control variables is returned as sub fields in the ''xpcontrol ''variable.
At each global iteration, when an integer solution is found the User Integer Solution Callback routine is called. The integer valued node is picked up using the global structure ''xpProblemAttrib.NODES''.  New values for the control variables is returned as sub fields in the ''xpcontrol ''variable.


===Examples===
====Examples====


Default the node number with an integer solution is printed, together with the objective function value.
Default the node number with an integer solution is printed, together with the objective function value.


===See Also===
====See Also====


See the documentation for the Xpress''M P ''routine ''XPRSsetcbintsol''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbintsol''.


==xpcb_uon==
===xpcb_uon===


===Purpose===
====Purpose====


Xpress ''MP'' User Optimal Node Callback routine
Xpress<sup>''M P''</sup> User Optimal Node Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
[Feasible] = xpcb uon(Prob)
[Feasible] = xpcb_uon(Prob)
</pre>
</pre>


===Description  of Input===
====Description  of Input====


{|class="wikitable"
{|class="wikitable"
!Input||Description
!Input||Description
|-valign="top"
|-valign="top"
''Prob                 ''A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set:  ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


'''Description  of Output'''
====Description  of Output====


{|class="wikitable"
{|class="wikitable"
Line 443: Line 444:
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
!Parameter||Description
!Parameter||Description
|-valign="top"
|-valign="top"
|''xpControlAttrib''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlAttrib''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemVariables''||Structure with all Xpress''M P ''problem attributes. Set before the callback.
|''xpProblemVariables''||Structure with all Xpress<sup>''M P''</sup> problem attributes. Set before the callback.
|}
|}


===Description===
====Description====


When an optimal solution for the current node is found the User Optimal Node Callback routine is called.
When an optimal solution for the current node is found the User Optimal Node Callback routine is called.


===Examples===
====Examples====


Default the node number and the function value is printed.
Default the node number and the function value is printed.


===See Also===
====See Also====


See the documentation for the Xpress''M P ''routine ''XPRSsetcboptnode''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcboptnode''.


==xpcb_uop==
===xpcb_uop===


===Purpose===
====Purpose====


Xpress ''MP'' User Output Callback routine
Xpress<sup>''M P''</sup> User Output Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
Line 477: Line 478:
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
Line 498: Line 499:
-1 = No message
-1 = No message
|-valign="top"
|-valign="top"
|''Prob                 ''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set: ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set: ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
!Output||Description
!Output||Description
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress''M P''
|''xpcontrol''||Structure with the control fields that the user wishes to be set in Xpress<sup>''M P''</sup>
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
!Parameter||Description
!Parameter||Description
|-valign="top"
|-valign="top"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes. Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes. Set before the callback.
|}
|}


===Description===
====Description====


Every time the ''XpressMP'' solver wants to output a message, this routine is called. An error or warning message is always printed in the Matlab command window, if this callback is enabled. If the control variable ''OUTPUTLOG ''is true, then also normal messages are printed in the Matlab command window.
Every time the ''XpressMP'' solver wants to output a message, this routine is called. An error or warning message is always printed in the Matlab command window, if this callback is enabled. If the control variable ''OUTPUTLOG ''is true, then also normal messages are printed in the Matlab command window.


===See Also===
====See Also====


See the documentation for the Xpress''MP'' routine ''XPRSsetcbmessage''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbmessage''.


==xpcb_upn==
===xpcb_upn===


===Purpose===
====Purpose====


Xpress''MP'' User Preprocess Node Callback routine
Xpress<sup>''M P''</sup> User Preprocess Node Callback routine


===Calling Syntax===
====Calling Syntax====


<pre>
<pre>
[Feasible] = xpcb upn(Prob)
[Feasible] = xpcb_upn(Prob)
</pre>
</pre>


===Description of Input===
====Description of Input====


{|class="wikitable"
{|class="wikitable"
!Input||Description
!Input||Description
|-valign="top"
|-valign="top"
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set:  ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}
|}


===Description of Output===
====Description of Output====


{|class="wikitable"
{|class="wikitable"
Line 554: Line 555:
|}
|}


===Global Parameters Used===
====Global Parameters Used====


{|class="wikitable"
{|class="wikitable"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


===Description===
====Description====


The User Preprocess Node Callback routine is called before the analysis of the node.  The user might have an efficient method in determining if the node is LP feasible or not. If the return flag is changed to one, the node is not further considered.
The User Preprocess Node Callback routine is called before the analysis of the node.  The user might have an efficient method in determining if the node is LP feasible or not. If the return flag is changed to one, the node is not further considered.


===Examples===
====Examples====


Default the node number is printed.
Default the node number is printed.


===See Also===
====See Also====


See the documentation for the Xpress ''MP'' routine ''XPRSsetcbprenode''.
See the documentation for the Xpress<sup>''M P''</sup> routine ''XPRSsetcbprenode''.


==xpcb_usn==
===xpcb_usn===


===Purpose===
====Purpose====


Xpress ''MP'' User Select Node Callback routine
Xpress<sup>''M P''</sup> User Select Node Callback routine


===Calling  Syntax===
====Calling  Syntax====


<pre>
<pre>
Line 586: Line 587:
</pre>
</pre>


====Description  of Input====


{|class="wikitable"
|''node''||Node selected by Xpress<sup>''M P''</sup>
|-valign="top"
|''Prob''||A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem structure, otherwise the user optionally can set: ''Prob.P  ''= ''ProblemNumber'';, where ProblemNumber is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x_L'', ''Prob.x_U'', ''Prob.A'', ''Prob.b_L'', ''Prob.b_U''.
|}


'''Description  of Input'''
====Description  of Output====
 
''node ''Node selected by Xpress''M P''
 
''Prob                ''A structure.  If TOMLAB calls ''xpress'', then ''Prob ''is the standard TOMLAB problem struc- ture, otherwise the user optionally can set:  ''P rob.P  ''= ''P roblemN umber'';, where Problem- Number is some integer.  When the callback routine is called then the arrays that define the current problem are added as fields in ''Prob''. The additional fields are ''Prob.QP.c'', ''Prob.QP.F'', ''Prob.x L'', ''Prob.x U'', ''Prob.A'', ''Prob.b L'', ''Prob.b U''.
 
===Description  of Output===


{|class="wikitable"
{|class="wikitable"
Line 602: Line 603:
|}
|}


===Global Parameters  Used===
====Global Parameters  Used====


{|class="wikitable"
{|class="wikitable"
|-valign="top"
|-valign="top"
|''xpControlVariables''||Structure with all Xpress''M P ''control variables. Set before the callback.
|''xpControlVariables''||Structure with all Xpress<sup>''M P''</sup> control variables. Set before the callback.
|-valign="top"
|-valign="top"
|''xpProblemAttrib''||Structure with all Xpress''M P ''problem attributes.  Set before the callback.
|''xpProblemAttrib''||Structure with all Xpress<sup>''M P''</sup> problem attributes.  Set before the callback.
|}
|}


===Description===
====Description====


Every time the code backtracks to select a new node during the MIP search, the User Select Node Callback routine is called. It is then possible to return another node number, if the user has a better strategy for selecting the new node.
Every time the code backtracks to select a new node during the MIP search, the User Select Node Callback routine is called. It is then possible to return another node number, if the user has a better strategy for selecting the new node.


===Examples===
====Examples====


Default the node number is printed.
Default the node number is printed.


===See Also===
====See Also====


See the documentation for the Xpress ''MP'' routine ''XPRSsetcbchgnode''.
See the documentation for the Xpress<sup>''MP''</sup> routine ''XPRSsetcbchgnode''.

Latest revision as of 10:37, 3 October 2011

Notice.png

This page is part of the Xpress Manual. See Xpress Manual.

The Matlab Interface Routines - Callback Routines

xpcb_bl

Purpose

XpressMP Barrier Log Callback routine

Calling Syntax

[quit,xpcontrol] = xpcb bl(x, slack, pi, rc, Prob)

Description of Input

Input Description
x Solution vector x with decision variable values (n × 1 vector)
slack Vector of slack variables.
pi Lagrange multipliers for the linear constraints, i.e. the dual variables.
rc Lagrange multipliers for the inequality variable constraints, i.e. the reduced costs.
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: P rob.P = P roblemN umber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob._U, Prob.A, Prob.b_L, Prob.b_U. Also Prob.MIP.KNAPSACK is set and variables defining the set of integer variables.

Description of Output

Output Description
quit Return flag. If non-zero, XpressM P will exit.
xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

At each iteration running the barrier algorithm, this routine is called.

Examples

Default some printing is done, and the user should instead write the Matlab statements wanted. The definition of a few control variables are shown as comments.

See Also

See the documentation for the XpressM P routine XPRSsetcbbarlog.

xpcb_gl

Purpose

XpressMP Global Log Callback routine

Calling Syntax

[quit,xpcontrol] = xpcb gl(x, xBIS, Prob)

Description of Input

Input Description
x Latest solution vector x with decision variable values (n × 1 vector). If control variable MIPINFEAS = 0, then x is a new integer solution. If MIPINFEAS > 0, then x is the latest simplex solution.
xBIS Solution vector xBIS with best integer solution found (n × 1 vector), otherwise empty. If control variable MIPINFEAS = 0, then xBIS is the best integer solution found before this step. The new integer solution might or might not be an improvement. If MIPINFEAS > 0, then xBI S is either empty, or the best integer solution found so far.

Description of Input

Input Description
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

quit Return flag. If non-zero, Xpress'M P will exit.
xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

This is the global log callback routine. How often it is called is dependent on the control variable MIPLOG:

  • MIPLOG = 0. No printout in global.
  • MIPLOG = 1. Print out summary statement at the end.
  • MIPLOG = 2. Print out all solutions found, i.e. all integer valued solutions.
  • MIPLOG = 3. Print out each node.
  • MIPLOG < 0. Print out each -M I P LOGth node.

The default value is MIPLOG = -100. If to apply the simple KNAPSACK heuristic that is programmed as an example in this callback routine, then xpcontrol.M I P LOG = 3 should be set.

The following logic describes what x and xBIS are set as, and the relations to the problem attributes that contains function values.

if XPRS_MIPINFEAS > 0
   x    is LP      solution, f(x) = XPRS_LPOBJVAL
   xBIS is empty or the best integer solution, f(x) = XPRS_MIPOBJVAL
   XPRS_MIPOBJVAL == 1E20 before the first integer solution is found
end
if XPRS_MIPINFEAS == 0
   if XPRS_LPOBJVAL == XPRS_MIPOBJVAL
      x    is the best integer solution found, f(x) = XPRS_LPOBJVAL
      xBIS is the old best integer solution found, unknown f(xBIS).
           f(xBIS) could be computed as Prob.QP.c' * xBIS;
   else
      x    is the a new integer solution, but not the best, f(x) = XPRS_LPOBJVAL
      xBIS is the best integer solution found, f(xBIS) = XPRS_MIPOBJVAL
   end
end

Examples

The routine writes out the node number, the node depth, the best bound and the best integer solution so far found. The Matlab code shows an implementation of a simple heuristic, an Xpress MP standard example similar to the example file:

\xpressmp\examples\optimizer\knapsack\knapsack.c.

This implementation assumes that a minimum problem is solved. The heuristic is used if Prob.MIP.KNAPSACK is true. Also xpcontrol.M I P LOG = 3 must be set.

See Also

See the documentation for the XpressMP routine XPRSsetcbgloballog.

xpcb_il

Purpose

XpressMP Simplex Log Callback routine

Calling Syntax

[quit,xpcontrol] = xpcb_il(x, slack, pi, rc, Prob)

Description of Input

Input Description x Solution vector x with decision variable values (n × 1 vector)
slack Vector of slack variables.
pi Lagrange multipliers for the linear constraints, i.e. the dual variables.
rc Lagrange multipliers for the inequality variable constraints, i.e. the reduced costs.
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: P rob.P = P roblemN umber;, where Problem- Number is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description
quit Return flag. If non-zero, XpressM P will exit.
xpcontrol Structure with the control fields that the user wishes to be set in XpressM P
Global Parameters Used
xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

Called at the 0 and last simplex iteration, as well as each LPLOG iteration, where LPLOG is the XPRS LPLOG control variable.

Examples

Default the routine prints the problem number, the iteration number and the current value of the objective function. The user could instead write the Matlab statements wanted. The definition of a few control variables are shown as comments.

See Also

See the documentation for the XpressM P routine XPRSsetcblplog.

Bugs

The variables x, slack, pi and rc are just set as empty. It is not possible to retrieve these variables during the simplex iterations. They will probably be deleted later on.

xpcb_ucb

Purpose

Xpress MP User Choose Branching Variable Callback routine

Calling Syntax

[iPtr, iDir, estdeg, xpcontrol] = xpcb ucb(iPtr, iDir, estdeg, Prob)

Description of Input

Input Description
iPtr Pointer to the variable or the set to branch.
iDir 1 or 3 ( for sets) means upward branch. 0 or 2 ( for sets) means downward branch.
estdeg Estimated degradation using the selected variable or set.
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description
iPtr Pointer to the variable or the set to branch.
iDir 1 or 3 ( for sets) means upward branch. 0 or 2 ( for sets) means downward branch.
estdeg Estimated degradation using the selected variable or set.
xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

At each global iteration, the User Choose Branching Variable Callback routine is called. It gives the user the possibility to set the wanted branching variable. New values for the control variables are also possible to return.

Examples

Default the node number, the branch pointer, the direction and the estimated degradation is printed. The user should instead write the Matlab statements to set the branch pointer, the direction and the estimated degradation.

See Also

See the documentation for the XpressM P routine XPRSsetcbchgbranch. It is demonstrated how to choose branching on the most fractional integer.

xpcb_ucn

Purpose

XpressMP User Node Cut-Off Callback routine

Calling Syntax

[xpcontrol] = xpcb_ucn(node, Prob)

Description of Input

node Node selected by XpressM P
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

Parameter Description
xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

Declares a user node cutoff callback function, called every time a node is cut off as a result of an improved integer solution being found during the Branch and Bound search. New values for the control variables may be returned as sub fields in the xpcontrol variable.

Examples

Default the node number is printed.

See Also

See the documentation for the XpressM P routine XPRSsetcbnodecutoff. User 1s Guide for TOMLAB /Xpress R2004 67

xpcb_uin

Purpose

XpressMP User Infeasible Node Callback routine

Calling Syntax

[xpcontrol] = xpcb_uin(Prob)

Description of Input

Input Description
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Descripion
xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

Parameter Description xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

At each global iteration, when an infeasible node is found the User Infeasible Node Callback routine is called. The infeasible node is picked up using the global structure xpProblemAttrib.NODES. New values for the control variables is returned as sub fields in the xpcontrol variable.

Examples

Default the infeasible node number is printed.

See Also

See the documentation for the XpressM P routine XPRSsetcbinfnode.

xpcb_uis

Purpose

XpressM P User Integer Solution Callback routine

Calling Syntax

[xpcontrol] = xpcb_uis(Prob)

Description of Input

Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description
xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

At each global iteration, when an integer solution is found the User Integer Solution Callback routine is called. The integer valued node is picked up using the global structure xpProblemAttrib.NODES. New values for the control variables is returned as sub fields in the xpcontrol variable.

Examples

Default the node number with an integer solution is printed, together with the objective function value.

See Also

See the documentation for the XpressM P routine XPRSsetcbintsol.

xpcb_uon

Purpose

XpressM P User Optimal Node Callback routine

Calling Syntax

[Feasible] = xpcb_uon(Prob)

Description of Input

Input Description
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description
Feasible If 0, the node is accepted as optimal.

Global Parameters Used

Parameter Description
xpControlAttrib Structure with all XpressM P control variables. Set before the callback.
xpProblemVariables Structure with all XpressM P problem attributes. Set before the callback.

Description

When an optimal solution for the current node is found the User Optimal Node Callback routine is called.

Examples

Default the node number and the function value is printed.

See Also

See the documentation for the XpressM P routine XPRSsetcboptnode.

xpcb_uop

Purpose

XpressM P User Output Callback routine

Calling Syntax

xpcb_uop(msg, msgLevel, Prob)

Description of Input

msgLevel||Error Level 4 = Error 3 = Warning 2 = Dialogue 1 = Information 0 = Flush buffers -1 = No message
Input Description
msg Error message string.
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description xpcontrol Structure with the control fields that the user wishes to be set in XpressM P

Global Parameters Used

Parameter Description
xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

Every time the XpressMP solver wants to output a message, this routine is called. An error or warning message is always printed in the Matlab command window, if this callback is enabled. If the control variable OUTPUTLOG is true, then also normal messages are printed in the Matlab command window.

See Also

See the documentation for the XpressM P routine XPRSsetcbmessage.

xpcb_upn

Purpose

XpressM P User Preprocess Node Callback routine

Calling Syntax

[Feasible] = xpcb_upn(Prob)

Description of Input

Input Description
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description
Feasible A 1 shows the node is LP infeasible, a 0 that it is feasible.

Global Parameters Used

xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

The User Preprocess Node Callback routine is called before the analysis of the node. The user might have an efficient method in determining if the node is LP feasible or not. If the return flag is changed to one, the node is not further considered.

Examples

Default the node number is printed.

See Also

See the documentation for the XpressM P routine XPRSsetcbprenode.

xpcb_usn

Purpose

XpressM P User Select Node Callback routine

Calling Syntax

[xpcontrol] = xpcb usn(node, Prob)

Description of Input

node Node selected by XpressM P
Prob A structure. If TOMLAB calls xpress, then Prob is the standard TOMLAB problem structure, otherwise the user optionally can set: Prob.P = ProblemNumber;, where ProblemNumber is some integer. When the callback routine is called then the arrays that define the current problem are added as fields in Prob. The additional fields are Prob.QP.c, Prob.QP.F, Prob.x_L, Prob.x_U, Prob.A, Prob.b_L, Prob.b_U.

Description of Output

Output Description
node User selected node.

Global Parameters Used

xpControlVariables Structure with all XpressM P control variables. Set before the callback.
xpProblemAttrib Structure with all XpressM P problem attributes. Set before the callback.

Description

Every time the code backtracks to select a new node during the MIP search, the User Select Node Callback routine is called. It is then possible to return another node number, if the user has a better strategy for selecting the new node.

Examples

Default the node number is printed.

See Also

See the documentation for the XpressMP routine XPRSsetcbchgnode.