Home
C API Reference Manual
Contents
1. 682 Macro CPXERR DUP ENTRY 683 Macro CPXERR EXTRA BOUND 684 Macro CPXERR EXTRA FR BOUND 685 Macro CPXERR EXTRA FX 44 ttti ttt ttt ttes aa 686 Macro CPXERR EXTRA 1 687 Macro CPXERR EXTRA 4 4 688 Macro CPXERR EXTRA SOSEND ettet ttt ttt ttt ttt ttt tt oat na 689 Macro CPXERR EXTRA 505 4 4 14 690 Macro CPXERR FAIL OPEN 0 42 4 691 Macro CPXERR FAIL OPEN 692 Macro CPXERR FILE 4 4 21 4 4 693 Macro CPXERR FILE FORMAT nnne 694 Macro CPXERR FILTER VARIABLE TYPE eene 695 Macro CPXERR ILL DEFINED PWL sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssseessssiessssseesssueessssteesssueesssseeessase 696 Macro CPXERR ILOG ttt ntt 697 Macro CPXERR 698 Macro CPXERR IN
2. 266 Global function CPXgetcrossdexchont eese 267 Global function CPXaddsos deerit eerie erect 268 Global function 269 Global function CPXbaropt 22 04 nei a cnet 271 Global function CPXdelsolnpoolfilters eres eese sentent nennen nnne nnn 272 Global function GPXmipopt 5 Hirn ce io 273 Global function 274 Global function CPXtuneparam 3 cetur iret recor ees 275 Global function 277 Global function 279 Global function 280 Global function 281 Global function 282 Global function 5 284 Global function 285 Global function
3. 478 Global function CPXqpdjfrompi cesses esee 479 Global function 480 Global function 481 Global function 482 Global function 483 Global function CPXpresolyve R tro ene rude 484 Global function 485 Global function CPXcrushpi 5 ener ceci Lo 486 Global function 487 Global function CPXgelrOws 489 Global fuUNCtion CPXSUCPY PE 490 Table of Contents Global function CPXgetindconstrindex eese eese 491 Global function CPXaddqconstr 1 492 Global function CPXgetcallbacknodelb eese eee 494 Global function CPXsetnetcallbackfunc esee 495 Global function 497 Global function
4. 339 Global function 340 Global function 342 Global function 344 Global function 345 Global function CPXchgcCtypo 34 titi teca ra 346 Global function CPXgetsosinfeas cesses eese seen eene e nennen nnne nnns ntnn nana ne nn sita nnnm s stra seins nnnm nnne 347 Global function 348 Global function 349 Global function 350 Global function 352 Table of Contents Global function 5 353 Global function 354 Global function 8 355 Global function CPXfeasoptext cerne intesa rl edges 356 Global function 358 Global function CPXhybbaropt 3 5 irent ennt 359 Globa
5. 114 Global function CPXgetnumbsos 0e iere eti Rocca teca dece 115 Global function nennen nennen natnra nnns stain nnns nnns inns nter nnne nn 116 Global function CPXsolution 5 117 Global function 5 119 Global function 120 Global function 121 Table of Contents Global function 123 Global function 124 Global function 125 Global function CPXgeltbhead e ierra 127 Global function 128 Global function 5 129 Global function 130 Global function CPXgetxqX ax 131 Global function 132 Global function 133 Global function
6. 76 Global function GPXbInVarowWw 2 77 Global function 78 Global function 79 Global function 5 80 Global function 81 Global function 8 82 Global function 5 84 Global function 85 Global function 86 Global function 87 Table of Contents Global function 5 88 Global function CPXdualfarkas 1 iecore eee nec 89 Global function 90 Global function CPXdelcols tect erase 91 Global function 92 Global function 93 Global function 94 Global function CPXcheckchgcoeflist
7. 4 Group 8 Group 17 Group 18 Group 19 Group 20 Group 21 Group optim cplex callable advanced callbacks esee eee eene eee eene nennen nnne nnn nnne 24 Group optim cplex callable analyzesolution cessisse eene nenne nenne nennen nennen nnn nnn nn nina nennt nnns nnn 26 Group optim cplex callable callbacks eeee scene eene senten enne nennen nennen nnn nnn nnn nnn n ni nn nina nnnm n ntn nnn 27 Group eene enne nennen ntn nnn nnne nina nennt nnne nnn 28 Group eene nennen nenne nnn nannten nnn nsns ntn sinn sinn sita nnnm natn nnn 29 Group
8. 134 Global function CPXdelmipstarts 2 iacere Leere Leere rennen 135 Global function 136 Global function CPXsolwritesoInpoolall ce eeee eere eene nennen nenne nnne nnne nnn nnnm nnne nnnm annee 137 Global function 138 Global function CPXgelub nine eee ice Lees dires pude iens 139 Global fUNCtION 140 Global function GPXfreeprob dien nini esrb 141 Global function 142 Global function CPXcopyctype 1 3 encendido ee 143 Global function 144 Global function CPXobjsa css detinere Decreti eee 145 Global function 146 Global function CPXgeltdj 2 eoe lA tee re esee secun 147 Global function 148 Global function 149 Global function 150 Global function
9. 188 Global function 189 Global function CPXgelpi 190 Global function 191 Global function 192 Global function 193 Global function 194 Global function 195 Global function CPXaddfpdest 5 1 o eene eerie 198 Global function 199 Global function CPXfltwrite 5 2 3 cerent Ede tenete recette a 200 Global function 201 Global function 202 Global function 203 Global function CPXfree sercuts 3 ce 204 Global function 205 Global function CPXdelqconstrs 1 irren Ine rni He eek nee 206 Global function
10. 539 Global function 540 Global function CRPXCh COC fi sizes 2c 31 deinen 541 Global function 542 Global function CPXunscaleprob 3 2 eor voir able 543 Global function 5 5 544 Global function 545 Macro CPX DUAE OBJ 2 5 hand que dee 546 Macro CPX EXACT KAPPA rinde nter eL cnspete eb ru sa case dn 547 Macro CPX KABPA 2 12 1 0 548 Macro CPX COMP 51 549 Macro CPX MAX DUAL 550 Macro CPX MAX DUAL 551 Macro CPX MAX INDSLACK 5 2 2 2 nena nnne ntn nnn ns tn nitas 552 Macro CPX INEEAS sien scala 553 Macro P 554 Macro CPX PRIMAL 555 Macro CPX MAX PRIMAL 556 Table of Contents Macro CPX QCPRIMAL Macro CPX MAX 5
11. 151 Global function 152 Table of Contents Global function 153 Global function GPXchgrhs e ies Loose 154 Global function 5 155 Global function CPXbranchcallbackbranchconstraints esee esee eene eene nennen tnnt 156 Global function 158 Global function 160 Global function 161 Global function 162 Global function 163 Global function GPXcligob 5 nite rient 164 Global function 165 Global function CPXgetnumculs ee eL ette eine te eco Races 166 Global function 167 Global function CPXsetlogfile 31 3 4 niri c eee erre Ine ce
12. 1 int total number of MIP iterations returns 1 if feasible solution exists otherwise 0 BACK CPX CALLBACK INFO CUTOFF double updated cutoff value IP FI int CPX CALLBACK INFO IMPLBD COUNT int number of implied bound cuts added 387 CPX CALLBACK INFO COUN int number of multi commodity flow cuts added number of mixed integer rounding cuts nt added nt CPX CA INFO ZEROHALFCUT COUNT i number of zero half cuts added returns pointer to original user problem available for primal dual barrier MIP BACK CPX CALLBACK INFO PROBE PHAS int current phase of probing 0 3 F CPX CAL INFO PROBE PROGRESS double fraction of probing phase completed 0 0 1 0 RCUT COUN i LBACK_ BACK CK INFO USER PROBLEM CPXCLPptr fraction of Gomory cut generation for the pass completed 0 0 1 0 INFO FRACCUT fraction of disjunctive cut generation for the pass completed 0 0 1 0 K INFO DISJCUT fraction of flow cover and MIR cut generation K_INFO_FLOWMIR_ for the pass completed 0 0 1 0 identifier of the parallel thread making this INFO call total number of parallel threads currently
13. CPX CALLBACK QPSIMPLEX From QP simplex cbhandle Pointer to user private data as passed to CPXsetl1pcallbackfunc Parameters 513 env A pointer to the CPLEX environment as returned by CPXopenCPLEX myfunc A pointer to a user written callback function Setting callback to NULL prevents any callback function from being called during optimization The call to callback occurs after every iteration during optimization and periodically during the CPLEX presolve algorithms This function is written by the user and is prototyped as documented here cbhandle A pointer to user private data This pointer is passed to the callback function Example Status CPXsetlpcallbackfunc env myfunc NULL See Also CPXgetcallbackinfo CPXsetmipcallbackfunc CPXsetnetcallbackfunc Returns The routine returns zero if successful and nonzero if an error occurs 514 Global function CPXinfodblparam int CPXinfodblparam CPXCENVptr env int whichparam double defvalue p double minvalue p double maxvalue p Definition file cplex h The routine CPXinfodblparam obtains the default minimum and maximum values of a CPLEX parameter of type double Note Values of zero obtained for both the minimum and maximum values of a parameter of type double mean that the parameter has no limit The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values
14. Example Status CPXgetcallbackglobalub env cbdata wherefrom gub 0 cols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback ub An array to receive the values of the global upper bound values This array must be of length atleast end begin 1 If successful ub 0 through ub end begin contain the global upper bound values begin An integer specifying the beginning of the range of upper bound values to be returned end An integer specifying the end of the range of upper bound values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 410 Global function CPXcopybase int CPXcopybase CPXCENVptr env CPXLPptr lp const int cstat const int rstat Definition file cplex h The routine CPXcopybase copies a basis into a CPLEX problem object It is not necessary to copy a basis prior to optimizing an LP problem but a good initial basis can increase the speed of optimization significantly A basis does not need to be primal or dual feasible to be used by the optimizer Note The basis is ignored by the optimize
15. 882 Macro CPXMIP TIME 5 883 Macro CPXMIP_UNBOUNDED ccccccsccssssenesseenseseeesessneseeneesseesaesenesaeseaesaesnoeseeesaesenesaessasasnesaeuenesaeeeneeaeeas 884 xxviii About This Manual This reference manual documents the Callable Library the C application programming interface API of IBM R ILOG R CPLEX R There are separate reference manuals for the C Java C NET and Python APIs of CPLEX Following this table that summarizes the groups in this manual you will find more information e What Are the CPLEX Component Libraries What You Need to Know Notation and Naming Conventions Related Documentation Group Summary optim cplex callable The API of the CPLEX Callable Library for users of C optim cplex callable accessmipresults The routines in the CPLEX Callable Library to access MIP results The routines in the CPLEX Callable Library to access network results The routines in the CPLEX Callable Library to access QCP or SOCP results optim cplex callable accessresults The routines in the CPLEX Callable Library to access results optim cplex callable accessnetworkresults optim cplex callable accessqcpresults optim cplex callable advanced The API of the advanced C routines of the CPLEX Callable Library The API of the advanced C callback routines of the CPLEX Callable Library optim cplex callable analyz
16. ttt 785 Macro CPXERR 786 Macro CPXERR TOO 787 Macro CPXERR TOO SMALL eene 788 Table of Contents Macro CPXERR PRESLV 789 Macro CPXERR PRESLV BAD 4 422 790 Macro CPXERR PRESLV BASIS 791 Macro CPXERR PRESLV 792 Macro CPXERR PRESLV 506 4 793 Macro CPXERR PRESLV 794 Macro _ 795 Macro CPXERR PRESLV FAIL 796 Macro CPXERR_PRESLV_INF ssssssssssssssssssssssssssssssssssssssssssssssessssssessssssesssssesssssessssiesssssessssueessssueesssneesssseeessass 797 Macro _ 798 Macro CPXERR PRESLV NO 5 8 799 Macro CPXERR PRESLV NO 800 Macro CPXERR PRESLV SOLN MIP
17. 245 Global function 246 Global function 247 Global function 248 Global function 249 Global function CPXNETsolution e eeeeeeeee eene nennen nennen nnn nnne nnn nnns nnns inna 250 Global function 251 vii Table of Contents Global function 252 Global function 253 Global function 5 255 Global function 256 Global function 5 257 Global function 259 Global function 5 260 Global function CPXgeltcols 261 Global function 262 Global function 263 Global function 265 Global function 5
18. SENSE Definition file cplex h CPXERR QCP SENSE 6002 Illegal quadratic constraint sense Legal sense symbols for quadratic constraints are L and G 817 Macro CPXERR QCP SENSE FILE Definition file cplex h CPXERR QCP SENSE FILE 1437 Line 96d Illegal quadratic constraint sense LP reader does not allow equality in quadratic constraints MPS file format does not allow N or R in quadratic constraints 818 Macro CPXERR QUAD EXP NOT 2 Definition file cplex h CPXERR QUAD EXP NOT 2 1613 Line 96d Quadratic exponent must be 2 Only an exponent of 2 is allowed after the exponentiation operator 819 Macro CPXERR QUAD ROW Definition file cplex h CPXERR QUAD IN ROW 1605 Line 96d Illegal quadratic term in a constraint Quadratic terms are not allowed in indicator constraints lazy constraints or user cuts 820 Macro CPXERR RANGE SECTION ORDER Definition file cplex h CPXERR RANGE SECTION ORDER 1474 Line 96d RANGES section out of order The RANGES section can appear only after the RHS section in an MPS file 821 Macro CPXERR RESTRICTED VERSION Definition file cplex h CPXERR RESTRICTED VERSION 1016 Promotional version Problem size limits exceeded The current problem is too large for your version of CPLEX Reduce the size of the problem 822 Macro CPXERR RHS Definition file cplex h CPXERR RHS IN OBJ 1603 Line 964 RHS sense in objective
19. 801 Macro CPXERR PRESLV SOLN 802 Macro CPXERR PRESLV START 2 803 Macro CPXERR PRESLYV TIME 804 Macro CPXERR PRESLV 805 Macro CPXERR PRESLV UNCRUSHFORM ettet ttt ttt tet 806 Macro D A 807 Macro CPXERR DATA 808 Macro CPXERR 809 Macro CPXERR PTHREAD 810 Macro CPXERR PTHREAD MUTEX INIT tnnt ttt 811 Macro CPXERR Q DIVISOR entente ttt ttt ttt ntt 812 Macro CPXERR DUP 813 Macro CPXERR Q INDEF entente 814 Macro CPXERR Q POS _DEF ccssssssssssssssssssssssssssssssssssssssssssssessssssesssssssssssesssssiessssuessssseessssueesssueesssneeessase 815 Macro CPXERR Q NOT 5 ttt ttt 816 Macro CPXERR_QCP_SENSE ccssssssssssssssssssssssssssssssssssssssssssssssssssseesssssessssuessssseessssiessssseesssneessssueesssueesssseeessass 817 XXV Table of Contents Macro CPXERR QCP SENSE Macro CPX
20. Example Status CPXgetcallbackctype env cbdata wherefrom prectype 0 precols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback xctype An array where the ctype values for the MIP problem will be returned The array must be of length at least end begin 1 If successful xctype 0 through xctype end begin contain the variable types begin An integer specifying the beginning of the range of ctype values to be returned end An integer specifying the end of the range of ctype values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 116 Global function CPXsolution int CPXsolution CPXCENVptr env CPXCLPptr lp int lpstat p double objval p double x double pi double slack double dj Definition file cplex h The routine CPXsolution accesses the solution values produced by all the optimization routines except the routine CPXNETprimopt The solution is maintained until the CPLEX problem object is freed via a call to CPXfreeprob or the solution is rendered invalid because of a call to one of the problem modificatio
21. 596 Macro CPX STAT 597 Macro CPX STAT INFOorUNBD nnne ttt ntt ttt 598 Macro CPX STAT NUM BEST 599 Macro STAT OPTIMAL see d tus ecd 600 Macro CPX_STAT_OPTIMAL_FACE_UNBOUNDED c sssssssssssssssssssssssssssssssssssssssssssssessssseesssstessssseesssseessease 601 Macro CPX STAT INFEAS entente 602 Macro CPX STAT RELAXED 603 Macro CPX STAT OPTIMAL RELAXED QUAD sssssssssssssssssssssssssssssssssssstssssssesssssssessssesssssesssssteesssseesssseesssese 604 Macro CPX STAT OPTIMAL RELAXED SUM nnne 605 Macro CPX_STAT_UNBOUNDED scsssssssssssssssssssssssssssssssssssssssessssssesssssesssssesssseessssiessssueesssseesssauessssseessssueessane 606 Macro CPX_SUM_COMP_SLACK sscssssssssssssssssssssssssssssssssssssssssssssseesssssesssstsesssseessssieesssseesssneesssateesssseesssseesssase 607 Macro CPX_SUM_DUAL_INFEAS cc ssssssssssssssssssssssssssssssssssssssssssssessssssssssssesssssessssiessssseesssueessssiessssueesssseeessase 608 Macro CPX SUM DUAL 609 Macro CPX SUM INDSLACK 5 44 04 610 Macro CPX SUM INFEAS
22. Use the routine CPXchgmipstarts to modify or extend existing MIP starts Example status CPXaddmipstarts env lp mcnt nzcnt beg varindices values effortlevel mipstartname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob ment An integer giving the number of MIP starts to be added This specifies the length of the arrays beg effortlevel and mipstartname nzcnt An integer giving the number of variable values to be added This specifies the length of the arrays varindices and values beg An array of length ment used with varindices and values 0 must be 0 zero The elements specific to each MIP start i must be stored in sequential locations in arrays varindices and values from position beg i to 1 1 1 or from beg i to nzcnt 1if i mcnt 1 varindices An array of length nzcnt containing the numeric indices of the columns corresponding to the variables which are assigned starting values values 340 An array of length nzcnt containing the values to use for the MIP starts The entry values j is the value assigned to the variable indices j entry values j greater than or equal to INFBOUND specifies that no value is set for the variable indices j effortlevel An array of length mcnt The value e fortlevel i specifies specifies the level of effort CPLEX should exert
23. Macro CPX QCSLACK Macro MAX RED Macro CPX MAX SCALED DUAL Macro CPX SCALED DUAL Macro CPX SCALED Macro CPX SCALED PRIMAL 5 4 Macro CPX SCALED PRIMAL 2 4 1 Macro CPX MAX SCALED RED 8 Macro CPX SCALED 51 Macro CPX MAX SCALED Macro CPX_MAX_SLACK csscsssssseseesseeseeeseeseesneessneneessnenesesneneeesneneneneesneneeseneneesnnesaesae Pb dip dL Macro CPX PRIMAL OBJ Macro SOLNPOOL Macro SOLNPOOL Macro SOLNPOOL FILTER Macro SOLNPOOL FILTER Macro SOLNPOOL Macro STAT ABORT DUAL Macro CPX STAT Macro STAT ABORT Macro STAT ABORT PRIM Macro CPX STAT ABORT TIME
24. 498 Global function CPXstrongbranch eese sees esee ee enne nennen ennt nnn nana n nnn natns ttn s sts s nsns stre snnm san nn nsn nn 499 Global function 500 Global function 501 Global function 502 Global function 503 Global function CPXchgnaimme 3 cere rentre leer e eco Recon 504 Global function 505 Global function CGPXCODySOS 2 edente ce eee eiie Ieri 506 Global function 507 Global function CPXfeasopL eshte ninth 509 Global function 512 Global function 513 Global function nnns anna ses n anna ns nanna 515 Global function 516 Global function 517 Global function CPXgetctype 2 2 denen
25. 737 Macro CPXERR_NO_MEMORY cccssscsssssssssssssssssssssssssssssssssssssssssssssseesssssesssssesssseessssiessssueesssueeesssueesssseesssseeesease 738 Macro CPXERR NO MIPSTART entrent ttt ttt ttt 739 Macro CPXERR NO NAME SECTION eene ttt ttt 740 Macro CPXERRCNO NAMES noc tidie citet 741 Macro CPXERR t 742 Macro CPXERR NUNBER entrent 743 Macro CPXERR NO NUMBER BOUND centenis ttt ttes nae 744 Macro CPXERR NO NUMBER 5 04404 745 Macro CPXERR 5 6 ttt ttt 746 Macro CPXERR_NO_OBJECTIVE ssssssssssssssssssssssssssssssssssssssssssessssssssssssessssssessssseessssesssanessssaeesssseessssneesssaesssass 747 Macro CPXERR NO OR 8 748 Macro CPXERR 749 Macro CPXERR NO ORDER ttt ttt 750 Macro CPXERR PROBLEM centre ttt ttt ntt ttt ttt ttt 751 Macro CPXERR NO SECTION eene ttt 752 Macro CPXERR OPERATOR ttt ttt tette 753 Macro CPXERR NO QUAD EXP ssssssssss
26. The conflict status can also be queried with the routine CPXget stat Row and Column Status In the array rowbdstat integer values are returned specifying the status of the corresponding row in the conflict For row rowind i rowbdstat i can assume the value CPX CONFLICT MEMBER for constraints that participate in a minimal conflict When the computed conflict is not minimal rowbdstat i can assume the value CPX CONFLICT POSSIBLE MEMBER to report that row i has not been proven to be part of the conflict If a row has been proven not to belong to the conflict its index will not be listed in Similarly the array colbdstat contains integers specifying the status of the variable bounds in the conflict The value specified in colbdstat i is the conflict status for variable colind i If colind i has been proven to be part of the conflict colbdstat i will take one of the following values CPX CONFLICT MEMBER CPX CONFLICT LB Or CONFLICT UB When variable colind i has neither been proven to belong nor been proven not to belong to the conflict the status colbdstat i will be one of the following values eCPX CONFLICT POSSIBLE MEMBER CONFLICT POSSIBLE LB Of eCPX CONFLICT POSSIBLE UB In both cases the status specifies that only the lower bound is part of the conflict Similarly the status specifies th
27. 2 649 Macro CPXERR BAD LAZY ttt 650 Macro CPXERR BAD LUB c sssssssssssssssssssssssssssssssssssssssssssssesssseessssseesssssessssessssseessssiessssueesssseessssuesssaseesssneeessase 651 Macro CPXERR BAD METHOD ccenntttnttttnntttnnttttn ttt 652 Macro CPXERR BAD NUMNBER entente 653 Macro CPXERR B D OBJ SENSE se Eod citet 654 Macro CPXERR BAD 655 Macro CPXERR BAD cette 656 Macro CPXERR BAD PIVOT entente 657 Macro CPXERR BAD 658 Macro CPXERR BAD PROB 2 4 4 4414 659 Macro BAD 660 Macro CPXERR BAD SECTION BOUNDS ennt 661 Macro CPXERR BAD SECTION ENDATA csssssssssssssssssssssssssssssssssssssssssssssssssssesssssesssssessssseessssiessssneesssseessease 662 Macro CPXERR BAD SECTION 663 Macro CPXERR BAD SENTGE ettet ttt ttt ttt ttt ttt t ttt 664 Macro CPXERR BAD SOS 0 1 665 Macro CPXERR
28. 2 242424411111 Macro CPX STAT ABORT 5 Macro CPX STAT CONFLICT ABORT Macro CPX STAT CONFLICT ABORT osuere 560 ERU 571 OMNE 573 ULT 575 xvii Table of Contents Macro CPX STAT CONFLICT ABORT MEM 586 Macro CPX STAT CONFLICT ABORT NODE LIM enne 587 Macro CPX STAT CONFLICT ABORT LIM ennt ttt ttt 588 Macro CPX STAT CONFLICT ABORT TIME 589 Macro CPX STAT CONFLICT ABORT USER ttt ttt ttt ttt 590 Macro CPX STAT CONFLICT 2 4 4 591 Macro CPX STAT CONFLICT 4 592 Macro STAT FEASIBLE 593 Macro STAT FEASIBLE RELAXED 594 Macro STAT FEASIBLE RELAXED 595 Macro CPX STAT FEASIBLE RELAXED 5
29. nnne ttt 611 Macro CPX SUM BI e Ue 612 Macro CPX SUM PRIMAL 613 Macro CPX SUM PRIMAL RESIDUAL tnnt 614 xviii Table of Contents Macro CPX SUM QCPRIMAL RESIDUAL entere Macro CPX SUM QCSLACK e eeree esee nene eren ese sane saa sn enano ras Macro CPX SUM QCSLACK Macro CPX SUM RED COST as aiia eibi No v tefta a a boe Macro CPX SUM SCALED DUAL INFEAS creen Macro CPX SUM SCALED DUAL RESIDUAL ctt Macro CPX SUM SCALED Macro CPX SUM SCALED PRIMAL INFEAS center tette Macro CPX SUM SCALED PRIMAL RESIDUAL entente tenente nnns Macro CPX SUM SCALED RED COST nennen Macro CPX SUM SCALED 5 Macro SUM SCALED Macro CPX SUM 51 Macro CPX SUM MP dee Macro CPXERR ABORT 5 Macro CPXERR ADJ SIGN Macro CPXERR ADJ SIGN SENSE center Macro
30. pointer is to pass it to the callback information routines wherefrom An integer value reporting at which point in the optimization this function was called It has the value CPX CALLBACK HEURISTIC for the heuristic callback cbhandle A pointer to user private data objval p A pointer to a variable that on entry contains the optimal objective value of the subproblem and on return contains the objective value of the integer solution found if any X An array that on entry contains primal solution values for the subproblem and on return contains solution values for the integer solution found if any The values are from the original problem if the parameter PARAM MIPCBREDLP is turned off that is set to CPX OFF otherwise the values are from the presolved problem checkfeas p A pointer to an integer that specifies whether or not CPLEX should check the returned integer solution for integer feasibility The solution is checked if p is nonzero When the solution is checked and found to be integer infeasible it is discarded and optimization continues useraction p A pointer to an integer to contain the specifier of the action to be taken on completion of the user callback The table summarizes the possible values Actions to be Taken after a User Written Heuristic Callback CPX CALLBACK DEFAULT No solution found CPX CALLBACK FAIL Exit optimization CPX CALLBACK SE Use user sol
31. siete eene nnne nennen nnn nnnm nnne nnnm nnne nnns 207 Global function CPXNETgeltslack 2 2 eterne 208 Global function 209 Global function 5 210 Global function 55 1 211 Global function 212 Global function 213 Global function 215 Global function 216 Global function 217 Global function 218 Table of Contents Global function 219 Global function 220 Global function 221 Global function 223 Global function 224 Global function CPXgetnumint 3 2 nier am tese tee seeds 225 Global function
32. 30 Group 31 Group 32 Group 33 Group 35 Group 37 Group 38 Group 39 Group 40 Group 41 Group 42 Group 43 Group 44 Group 5 45 Group 5 46 Group 48 Table of Contents Group 49 Group optim cplex callable writ
33. OPTIMAL RELAXED QUAD OPTIMAL RELAXED SUM OPTIMAL TOL CPXMIP POPULATESOL SOL LIM TIME FEAS TIME INFEAS UNBOUNDED 115 MIP only enum Optimallnfeas 118 MIP only enum Unbounded This table lists the statuses for solutions to LP QP or MIP problems These values are returned by the Callable Library routine CPXgetstat or by the Concert Technology methods getCplexStatus and getCplexSubStatus ofthe class 11oCplex If no solution exists the return value is zero About Unboundedness The treatment of models that are unbounded involves a few subtleties Specifically a declaration of unboundedness means that CPLEX has determined that the model has an unbounded ray Given any feasible solution x with objective z a multiple of the unbounded ray can be added to x to give a feasible solution with objective 2 1 or 2 1 for maximization models Thus if a feasible solution exists then the optimal objective is unbounded Note that CPLEX has not necessarily concluded that a feasible solution exists Users can call the routine CPXsolninfo to determine whether CPLEX has also concluded that the model has a feasible solution 61 Global function CPXaddfuncdest int CPXaddfuncdest CPXCENVptr env CPXCHANNELptr channel void handle void CPXPUBLIC msgfunction void const char Definition file cplex h The routine CPXa
34. 226 Global function CPXgetnumnaz 1 Re caeca rinsa aaaea arara nEn asaan BISERNE 227 Global function 5 228 Global function CPXgetsolnpoolnumhtfilters eeeeeeeee eene eene eene nennen nennen nnnm nannten nnne 230 Global function 231 Global function CPXDIRDVFOW eco Ege 234 Global function 235 Global function 236 Global function 237 Global function 238 Global function 5 5 239 Global function 240 Global function 241 Global function 242 Global function 243 Global function 244 Global function
35. Definition file cplex h The routine CPXdelsetsolnpoolsolns deletes solutions from the solution pool of the problem object specified by the argument 1p Unlike the routine CPXdelsolnpoolsolns CPXdelsetsolnpoolsolns does not require the solutions to be in a contiguous range After the deletion occurs the remaining solutions are indexed consecutively starting at O zero and in the same order as before the deletion Note The delstat array must have at least CPXget solnpoolnumsolns lp elements Example status CPXdelsetsolnpoolsolns env lp delstat See Also CPXdelsolnpoolsolns Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob delstat An array specifying the solutions to be deleted The routine CPXdelsetsolnpoolsolns deletes each solution i for which delstat i 1 The deletion of solutions results in a renumbering of the remaining solutions After termination delstat i is either 1 for filters that have been deleted or the new index number that has been assigned to the remaining solutions Returns The routine returns zero if successful and nonzero if an error occurs 109 Global function CPXNETgetnodename int CPXNETgetnodename CPXCENVptr env CPXCNETptr net char nnames char namestore int namespc int surplus p int begin int end Definition file cplex h The routine C
36. env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob X An array to receive the values of the primal variables for the problem This array must be of length at least end begin 1 If successful x 0 through x end begin contains the solution values begin An integer specifying the beginning of the range of variable values to be returned end integer specifying the end of the range of variable values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 179 Global function CPXflushstdchannels int CPXflushstdchannels CPXCENVptr env Definition file cplex h The routine CPX 1ushstdchannels flushes the output buffers of the four standard channels cpxresults cpxwarning cpxerror and cpxlog Use this routine where it is important to see all of the output created by CPLEX either on the screen or in a disk file without calling CPX 1ushchannel for each of the four channels Example status CPXflushstdchannels env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Returns The routine returns zero if successful and nonzero if an error occurs 180 Global function CPXNETcopynet int CPXNETcopynet CPXCENVptr env CPXNETptr net int objsen int nnodes const double supply char nnames int narcs const int fromnode const int tonode cons
37. Definition file cplex h The routine CPXgetnumcols accesses the number of columns in the constraint matrix or equivalently the number of variables in the CPLEX problem object Example cur numcols CPXgetnumcols env lp See also the example 1pex1 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the problem object or environment does not exist CPXgetnumcols returns the value 0 zero otherwise it returns the number of columns variables 189 Global function CPXgetpi int CPXgetpi CPXCENVptr env CPXCLPptr 1 double pi int begin int end Definition file cplex h The routine CPXgetpi accesses the dual values for a range of the constraints of a linear or quadratic program The beginning and end of the range must be specified Example Status CPXgetpi env pi 0 CPXgetnumrows env lp 1 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob pi An array to receive the values of the dual variables for each of the constraints This array must be of length atleast end begin 1 If successful 0 through pi end begin contain the dual values begin An integer specifying the beginning of the range of dual value
38. FEASIBLE RELAXED SUM OPTIMAL RELAXED SUM FEASIBLE RELAXED INF OPTIMAL RELAXED INF FEASIBLE RELAXED QUAD OPTIMAL RELAXED QUAD The routine CPX easopt accepts all problem types However it does not allow you to relax quadratic constraints nor indicator constraints use the routine CPX easoptext for that purpose The parameters PARAM CUTUP CPX PARAM CUTLO CPX PARAM OBJULIM CPX PARAM OBJLLIM do not influence this routine If you want to study infeasibilities introduced by those parameters consider adding an objective function constraint to your model to enforce their effect before you invoke this routine Example status CPXfeasopt env lp rhs rng lb ub Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob rhs An array of doubles of length at least equal to the number of rows in the problem NULL may be specified if no rhs values are allowed to be relaxed When not NULL the array specifies the preference values that determine the cost of relaxing each constraint rng An array of doubles of length at least equal to the number of rows in the problem NULL may be specified if no range values are allowed to be relaxed or none are present in the active problem When not NULL the array specifies the preference values that determine the cos
39. See Also CPXgetcallbackinfo 535 Returns The routine returns zero if successful and nonzero if an error occurs 536 Global function CPXfclose int CPXfclose CPXFILEptr stream Definition file cplex h The routine 1 closes files that are used in conjunction with the routines CPXaddfpdest CPXdelfpdest and CPXsetlogfile It is used in the same way as the standard C library function fclose Files that are opened with the routine CPX open must be closed with the routine CPXfclose When to use this routine Call this routine only after the message destinations that use the file pointer have been closed or deleted Those destinations such as log files might be specified by routines such as CPXaddfpdest CPXdelfpdest and CPXsetlogfile Example CPXfclose fp See 1pex5 c in the CPLEX User s Manual Parameters stream A pointer to a file opened by the routine CPXfopen Returns The routine returns zero if successful and nonzero if an error occurs The syntax is identical to the standard C library routine fclose 537 Global function CPXversion CPXCCHARptr CPXversion CPXCENVptr env Definition file cplex h The routine CPXversion returns a pointer to a string specifying the version of the CPLEX library linked with the application The caller should not change the string returned by this function Example printf CPLEX version is s n CPXversion env Parameters env A pointe
40. The array must be of length at least end begin 1 If successful x 0 through x end begin contain the row activities Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob x An array to receive the values of the row activity levels for each of the constraints in the specified range The array must be of length at least end begin 1 If successful x 0 through x end begin contain the row activities begin An integer specifying the beginning of the range of row activities to be returned end An integer specifying the end of the range of row activities to be returned Returns The routine returns zero if successful and nonzero if an error occurs 395 Global function CPXqpuncrushpi int CPXqpuncrushpi CPXCENVptr env CPXCLPptr lp double pi const double prepi const double x Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXqpuncrushpi uncrushes a dual solution for the presolved problem to a dual solution for the original problem
41. ke voee uide ce gate iens 443 Global function 444 Global function 445 Global function CPXgetnodecallbackfunc eee eee eene enne een enn nennt nennt inna nnnm nnne nnns nnn nnne 446 Global function CPXgetobDjvaL terreni onasan sienos retirer 447 Global function 448 Global function 449 Global function 450 Global function 1 11 1 eeeeeee eene eene nennen nennen nnne natn nina innen nnns 451 Global function 453 Global function CPXgetrngval eterne cerei crei eire nee ken conim 454 Global function 5 455 Global function 456 Global function 457 xiii Table of Contents Global function CPXdelsetsos cessisse esee eene enne nennen ennt nana sinn natns inns strane sn satia sen n nannan nanna 458 Global function GPXordwrile denne sic Cooler esrb 459 Global fun
42. Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object CPXERR NO PROBLEM Exceeding a user specified CPLEX limit or proving the model infeasible or unbounded are not considered errors Note that a zero return value does not necessarily mean that a solution exists Use query routines CPXNETsolninfo CPXNETgetstat and CPXNETsolution to obtain further information about the status of the optimization 361 Global function CPXcopybasednorms int CPXcopybasednorms CPXCENVptr env CPXLPptr lp const int cstat const int rstat const double dnorm Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcopybasednorms works in conjunction with the routine CPXgetbasednorms CPXcopybasednorms copies the values in the arrays cs
43. The routine returns zero if successful and nonzero if an error occurs 362 Global function CPXsetdefaults int CPXsetdefaults CPXENVptr env Definition file cplex h The routine CPXsetdefaults resets all CPLEX parameters and settings to default values with the exception of the log file Note This routine also resets the CPLEX callback functions to NULL The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example status CPXsetdefaults env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Returns The routine returns zero if successful and nonzero if an error occurs 363 Global function CPXNETchgname int CPXNETchgname CPXCENVptr env CPXNETptr net int key int vindex const char name str Definition file cplex h The routine CPXNETchgname changes the name of a node or an arc in the network stored in a network problem object Values of key in CPXNETchgname Indicates the arc name is to be changed Indicates the node name is to be changed Example status CPXNETchgname env net 10 arcl0 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob key A character to indicate whether an arc name should be changed or a node name should be changed vinde
44. cese eee eeee esee eene enne nnne nennen tnnt rnnt nnt nn natns nnnm n str nnn 95 Global function 96 Global function GPXrnewcols 5 eni crece e near Loo casei 97 Global function 99 Global function CPXgelttime 1 nene erede oreet 100 Global function 101 Global function CPXgetnumindconstrs eese esee eee eeeee nennen nennen nnn n nn nn nnn annnm nsn nn nina nter nennt 102 Global function 103 Global function CPXNETSolniHfo 3 eor terere cioe pee 104 Global function CPXgetsolnpooldivfilter eere eene eene eene nennen nnn nnne n nnne nnne nnnm nnnn tenens 105 Global function GPXaddcols d n niri eec 106 Global function 108 Global function CPXdelsetsolnpoolsolns eeeeeeeeee esee ee eene eene nennen nennt nnn n nennt nnn nnne nnne 109 Global function 110 Global function CPXsetheuristiccallbackfunc cesses eese 111 Global function
45. 286 Global function 287 viii Table of Contents Global function 288 Global function 289 Global function 290 Global function CPXgetsolnpoolsolnindex eese eene eene eene eene einen nennt nnnnnnn nnne nnne nnne 291 Global function 5 292 Global function CPXgetprestat nere cuin 293 Global function 295 Global function 296 Global function 298 Global function CPXgetsiftphase 299 Global function 300 Global function CPXgetgrad 301 Global function 5 302 Global function 303 Global function 5 5 305 Global function CPXdelchanmneL 3 2
46. MSG NO CHANNEL CPXERR MSG NO FILEPTR MSG NO FUNCTION CPXERR NAME CREATION CPXERR FOUND CPXERR NAME TOO LONG CPXERR NEED SOLN CPXERR NEGATIVE SURPLUS CPXERR NET DATA CPXERR NET FILE SHORT CPXERR NO BARRIER SOLN 3301 Line 96d Missing SOS type 1225 Numeric entry d is not a double precision number NAN NO BASIC SOLN CPXERR NO BASIS NO BOUND SENSE CPXERR NO BOUND TYPE NO COLUMNS SECTION NO CONFLICT NO DUAL SOLN 1261 No basic solution exists CPXERR NO ENDATA CPXERR NO ENVIRONMENT CPXERR NO FILENAME CPXERR NO ID CPXERR NO ID FIRST CPXERR NO INT X NO LU FACTOR CPXERR NO MEMORY 1232 No dual solution exists 53 CPXERR NO NUMBER 1615 Line 96d Expected number found c 1608 Line 96d Expected or sense found c 1607 Line 96d Expected or found c CPXERR NO ORDER 3016 No priority order exists 3024 No solution pool exists CPXERR NODE ON DISK 3504 No callback info on disk compressed nodes CPXERR NOT MIQPCLASS 1029 Not a or fixed MIQP CPXERR NOT ONE PROBLEM 1023 Not a single problem 54 CPXERR NOT CPXERR NOT SAV FILE CPXERR NOT UNBOUNDED CPXERR NULL NAME CPXERR NULL POINTER 1004 Null pointer for required data CPXERR ORDER BAD DIRECTION CPXERR PARAM INCOMPATIBLE CPXERR PARAM TOO BIG CPXERR PARAM TOO SMAL
47. eeeseee eene eene enne nnne nnn nennen nnn nnn nn nnns nnns stra sinn anten nnns 424 Global Ua ain lero o 425 xii Table of Contents Global function 426 Global function 428 Global function 430 Global function 431 Global function 432 Global function 433 Global function 434 Global function CPXNETch bdS 2 cett aie ce 435 Global function 436 Global function GPXNETgelx 5 tiene 437 Global function 5 438 Global function CPXsolwrite 3 certet Inter 439 Global function 440 Global function CPXgelstaL 5 2 dee eerte cen eerte Ie Ieri 441 Global function 442 Global function CPXembWwrite 3 0 tn
48. epsilon The perturbation constant Returns The routine returns zero if successful and nonzero if an error occurs 505 Global function CPXcopysos int CPXcopysos CPXCENVptr env CPXLPptr lp int numsos int numsosnz const char Sostype const int sosbeg const int sosind const double soswt char sosname Definition file cplex h The routine CPXcopysos copies special ordered set SOS information to a problem object of type CPXPROB MILP MIQP CPXPROB MIQCP When you build or modify your problem with this routine you can verify that the results are as you intended by calling CPXcheckcopysos during application development Table 1 Settings for sostype Example status CPXcopysos env lp numsos numsosnz sostype sosbeg sosind soswt NULL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob numsos The number of SOS sets If numsos is equal to zero CPXcopysos removes all the SOSs from the LP object numsosnz The total number of members in all sets CPXcopysos with numsosnz equal to zero removes all the 5055 from the LP object sostype containing SOS type information for the sets sostype i specifies the SOS type of set i according tot the settings in Table 1 The length of this array must be at least numsos sosbeg array stating
49. sosindex The index of the special ordered set SOS for which information is requested SOSs are indexed from zero to numsets 1 where numsets is the result of calling this routine with a whichinfo value of CALLBACK INFO 505 NUM member The index of the member of the SOS for which information is requested whichinfo An integer specifying which information is requested Table 1 summarizes the possible values Table 2 summarizes possible values returned when the type of information requested is the SOS type that is whichinfo CPX CALLBACK INFO SOS TYPE result generic pointer to a variable of type double int or char The variable represents the value returned by whichinfo The column C Type in the table shows the type of various values returned by whichinfo Returns The routine returns zero if successful and nonzero if an error occurs If the return value is nonzero the requested value may not be available 283 Global function CPXgetobjsen int CPXgetobjsen CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetobjsen accesses whether the objective function sense of a CPLEX problem object is maximization or minimization Example cur objsen CPXgetobjsen env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns A value CPX MIN 1 is returned for minimization
50. 225 Global function CPXwritemipstarts int CPXwritemipstarts CPXCENVptr env CPXCLPptr lp const char filename str int begin int end Definition file cplex h The routine CPXwritemipstarts Writes a range of MIP starts of a CPLEX problem object to a file in MST format The MST format is an XML format and is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the MIP start information should be written begin An integer specifying the beginning of the range of MIP starts to be written end An integer specifying the end of the range of MIP starts to be written Returns The routine returns zero if successful and nonzero if an error occurs 226 Global function CPXgetnumnz int CPXgetnumnz CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumnz accesses the number of nonzero elements in the constraint matrix of a CPLEX problem object not including the objective function quadratic constraints or the bounds constraints on the variables Example cur numnz CPXgetnumnz env 1p Parameters env A pointer to the CPLEX enviro
51. CPLEX was unable to interpret a string as a number on the specified line 653 Macro CPXERR BAD SENSE Definition file cplex h CPXERR BAD OBJ SENSE 1487 Line 96d Unrecognized objective sense s There is an OBJSENSE line in an MPS problem file but CPLEX can not locate the MIN or MAX objective sense statement Check the MPS file for correct syntax See the File Formats Manual for a description of MPS format 654 Macro CPXERR BAD PARAM NAME Definition file cplex h CPXERR BAD PARAM NAME 1028 Bad parameter name to CPLEX parameter routine The parameter name does not exist 655 Macro CPXERR BAD PARAM NUM Definition file cplex h CPXERR BAD PARAM NUM 1013 Bad parameter number to CPLEX parameter routine The CPLEX parameter number does not exist 656 Macro CPXERR BAD PIVOT Definition file cplex h CPXERR BAD PIVOT 1267 Illegal pivot This error occurs if illegal or bad simplex pivots are attempted Examples are attempts to remove nonbasic variables from the basis or selection of a zero column to enter the basis Also this error code may be generated if a pivot would yield a numerically unstable or singular basis 657 Macro CPXERR BAD PRIORITY Definition file cplex h CPXERR BAD PRIORITY 3006 Negative priority entry d Priority orders must be positive integer values 658 Macro CPXERR BAD PROB TYPE Definition file cplex h CPXERR BAD PROB TYPE 1022 Unknown problem type Problem not chang
52. CPXNETdelset env net whichnodes whicharcs Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob whichnodes Array of size at least CPXNETgetnumnodes that indicates the nodes to be deleted If whichnodes i 1 the node is deleted For every node deleted all arcs incident to it are deleted as well After termination whichnode j indicates either the position to which node with index 3 before deletion has been moved or 1 if the node has been deleted If NULL is passed no nodes are deleted whicharcs Array indicating the arc to be deleted Every arc i the network with whicharcs i 1is deleted After termination whicharc j indicates either the position to which arc with index j before deletion has been moved or 1 if the arc has been deleted This array also contains the deletions due to removed nodes If NULL is passed the only arcs deleted are those that are incident to nodes that have been deleted Returns The routine returns zero on success and nonzero if an error occurs 468 Global function CPXchgobjsen void CPXchgobjsen CPXCENVptr env CPXLPptr lp int maxormin Definition file cplex h The routine CPXchgobjsen changes the sense of the optimization for a problem to maximization or minimization Note For problems with a quadratic objective function changing the objective sense may
53. CPXchgrowname env lp cnt indices values See Also CPXdelnames Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer that specifies the total number of linear constraint names to be changed and thus specifies the length of the arrays indices and newname indices An array of length cnt containing the numeric indices of the linear constraints for which the names are to be changed newname An array of length cnt containing the strings of the new names for the linear constraints specified in indices Returns The routine returns zero if successful and nonzero if an error occurs 175 Global function CPXgetsolnpoolfiltertype int CPXgetsolnpoolfiltertype CPXCENVptr env CPXCLPptr lp int ftype p int which Definition file cplex h Accesses the type of a filter of the solution pool This routine accesses the type of the filter specified by the argument which of the solution pool associated with the LP problem specified by the argument 1p Example Status CPXgetsolnpoolfiltertype env lp amp ftype i The argument type p specifies the type of filter either a diversity filter or a range filter Table 1 summarizes the possible values of this argument Table 1 Possible types of filters Symbolic name Integer value Meaning CPX SOLNPOOL FILTER DIVERSITY E quem CPX SOLNPOOL FILTER RANG
54. CPXgetcallbacknodeinfo CPXgetcallbacknodeintfeas 21 CPXbinvarow CPXbinvcol CPXcopybasednorms CPXgetcallbacknodelb CPXgetcallbacknodelp CPXgetcallbacknodeobjval CPXgetcallbacknodestat CPXgetcallbacknodeub CPXgetcallbacknodex CPXgetcallbackorder CPXgetcallbackpseudocosts CPXgetcallbackseqinfo CPXgetcallbacksosinfo CPXgetcutcallbackfunc CPXgetdeletenodecallbackfunc CPXgetdnorms CPXgetheuristiccallbackfunc CPXgetijdiv CPXgetijrow CPXgetincumbentcallbackfunc CPXgetnodecallbackfunc CPXgetobjoffset CPXgetpnorms CPXgetprestat CPXgetprotected CPXgetray CPXgetredlp CPXgetsolvecallbackfunc CPXkilldnorms CPXkillpnorms CPXmdleave CPXpivot CPXpivotin CPXpivotout CPXpreaddrows CPXprechgobj CPXpresolve CPXqconstrslackfromx CPXgqpdjfrompi CPXsetbranchcallbackfunc CPXsetbranchnosolncallbackfunc CPXsetcutcallbackfunc CPXsetdeletenodecallbackfunc 22 CPXsetheuristiccallbackfunc CPXsetincumbentcallbackfunc CPXsetnodecallbackfunc CPXsetsolvecallbackfunc CPXslackfromx CPXstrongbranch CPXtightenbds CPXuncrushform CPXuncrushpi CPXuncrushx CPXunscaleprob Warning These advanced routines typically demand a profound understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you
55. Definition file cplex h CPXERR NO INT X 3023 Integer feasible solution values are unavailable When the incumbent for the problem has been provided by a MIP Start or by an advanced callback function working on the original problem the incumbent solution values are not available for the reduced problem 736 Macro NO LU FACTOR Definition file cplex h CPXERR NO LU FACTOR 1258 No LU factorization exists The requested item requires the presence of factoring You may need to optimize with 0 zero iteration limit to factor 737 Definition file cplex h CPXERR NO MEMORY 1001 Out of memory The computer has insufficient memory available to complete the selected operation Downsize problem or increase the amount of physical memory available Depending on the command several memory conserving corrections can be made 738 Macro CPXERR MIPSTART Definition file cplex h CPXERR NO MIPSTART 3020 No MIP start exists CPXgetmipstart failed because no MIP start data is available for the problem 739 Macro CPXERR NO NAME SECTION Definition file cplex h CPXERR NO NAME SECTION 1441 Line 96d No NAME section The NAME section required in an MPS file is missing 740 Macro CPXERR NO NAMES Definition file cplex h CPXERR NO NAMES 1219 No names exist The requested operation is successful only if names have been assigned Typically this failure occurs
56. Example numsos CPXgetnumsos env lp Returns If the problem object or environment does not exist or the problem is not a mixed integer problem the routine returns the value 0 otherwise it returns the number of special ordered sets SOS in the problem object 115 Global function CPXgetcallbackctype int CPXgetcallbackctype CPXCENVptr env void cbdata int wherefrom char xctype int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackctype retrieves the ctypes for the MIP problem from within a user written callback during MIP optimization The values from the original problem if CPX PARAM MIPCBREDIP is set to CPX OFF Otherwise they are from the presolved problem This routine may be called only when the value of the wherefrom argument is one of the following CALLBACK CPX CALLBACK MIP BRANCH CALLBACK INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT
57. Global function CPXsetdblparam int CPXsetdblparam CPXENVptr env int whichparam double newvalue Definition file cplex h The routine CPXsetdblparam sets the value of a CPLEX parameter of type double The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example Status CPXsetdblparam env CPX PARAM TILIM 1000 0 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter to change newvalue The new value of the parameter Returns The routine returns zero if successful and nonzero if an error occurs 69 Global function CPXgetsosindex int CPXgetsosindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXgetsosindex searches for the index number of the specified special ordered set in a CPLEX problem object Example Status CPXgetsosindex env lp set5 amp setindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str A special ordered set name to search for index p A pointer to an integer to hold the index number of the special ordered set with name lname str If the routine is successful index p contains the index number otherwise index pis undefined Returns
58. Macro CPX SUM SCALED DUAL INFEAS Definition file cplex h CPX SUM SCALED DUAL INFEAS Concert Technology enum SumScaledDuallnfeas Numeric meaning double To access the sum of dual infeasibilities or equivalently the sum of reduced cost bound violations for the scaled problem Integer meaning not applicable 619 Macro CPX SUM SCALED DUAL RESIDUAL Definition file cplex h CPX SUM SCALED DUAL RESIDUAL Concert Technology enum SumScaledDualResidual Numeric meaning double To access the sum of the absolute values of the dual residual vector for the scaled problem Integer meaning not applicable 620 Macro CPX SUM SCALED Definition file cplex h CPX SUM SCALED PI Concert Technology enum SumScaledPi Numeric meaning doub1e To access the sum of the absolute values in the dual solution vector for the scaled problem Integer meaning not applicable 621 Macro CPX SUM SCALED PRIMAL INFEAS Definition file cplex h CPX SUM SCALED PRIMAL INFEAS Concert Technology enum SumScaledPrimallnfeas Numeric meaning doub1e To access the sum of primal infeasibilities or equivalently the sum of bound violations for the scaled problem Integer meaning not applicable Can use a supplied primal solution 622 Macro CPX SUM SCALED PRIMAL RESIDUAL Definition file cplex h CPX SUM SCALED PRIMAL RESIDUAL Concert Technology enum SumScaledPrimalResidual Numeric meaning double To a
59. The real point of computing y is the following Suppose we define a vector z of dimension equal to the dimension of x and having the following value for entries zj uj where gt 0 and zj where lt 0 where Aj denotes the column of A corresponding to xj uj the given upper bound on xj and lj is the specified lower bound zj is arbitrary if 0 Then y and z will satisfy yTb yTAz Q This last inequality contradicts the validity of yTA x gt yTb and hence shows that the given linear program is infeasible The quantity proof_p is set equal to yTb z Thus proof p in some sense denotes the degree of infeasibility Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob y An array of doubles of length at least equal to the number of rows in the problem proof p A pointer to a double The argument proof p is allowed to have the value NULL Returns The routine returns zero if successful and nonzero if an error occurs 89 Global function CPXgetcolinfeas int CPXgetcolinfeas CPXCENVptr env CPXCLPptr lp const double x double infeasout int begin int end Definition file cplex h The routine CPXgetcolinfeas computes the infeasibility of a given solution for a range of variables The beginning and end of the range must be specified This routine checks whether each variab
60. The routine returns zero on success and nonzero if an error occurs 403 Global function CPXgetconflict int CPXgetconflict CPXCENVptr env CPXCLPptr lp int confstat p int rowind int rowbdstat int confnumrows p int colind int colbdstat int confnumcols_p Definition file cplex h This routine returns the linear constraints and variables belonging to a conflict previously computed by the routine CPXrefineconflict The conflict is a subset of constraints and variables from the original infeasible problem that is still infeasible It is generally minimal in the sense that removal of any of the constraints or variable bounds in the conflict will make the conflict set become feasible However the computed conflict will not be minimal if the previous call to CPXre ineconflict was not allowed to run to completion Conflict Status The status of the currently available conflict is returned in confstat_p If CPXrefineconflict was called previously the status will be one of the following values STAT CONFLICT MINIMAL STAT CONFLICT FEASIBLE or STAT CONFLICT ABORT reason When the status of a conflict is CPX STAT CONFLICT FEASIBLE the routine CPXrefineconflict determined that the problem was feasible and thus no conflict is available Otherwise a conflict is returned The returned conflict is minimal if the status is CPX STAT CONFLICT MINIMAL
61. lt cols then the i th variable in the formula is the variable with index ind i in the original problem If ind i gt cols then the i th variable in the formula is the slack for the ind i cols th ranged row The arrays ind and 1 must be of length at least the number of columns plus the number of ranged rows in the original LP problem object Example status CPXuncrushform env lp pval amp len amp offset ind val Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob plen The number of entries in the arrays and pind An array containing the column indices of coefficients the array pval pval The linear formula in terms of the presolved problem Each entry pind i specifies the column index of the corresponding coefficient pval i len p A pointer to an integer to receive the number of nonzero coefficients that is the true length of the arrays ind and val offset p A pointer to a double to contain the value of the linear formula corresponding to variables that have been removed in the presolved problem ind An array containing indices of coefficients in the array va1 val The linear formula in terms of the original problem Returns The routine returns zero if successful and nonzero if an error occurs 376 Global function CPXinfointparam int CPXinfointp
62. net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob filename str Name of the network file to write where the file extension specifies the file format unless overridden by the format argument If the file name ends with gz a compressed file is written in accordance with the selected file type format str File format to generate Possible values appear in the table If NULL is passed the format is inferred from the file name Returns The routine returns zero on success and nonzero if an error occurs 223 Global function CPXgetcutcallbackfunc void CPXgetcutcallbackfunc CPXCENVptr env int CPXPUBLIC cutcallback p CALLBACK CUT ARGS void cbhandle p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcutcallbackfunc accesses the user written callback for adding cuts The user written callback is called by CPLEX during MIP branch and cut for every node that has an LP optimal solution with objective value below the cutoff and that is integer infeasible CPLEX also calls the callback when comparing an integer fea
63. problem object The length of the arrays in which the nonzero linear and quadratic coefficients of the constraint are to be returned must be specified Note If the value of Linspace is 0 zero then the negative of the value of 1insurplus p returned indicates the length needed for the arrays 1 and linval Note If the value of quadspace is 0 zero then the negative of the value of quadsurplus p returned indicates the length needed for the arrays quadrow quadcol and quadval Example status CPXgetqconstr env lp amp linnzcnt amp quadnzcnt amp rhs amp sense linind linval linspace amp linsurplus quadrow quadcol quadval quadspace amp quadsurplus 0 Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob linnzcnt_p A pointer to an integer to contain the number of linear coefficients returned that is the true length of the arrays 1 and linval quadnzcnt_p pointer an integer to contain the number of quadratic coefficients returned that is the true length of the arrays quadrow quadcol and quadval rhs p A pointer to a double containing the righthand side value of the quadratic constraint sense p A pointer to a character indicating the sense of the constraint Possible values are L for a lt constraint or G for a constraint linind An array to contain the v
64. surplus_p specifies the amount of insufficient space in the arrays The error CPXERR NO MIPSTART reports that no start information is available Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in the arrays indices and values to hold the incumbent MIP start information 123 Global function CPXNETcopybase int CPXNETcopybase CPXCENVptr env CPXNETptr net const int astat const int nstat Definition file cplex h The routine CPXNETcopybase can be used to set the network basis for a network problem object It is not necessary to load a basis prior to optimizing a problem but a very good starting basis may increase the speed of optimization significantly A copied basis does not need to be feasible to be used by the network optimizer Any solution information stored in the problem object is lost Example Status CPXNETcopybase env net arc stat node stat Table 1 Status of arcs in astat CPX BASIC if the arc is to be basic if the arc is to be nonbasic and its flow is on the lower bound if the arc is to be nonbasic and its flow is on the upper bound if the arc is to be nonbasic but is free In this case its flow is set to 0 Table 2 Status of artificial arcs in nstat if the arc is to be basic CPX AT LOWER ifthe arc is t
65. 280 Global function CPXNETgetobjsen int CPXNETgetobjsen CPXCENVptr env CPXCNETptr net Definition file cplex h The routine CPXNETgetobjsen returns the sense of the objective function i e maximization or minimization of a network problem object Example objsen CPXNETgetobjsen env net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns The value MAX 1 is returned for a maximization problem the value CPX MIN 1 is returned for a minimization problem In case of an error the value zero is returned 281 Global function CPXgetcallbacksosinfo int CPXgetcallbacksosinfo CPXCENVptr env void cbdata int wherefrom int Sosindex int member int whichinfo void result p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacksosinfo accesses information about special ordered sets SOSs during MIP optimization from within user written callbacks This routine may be called only when t
66. 306 Global function 24 9 41 307 Global function CPXpgellb 5 308 Global function 5 309 Global 310 Global function 311 Global function 5 nsns stia nsnm annee nnne nnn 312 Global function 313 Global function CPXgetbaritent 21 314 Global function 315 Global function 316 Global function 317 Global function CPXdelfpdest 1 318 Global function 319 Table of Contents Global function 320 Global function 321 Global function CPXNETdelnodes eres esee eee eeee eene enne nnn nennt tnn nina nn nn natns nnnm ist nn seins
67. Callback return value The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed from the optimization routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass it to the callback information routines wherefrom An integer value reporting where in the optimization this function was called It will have the value CPX CALLBACK MIP BRANCH cbhandle A pointer to user private data int type An integer that specifies the type of branch This table summarizes possible values Branch Types CPX TYPE VAR Pron variable branch CPX_TYPE_SOS1 SOS1 branch CPX_TYPE_SOS2 SOS2 branch CPX_TYPE_ANY multiple bound changes and or constraints will be used for branching SOS An integer that specifies the special ordered set SOS used for this branch A value of 1 specifies that this branch is not an SOS type branch 421 nodecnt An integer that specifies the number of nodes CPLEX will create from this branch Possible values are 0 zero or 1 0r 2 If the argument is 0 the node will be fatnomed unless user specified branches are made that is no child nodes are created and the node itself is discarded bdent An integer that specifies the number of bound changes defined in the arrays indices lu and bd
68. Concert Technology enum not applicable Numeric meaning double To access the maximum infeasibility of the quadratic constraints equivalently the maximum bound violation of the quadratic constraint slacks Integer meaning To acces the lowest index of the quadratic constraints where the maximum quadratic slack infeasibility occurs Can use a supplied primal solution Concert Technology does not distinguish quadratic constraints from linear constraints in this respect 559 Macro CPX RED COST Definition file cplex h CPX MAX RED COST Concert Technology enum MaxRedCost Numeric meaning double To access the maximum absolute reduced cost value for the unscaled problem Integer meaning To access the lowest index where the maximum reduced cost value occurs for the unscaled problem 560 Macro CPX SCALED DUAL INFEAS Definition file cplex h CPX MAX SCALED DUAL INFEAS Concert Technology enum MaxScaledDuallnfeas Numeric meaning double To access the maximum of dual infeasibility or equivalently the maximum reduced cost infeasibility for the scaled problem Integer meaning To access the lowest index where the maximum dual infeasibility occurs for the scaled problem 561 Macro CPX SCALED DUAL RESIDUAL Definition file cplex h CPX MAX SCALED DUAL RESIDUAL Concert Technology enum MaxScaledDualResidual Numeric meaning double To access maximum dual residual value for the s
69. May be NULL y An array to contain the coefficients of the 3th column relative to the current basis See the discussion above on how to interpret the entries in y This array should be of length at least CPXgetnumrows env lp be NULL Returns The routine returns zero if successful and nonzero if an error occurs This routine fails if no basis exists 301 Global function CPXdelsetcols int CPXdelsetcols CPXCENVptr env CPXLPptr lp int delstat Definition file cplex h The routine CPXdelsetcols deletes a set of columns from a CPLEX problem object Unlike the routine CPXdelcols CPXdelsetcols does not require the columns to be a contiguous range After the deletion occurs the remaining columns are indexed consecutively starting at 0 and in the same order as before the deletion Note The delstat array must have at least CPXgetnumcols env 1p elements Example Status CPXdelsetcols env lp delstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob delstat An array specifying the columns to be deleted The routine CPXdelsetcols deletes each column 5 for which delstat j 1 deletion of columns results in a renumbering of the remaining columns After termination delstat j is either 1 for columns that have been deleted or the new index number that has been assigned to the remaining c
70. PARAM MIPCBREDLP was set to OFF before the call to CPXmipopt that calls the callback Otherwise the cut is for the presolved problem Within the user written cut callback the routine CPXgetcallbacknodelp and other query routines from the Callable Library access information about the subproblem The routines CPXgetcallbacknodeintfeas and CPXgetcallbacksosinfo examine the status of integer entities The routine CPXcut callbackadd adds cuts and lazy constraints to the current node LP subproblem during MIP branch and cut Cuts added to the problem are first put into a cut pool so they are not present in the subproblem LP until after the user written cut callback is finished Any cuts that are duplicates of cuts already in the subproblem are not added to the subproblem Cuts that are added remain part of all subsequent subproblems there is no cut deletion However CPLEX will purge global cuts that would not ordinarily be removed by backtracking if those global cuts have been designated purgeable by the routine CPXaddusercuts and if CPLEX deems it useful to do so See the routine CPXaddusercuts for more detail about this distinction between local and global cuts with respect to purging If cuts have been added the subproblem is re solved and evaluated and if the LP solution is still integer infeasible and not cut off the cut callback is called again If the problem has names user added cuts have names of the form unumber where number i
71. The objective row erroneously includes a sense specifier 823 Macro CPXERR REPEATS Definition file cplex h CPXERR RIM REPEATS 1447 Line 96d 96s s repeats The MPS file contains duplicate names 824 Macro CPXERR ROW 5 Definition file cplex h CPXERR RIM ROW REPEATS 1444 96s s has repeated row s The MPS file contains duplicate row names 825 Macro CPXERR RIMNZ REPEATS Definition file cplex h CPXERR RIMNZ REPEATS 1479 Line 96d 96s 96s repeats The MPS file contains duplicate entries in an extra rim vector 826 Macro CPXERR ROW INDEX RANGE Definition file cplex h CPXERR ROW INDEX RANGE 1203 Row index 96d out of range The specified row index is negative or greater than or equal to the number of rows in the currently loaded problem 827 Macro CPXERR ROW REPEAT PRINT Definition file cplex h CPXERR ROW REPEAT PRINT 1477 d Row repeats messages not printed The MPS problem or REV file contains duplicate row entries Inspect and edit the file 828 Macro CPXERR ROW REPEATS Definition file cplex h CPXERR ROW REPEATS 1445 Row s repeats The MPS file contains duplicate row entries Inspect and edit the file 829 Macro CPXERR ROW UNKNOWN Definition file cplex h CPXERR ROW UNKNOWN 1448 Line 96d s is not a row name The MPS file specifies a row name that does not exist 830 Macro CPXERR SAV FILE DATA Definition file cplex h CPXERR SAV F
72. beg ind val NULL Values of sense sense lt constraint constraint Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob rcnt An integer that specifies the number of new lazy constraints to be added nzcnt An integer that specifies the number of nonzero constraint coefficients to be added to the constraint matrix This specifies the length of the arrays rmatind and rmatval rhs An array of length rcnt containing the righthand side RHS term for each lazy constraint to be added to the CPLEX problem object sense An array of length rent containing the sense of each lazy constraint to be added to the CPLEX problem object Possible values of this argument appear in the table 451 rmatbeg An array used with rmatind and rmatval to define the lazy constraints to be added rmatind array used with rmatbeg and rmatval to define the lazy constraints to be added rmatval array used with rmatbeg and rmatind to define the lazy constraints to be added The format is similar to the format used to describe the constraint matrix in the routine CPXcopylp see description Of matbeg matcnt matind and matval that routine but the nonzero coefficients are grouped by row instead of column in the array rmatval The nonzero elements of every lazy constraint must be stored in sequential locations in this array from posi
73. env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example psbcnt CPXgetpsbcnt env lp Returns If a solution exists CPXgetpsbcnt returns the number of primal super basic variables If no solution exists CPXgetpsbont returns the value 0 zero 448 Global function CPXgetintparam int CPXgetintparam CPXCENVptr env int whichparam int value p Definition file cplex h The routine CPXgetintparam obtains the current value of a CPLEX parameter of type int The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example status CPXgetintparam env CPX PARAM PREIND amp curpreind Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter for which the value is to be obtained value p A pointer to an integer variable to hold the current value of the CPLEX parameter Returns The routine returns zero if successful and nonzero if an error occurs 449 Global function CPXputenv int CPXputenv const char envsetting str Definition file cplex h The routine CPXputenv sets an environment variable to be used by CPLEX Use it instead of the standard C Library putenv function to make sure your application ports properly to Windows Be sure to all
74. lu and bd indices An array Together with 1u and this array defines the bound changes for the branch The entry indices i is the index for the variable lu An array Together with indices and this array defines the bound changes for each of the created nodes The entry 11111 is one of the three possible values specifying which bound to change 1 for lower bound u for upper bound or for both bounds bd An array Together with indices and 111 this array defines the bound changes for each of the created nodes The entry i specifies the new value of the bound userhandle A pointer to user private data that should be associated with the node created by this branch May be NULL seqnum p A pointer to an integer On return that integer will contain the sequence number that CPLEX has assigned to the node created from this branch The sequence number may be used to select this node in later calls to the node callback Returns The routine returns zero if successful and nonzero if an error occurs 400 Global function CPXgetdblparam int CPXgetdblparam CPXCENVptr env int whichparam double value p Definition file cplex h The routine CPXgetdblparam obtains the current value of CPLEX parameter of type double The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example Status CPXgetdblparam env CPX PARAM TILIM amp curtilim Paramet
75. net astat nstat Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX net pointer to a CPLEX network problem object as returned by CPXNETcreateprob astat array in which the statuses for network arcs are to be written After termination ast at i contains the status assigned to arc i of the network stored in net The status may be one of the values in Table 1 If NULL is passed no arc statuses are copied Otherwise ast at must be an array of a size that is at least CPXNETgetnumarcs nstat An array in which the statuses for artificial arcs from each node to the root node are to be written After termination nstat i contains the status assigned to the artificial arc from node i to the root node of the network stored in net The status may be one of values in Table 2 If NULL is passed no node statuses are copied Otherwise nst at must be an array of a size that is at least CPXNETgetnumnodes Returns The routine returns zero on success and nonzero if an error occurs 205 Global function CPXdelqconstrs int CPXdelqconstrs CPXCENVptr env CPXLPptr lp int begin int end Definition file cplex h The routine CPXdelqconstrs deletes a range of quadratic constraints The range is specified by a lower and upper index that represent the first and last quadratic constraints to be deleted respectively The indices of the constraints following those deleted are decreased by the number o
76. running For Tuning CPX CALLBACK INFO TUNING PROGRESS elapsed percentage of total tuning time Example See 1pex4 c in the CPLEX User s Manual Suppose you want to know the objective value on each iteration for a graphical user display In addition if primal simplex is not feasible after 1000 iterations you want to stop the optimization The function mycallbackisa callback function to do this int mycallback CPXCENVptr env void cbdata int wherefrom void cbhandle int itcount double objval int ispfeas int status 0 if wherefrom CALLBACK PRIMAL Status CPXgetcallbackinfo env cbdata wherefrom CPX CALLBACK INFO PRIMAL FEAS amp ispfeas if status fprintf stderr error d in CPXgetcallbackinfon status status 1 goto TERMINATE if ispfeas Status CPXgetcallbackinfo env cbdata wherefrom CPX CALLBACK INFO PRIMAL OBJ amp objval if status fprintf stderr error d in CPXgetcallbackinfon 388 status status 1 goto TERMINATE else status CPXgetcallbackinfo env cbdata wherefrom CPX CALLBACK INFO ITCOUNT amp itcount if status 1 fprintf stderr error d in CPXgetcallbackinfon status status 1 goto TERMINATE if itcount 1000 status 1 TERMINATE return status Returns The routine returns zero if successful and nonzero if an er
77. start or a subset of its constraints Like the routine CPXrefineconflictext this routine considers constraints in groups If any constraint in a group participates in the conflict the entire group is determined to do so No further detail about the constraints within that group is returned A group may consist of a single constraint A group may be assigned a preference that is a value specifying how much the user wants the group to be part of a conflict A group with a higher preference is more likely to be included in the conflict However no guarantee is made when a minimal conflict is returned that other conflicts containing groups with a greater preference do not exist To retrieve information about the conflict computed by CPXrefinemipstartconflictext call the routine CPXgetconflictext To write the conflict to a file use the routine CPXclpwrite This conflict is a submodel of the original model with the property that CPLEX cannot generate a solution from the chosen MIP start using the given level of effort and that removal of any constraint or bound in the conflict invalidates that property The parameters PARAM CUTUP CPX PARAM CUTLO CPX PARAM OBJULIM CPX PARAM OBJLLIM do not influence this routine If you want to study infeasibilities introduced by those parameters consider adding an objective function constraint to your model to enforce their effect before you invoke this routine When the MIP start was added to the
78. ttt ttt ttt ttt 770 Macro CPXERR_NOT_FIXED csssssssssssssssssssssssssssssssssssesssssssssssesssssseesssseesssssesssssesssssesssasessssneesssaessssseesssaeenssans 771 Macro CPXERR NOT FOR 2 244444 4 772 Macro CPXERR NOT FOR _QCP u sssssssssssssssssssssssssssssssssssssssssssssssssseesssssesssssssssseessssiessssseessssesssssneesssseesssseeessass 773 Macro CPXERR NOT FOR ttt ttt ttt 774 Macro CPXERR NOT MILPCLASS ertet 775 Macro CPXERR NOT MIN COST FLOW ttt ttt ttt 776 Macro CPXERR 777 Macro CPXERR NOT 6 778 Macro CPXERR NOT ONE 779 Macro CPXERH NOT RU 780 Macro CPXERR NOT SAV FILE ennt 781 Macro CPXERR NOT ttt ntt ttt 782 Macro CPXERR NULL ttt ttt ttt ttt ttt 783 Macro CPXERR NULL POINTER ennttttttttnttttnntttttnttttn ttt ttt 784 Macro CPXERR ORDER BAD
79. 2 For ranged rows the array element rstat i be set according to Table 3 If this array is NULL cstat must be NULL cprim An array containing the initial primal values of the column variables The length of the array must be no less than the number of columns in the CPLEX problem object If this array is NULL rprim must be NULL rprim An array containing the initial primal values of the slack row variables The length of the array must be no less than the number of rows in the CPLEX problem object This array may be NULL cdual An array containing the initial values of the reduced costs for the column variables The length of the array rdual must be no less than the number of columns in the CPLEX problem object This array may be NULL An array containing the initial values of the dual variables for the rows The length of the array must be no less than the number of rows in the CPLEX problem object If this array is NULL caual must be NULL Returns The routine returns zero if successful and nonzero if an error occurs 370 Global function CPXgetredlp int CPXgetredlp CPXCENVptr env CPXCLPptr lp CPXCLPptr redlp p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team enc
80. A pointer to a CPLEX problem object as returned by CPXcreateprob An integer that indicates the first variable number row number 0 j An integer that indicates the second variable number column number newvalue The new coefficient value Returns The routine returns zero on success and nonzero if an error occurs 320 Global function CPXreadcopysol int CPXreadcopysol CPXCENVptr env CPXLPptr lp const char filename str Definition file cplex h The routine CPXreadcopysol reads a solution from a SOL format file and copies that basis or solution into CPLEX problem object The solution is used to initiate a crossover from a barrier solution to restart the simplex method with an advanced basis or to specify variable values for a MIP start The file may contain basis status values primal values dual values or a combination of those values The parameter CPX PARAM ADVIND must be set to 1 its default value or 2 two in order for the start to be used for starting a subsequent optimization The SOL format is an XML format and is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly Example status CPXreadcopysol env lp myprob sol Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as ret
81. An array that with matbeg matcnt and matind defines the constraint matrix CPLEX needs to know only the nonzero coefficients These are grouped by column in the array matval The nonzero elements of every column must be stored in sequential locations in this array with matbeg j containing the index of the beginning of column 3 and matcnt 5 containing the number of entries in column 3 The components of matbeg must be in ascending order For each matind k specifies the row number of the corresponding coefficient matval An array of length at least numcols containing the lower bound on each of the variables Any lower bound that is set to value less than or equal to that of the constant INFBOUND is treated as negative infinity CPX INFBOUND is defined in the header cplex h An array of length at least numcols containing the upper bound on each of the variables Any upper bound that is set to a value greater than or equal to that of the constant CPX_INFBOUND is treated as infinity INFBOUND is defined in the header file cp1ex n An array of length at least numrows containing the range value of each ranged constraint Ranged rows are those designated by R in the sense array If the row is not ranged the rngval array entry is ignored If rngval i O then row i activity isin zhs i rhs i rngval i and if rngval i lt 0 then row i activity is zhs i rngval i rhs i This argument may be NULL The
82. An integer specifying the beginning of the range of linear constraints whose infeasibility is to be returned end An integer specifying the end of the range of linear constraints whose infeasibility is to be returned Returns The routine returns zero if successful and nonzero if an error occurs 202 Global function CPXfopen CPXFILEptr CPXfopen const char filename str const char type str Definition file cplex h The routine CPX open opens files to be used in conjunction with the routines CPXaddfpdest CPXdelfpdest and CPXset logfile It has the same arguments as the standard C library function fopen Example fp CPXfopen mylog log w See also 1pex5 c in the CPLEX User s Manual Parameters filename str A pointer to a character string that contains the name of the file to be opened type str A pointer to a character string containing characters according to the syntax of the standard C function fopen Returns The routine returns a pointer to an object representing an open file or NULL if the file could not be opened A CPXFILEptr is analogous to FILE type in C language 203 Global function CPXfreeusercuts int CPXfreeusercuts CPXCENVptr env CPXLPptr lp Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that
83. BAD STATUS ettet ttt tette ttt 666 Macro CPXERR_BADPRODUCT ssssssssssssssssssssssssssssssssssssssssssssssssessssssesssssessssseessssiessssueesssueeessseessssseesseneesssase 667 Macro CPXERR BAS FILE SHORT 668 Macro CPXEHR BAS FIDE SIZE bbs ecce cause ote c DLL 669 Macro CPXERR CALLBACK mese saludo Rd ee a eee eel E EE 670 Macro CPXERR CANT CLOSE ttt 671 Macro CPXERR CHILD OF 672 XX Table of Contents Macro CPXERR_COL_INDEX_RANGE ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssesssssessssseesssseessssuessssueesssseessease 673 Macro CPXERR COL REPEAT PhRINT entente 674 Macro COL E ee ces ee 675 Macro CPXERR COL ROW REPEATS entrent ttt ttes 676 Macro CPXERR COL ttt ttt ttt 677 Macro CPXERR CONFLICT UNSTABLE eene 678 Macro CPXERR COUNT OVERLBAP cnet ttt ttt 679 Macro CPXERR_COUNT_RANGE sscsssssssssssssssssssssssssssssssssssssssssssssesssssssssssssesssssessssiessssseesssueessssueesssseesssneeessase 680 Macro CPXERR DBE MAX ties ed 681 Macro 5 lt
84. BAD STATUS 1253 Invalid status entry d for basis specification The basis status values are out of range 666 Macro CPXERR BADPRODUCT Definition file cplex h CPXERR BADPRODUCT 32023 Licensing problem License not valid for this product The license is not configured to support the particular part of the product you are trying to use For example this error occurs when when anyone tries to run the Interactive Optimizer with a license configured only for runtime application deployment for example ILM key type RTNODE In such a case either locate a different ILM key that has been provided to you or try compiling and running one of the simple examples found in the distribution such as 1 and its language variants instead of using the Interactive Optimizer Contact your support representative for assistance if you are unable to determine the correct ILM key for your purposes 667 Macro BAS FILE SHORT Definition file cplex h CPXERR BAS FILE SHORT 1550 Basis missing some basic variables Number of basic variables is less than the number of rows 668 Macro CPXERR BAS FILE SIZE Definition file cplex h CPXERR BAS FILE SIZE 1555 96d 96s basic variable s Number of basic variables doesn t match the problem Check the CPXcopybase call 669 Macro CALLBACK Definition file cplex h CPXERR CALLBACK 1006 Error during callback An error condition occurred during the callback as for e
85. CONFLICT MINIMAL 31 conflict refiner enum ConflictMinimal CPX STAT FEASIBLE RELAXED INF 16 Simplex or Barrier enum FeasibleRelaxedInf CPX STAT FEASIBLE RELAXED QUAD 18 6 8 Simplex or Barrier enum FeasibleRelaxedQuad CPX STAT FEASIBLE RELAXED SUM 14 Simplex or Barrier enum FeasibleRelaxedSum CPX STAT INFEASIBLE 3 Simplex or Barrier enum Infeasible 4 Simplex or Barrier enum InfOrUnbd 6 Simplex or Barrier enum NumBest SE E 1 Simplex or Barrier enum Optimal CPX STAT OPTIMAL FACE UNBOUNDED 20 Barrier only enum OptimalFaceUnbounded CPX STAT OPTIMAL INFEAS 5 Simplex or Barrier enum Optimallnfeas CPX STAT OPTIMAL RELAXED CPX STAT OPTIMAL RELAXED QUAD CPX STAT OPTIMAL RELAXED SUM s ABORT FEAS ABORT INFEAS 114 only enum AbortInfeas rs CPXMIP FAIL FEAS NO TREE FAIL INFEAS 110 MIP only enum Faillnfeas CPXMIP FAIL INFEAS NO TREE 117 MIP only enum FaillnfeasNoTree 60 FEASIBLE FEASIBLE RELAXED INF FEASIBLE RELAXED QUAD FEASIBLE RELAXED SUM INFEASIBLE CPXMIP INForUNBD CPXMIP MEM LIM FEAS CPXMIP MEM LIM INFEAS CPXMIP NODE LIM FEAS CPXMIP NODE LIM INFEAS CPXMIP OPTIMAL OPTIMAL INFEAS 103 MIP only enum Infeasible OPTIMAL POPULATED OPTIMAL POPULATED TOL OPTIMAL RELAXED INF
86. CPXNETreadcopyprob Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX status_p A pointer to an integer used to return any error code produced by this routine name_str Name of the network to be created Returns If the operation is successful CPXNETcreateprob returns the newly constructed network problem object if not it returns either NULL or a nonzero value to indicate an error In case of an error the value pointed to by status p contains an integer indicating the cause of the error 348 Global function CPXgetcallbacknodex int CPXgetcallbacknodex CPXCENVptr env void cbdata int wherefrom double x int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacknodex retrieves the primal variable x values for the subproblem at the current node during MIP optimization from within a user written callback The values are from the original problem if the parameter MIPCBREDLP is set to CPX OFF otherwise they are from the presolved problem This routine may be call
87. CPXopenCPLEX heuristiccallback A pointer to a user written heuristic callback If this callback is set to NULL no callback is called during optimization cbhandle A pointer to the user s private data This pointer is passed to the callback Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle double objval p double ty int checkfeas p int useraction p The call to the heuristic callback occurs after an optimal solution to the subproblem has been obtained The user can provide that solution to start a heuristic for finding an integer solution The integer solution provided to CPLEX replaces the incumbent if it has a better objective value The basis that is saved as part of the incumbent is the optimal basis from the subproblem it may not be a good basis for starting optimization of the fixed problem 111 The integer solution returned to CPLEX is for the original problem if the parameter PARAM MIPCBREDLP was set to OFF before the call to CPXmipopt that calls the callback Otherwise it is for the presolved problem Callback return value The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed from the optimization routine to the user written callback to identify the problem being optimized The only purpose of the
88. Global function 379 Global function 380 Global function 381 Global function 383 Global function CPXbira Mai uideri raai peisan enoi Snia 384 Global function 385 Table of Contents Global function CPXgetcallbacknodeintfeas eese 390 Global function 392 Global function CPXgetsolnpoolrnglfilter eese serene nennen nennen nennen nennen nnne nnnm antreten 393 Global function CPXNETQgeltub 2 3 394 Global function CPX OG 10 dL 395 Global function 396 Global function 397 Global function 399 Global function CPXbranchcallbackbranchbds eerie esee 400 Global function CPXgetdblparam cesses eese ee eeee nennen nenne nnn nena nn nn natant nnns tran nnns anna s anna nnn n nnne nnn 401 ICI OT IBiU neige mr
89. Line 964 s is a column name The MPS file specifies a column name that does not exist 677 Macro CPXERR CONFLICT UNSTABLE Definition file cplex h CPXERR CONFLICT UNSTABLE 1720 Infeasibility not reproduced Computation failed because a previously detected infeasibility could not be reproduced A conflict exists and can be queried but it is not minimal 678 Macro CPXERR COUNT OVERLAP Definition file cplex h CPXERR COUNT OVERLAP 1228 Count entry d specifies overlapping entries Entries in the matcnt array are such that the specified items overlap 679 Macro CPXERR COUNT RANGE Definition file cplex h CPXERR COUNT RANGE 1227 Count entry 96d negative or larger than allowed Entries in matcnt arrays must be nonnegative or less than the number of items possible columns or rows for example 680 Macro CPXERR DBL Definition file cplex h CPXERR DBL MAX 1233 Numeric entry 96d is larger than allowed maximum of 96g Data checking detected a number too large 681 Macro DECOMPRESSION Definition file cplex h CPXERR DECOMPRESSION 1027 Decompression of unpresolved problem failed CPLEX was unable to restore the original problem due for example to insufficient memory 682 Macro CPXERR DUP ENTRY Definition file cplex h CPXERR DUP ENTRY 1222 Duplicate entry or entries One or more duplicate entries for a row column pair were found To identify which pair or pairs cause
90. Line 96d 9es not valid identifier An illegal variable or row name exists on the specified line 647 Macro CPXERR BAD INDCONSTR Definition file cplex h CPXERR BAD INDCONSTR 1439 Line 96d Illegal indicator constraint Indicator constraints are not allowed in the objective nor in lazy constraints nor in user cuts sections The indicator variable may only be compared against values of 0 zero and 1 one The MPS format requires that the indicator type be IF and that indicator constraints be of type E L or G 648 Macro CPXERR BAD INDICATOR Definition file cplex h CPXERR BAD INDICATOR 1551 Line 96d Unrecognized basis marker s An invalid basis marker appears in the BAS file 649 Macro CPXERR BAD LAZY UCUT Definition file cplex h CPXERR BAD LAZY UCUT 1438 Line 96d Illegal lazy constraint or user cut MPS reader does not allow E N or R in lazy constraints or user cuts 650 Macro CPXERR BAD LUB Definition file cplex h CPXERR BAD LUB 1229 Illegal bound change specified by entry d The bound change specifier must be L U or B 651 Macro CPXERR BAD METHOD Definition file cplex h CPXERR BAD METHOD 1292 Invalid choice of optimization method Unknown method selected for CPXhybnetopt or CPXhybbaropt Select PRIMAL CPX DUAL 652 Macro CPXERR BAD NUMBER Definition file cplex h CPXERR BAD NUMBER 1434 Line 96d Couldn t convert 6 to a number
91. MIP algorithms and informational callbacks 386 CPX CALLBACK INFO 8 li 000 number remaining nodes INFO ITERATIONS total number of MIP iterations 5 T INFO FEAS eturns 1 if feasible solution exists otherwise 0 BACK CPX CALLBACK INFO CUTOFF updated cutoff value int int int I CPX CAL INFO PROBE PHASE int current phase of probing 0 3 double double fraction of probing phase completed fraction of Gomory cut generation for RR M mm the pass completed 0 0 1 0 fraction of disjunctive cut generation for the pass completed 0 0 1 0 K INFO DISJCU fraction of flow cover and MIR cut K INFO FLOWMIR PROGRI generation for the pass completed 0 0 1 0 relative MIP gap between the current best primal and dual bounds K INFO MIP RI You can query the relative MIP gap between the current best primal and dual bounds outside a callback with the routine CPXgetmiprelgap For MIP algorithms and advanced callbacks CPX CALLBACK INFO double time stamp LBACK DTIME BEST INTEGER double obj value of best integer solution double obj value of best remaining node int total number of nodes solved Lut number of remaining nodes
92. May be NULL if space is O space Integer specifying the length of the arrays ind val and refval if refval is not NULL surplus p A pointer to an integer to contain the difference between space and the number of entries in each of the arrays ind and val A nonnegative value of surplus p means that the length of the arrays was sufficient A negative value reports that the length was insufficient and consequently the routine could not complete its task In this case the routine CPXgetsolnpooldivfilter returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays which An integer specifying the index of the filter to access Returns The routine returns zero if successful and nonzero if an error occurs 105 Global function CPXaddcols int CPXaddcols CPXCENVptr env CPXLPptr lp int ccnt int nzcnt const double obj const int cmatbeg const int cmatind const double cmatval const double 1 const double ub char colname Definition file cplex h The routine CPXaddcols adds columns to a specified CPLEX problem object This routine may be called time after a problem object is created via CPXcreateprob The routine CPXaddcols is very similar to the routine CPXaddrows The primary difference is that CPXaddcols cannot add coefficients in rows that do not already exist that is in rows with index greater than the number r
93. Summary CPXNETaddarcs CPXNETaddnodes CPXNETbasewrite CPXNETcheckcopynet CPXNETchgarcname CPXNETchgarcnodes CPXNETchgbds CPXNETchgname CPXNETchgnodename CPXNETchgobj CPXNETchgobjsen CPXNETchgsupply CPXNETcopybase CPXNETcopynet CPXNETcreateprob CPXNETdelarcs CPXNETdelnodes CPXNETdelset CPXNETextract CPXNETfreeprob CPXNETgetarcindex CPXNETgetarcname CPXNETgetarcnodes CPXNETgetbase CPXNETgetdj CPXNETgetitcnt CPXNETgetlb CPXNETgetnodearcs CPXNETgetnodeindex CPXNETgetnodename CPXNETgetnumarcs CPXNETgetnumnodes CPXNETgetobj CPXNETgetobjsen CPXNETgetobjval CPXNETgetphaset cnt 35 CPXNETgetprobname CPXNETgetslack CPXNETgetstat CPXNETgetsupply CPXNETgetub CPXNETgetx CPXNETprimopt CPXNETreadcopybase CPXNETreadcopyprob CPXNETsolninfo CPXNETsolution CPXNETwriteprob If part of your problem is structured as a network then you may want to consider calling the CPLEX Network Optimizer This optimizer may have a positive impact on performance There are two alternative ways of calling the network optimizer e f your problem is an LP where a large part is a network structure you may call the network optimizer for the populated LP object e f your entire problem consists of a network flow you should consider creating a network object instead of an LP object Then populate it and solve it with the network optimizer This alternative generally yields the best performance
94. The routine returns zero if successful and nonzero if an error occurs 393 Global function CPXNETgetub int CPXNETgetub CPXCENVptr env CPXCNETptr net double up int begin int end Definition file cplex h The routine CPXNETgetub is used to access the upper capacity bounds for a range of arcs in the network stored in a network problem object Example Status CPXNETgetub env net up 0 cur narcs 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob up Array in which to write the upper bound on the flow for the requested arcs If NULL is passed no upper bounds are retrieved Otherwise the array must be of size end begin 1 begin Index of the first arc for which upper bounds are to be obtained end Index of the last arc for which upper bounds are to be obtained Returns The routine returns zero on success and nonzero if an error occurs 394 Global function CPXgetax int CPXgetax CPXCENVptr env CPXCLPptr lp double x int begin int end Definition file cplex h The routine CPXgetax accesses row activity levels for a range of linear constraints The beginning and end of the range must be specified A row activity is the inner product of a row in the constraint matrix and the structural variables in the problem Example Status CPXgetax env lp x 0 CPXgetnumrows env lp 1
95. The routine returns zero on success and nonzero if an error occurs 70 Global function CPXgetnumsemiint int CPXgetnumsemiint CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumsemiint accesses the number of semi integer variables in a CPLEX problem object Example numsc CPXgetnumsemiint env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the problem object or environment does not exist CPXgetnumsemiint returns the value 0 zero otherwise it returns the number of semi integer variables in the problem object 71 Global function CPXcheckcopysos int CPXcheckcopysos CPXCENVptr env CPXCLPptr lp int numsos int numsosnz const char sostype const int sosbeg const int sosind const double soswt char sosname Definition file cplex h The routine CPXcheckcopysos validates the arguments of the corresponding CPXcopysos routine This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To call this routine you must compile and link check c with your program as well as the CPLEX Callable Library The CPXcheckcopysos routine has the same argument list as the CPXcopysos routine The second argument lp is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXL
96. a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is optimal 605 Macro CPX STAT UNBOUNDED Definition file cplex h CPX STAT UNBOUNDED 2 Simplex or Barrier enum Unbounded Problem has an unbounded ray see the concept Unboundedness for more information about infeasibility and unboundedness as a solution status 606 Macro CPX SUM 51 Definition file cplex h CPX SUM COMP SLACK Concert Technology enum SumCompSlack Numeric meaning double To access the sum of the violations of the complementary slackness conditions for the unscaled problem This feature is available only for a barrier solution Integer meaning not applicable 607 Macro CPX SUM DUAL INFEAS Definition file cplex h CPX SUM DUAL INFEAS Concert Technology enum SumDuallnfeas Numeric meaning doub1e To access the sum of dual infeasibilities equivalently the sum of reduced cost bound violations for the unscaled problem Integer meaning not applicable 608 Macro CPX SUM DUAL RESIDUAL Definition file cplex h CPX SUM DUAL RESIDUAL Concert Technology enum SumDualResidual Numeric meaning double To access the sum of the absolute values of the dual residual vector for the unscaled problem Integer meaning not applicable 609 Macro CPX SUM INDSLACK INFEAS Definition file cplex h CPX SUM INDSLACK INFEAS Concert Technology enum not
97. a node that has been moved to a node file See the CPLEX User s Manual for more information about node files useraction p A pointer to an integer specifying the action to be taken on completion of the user callback The table summarizes the possible actions Actions to be Taken after a User Written Node Callback CPX CALLBACK FAIL Exit optimization CPX CALLBACK SE Use user selected node as defined in returned values Returns The routine returns zero if successful and nonzero if an error occurs 229 Global function CPXgetsolnpoolnumfilters int CPXgetsolnpoolnumfilters CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetsolnpoolnumfilters accesses the number of filters in the solution pool Example numfilters CPXgetsolnpoolnumfilters env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the CPLEX problem object or environment does not exist CPXget solnpoolnumfilters returns the value 0 zero otherwise it returns the number of filters 230 Global function CPXgetcallbacknodeinfo int CPXgetcallbacknodeinfo CPXCENVptr env void int wherefrom int nodeindex int whichinfo void result p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorith
98. a given solution for a range of linear constraints The beginning and end of the range must be specified For each constraint the infeasibility value returned is 0 zero if the constraint is satisfied Otherwise except for ranged rows the infeasibility value returned is the amount that makes the queried solution valid when added to the righthand side of the constraint It is positive for a less than or equal to constraint negative for a greater than or equal to constraint For an equality constraint it is positive when the row activity exceeds the right hand side and negative when the row activity is less than the right hand side For ranged rows if the infeasibility value is negative it specifies the amount by which the lower bound of the range must be changed if it is positive it specifies the amount by which the upper bound of the range must be changed Example Status CPXgetrowinfeas env lp NULL infeasout 0 CPXgetnumrows env lp 1 return The routine returns zero if successful and nonzero if an error occurs Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob x The solution whose infeasibility is to be computed May be NULL in which case the resident solution is used infeasout An array to receive the infeasibility value for each of the constraints This array must be of length at least end begin 1 begin
99. access the maximum absolute value in the primal solution vector for the unscaled problem Integer meaning To access the lowest index where the maximum x value occurs for the unscaled problem Can use a supplied primal solution 570 Macro GAP Definition file cplex h CPX OBJ GAP Concert Technology enum ObjGap Numeric meaning doub1e To access the objective value gap between the primal and dual objective value solution This feature is available only for a barrier solution Integer meaning not applicable 571 Macro CPX PRIMAL Definition file cplex h CPX PRIMAL OBJ Concert Technology enum PrimalObj Numeric meaning doub1e To access the objective value relative to the primal barrier solution This feature is available only for a barrier solution Integer meaning not applicable 572 Macro SOLNPOOL DIV Definition file cplex h CPX SOLNPOOL DIV Solution replacement strategy when pool is full keep most diverse solutions 573 Macro CPX SOLNPOOL FIFO Definition file cplex h CPX SOLNPOOL FIFO Solution replacement strategy when pool is full first in first out 574 Macro CPX SOLNPOOL FILTER DIVERSITY Definition file cplex h CPX SOLNPOOL FILTER DIVERSITY Filter type filter on diversity If solution is incompatible with specified diversity measure it will be discarded from the pool 575 Macro SOLNPOOL FILTER RANGE Definition file cplex h CPX
100. accomplish the same task by means of other Callable Library routines instead The routine CPXgetbhead returns the basis header it gives the negative value minus one of all row indices of slacks Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob head An array The array contains the indices of the variables in the resident basis where basic slacks are specified by the negative of the corresponding row index minus 1 one that is rowindex 1 The array must be of length at least equal to the number of rows in the LP problem object x An array This array contains the values of the basic variables in the order specified by head The array must be of length at least equal to number of rows in the LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 127 Global function CPXboundsa int CPXboundsa CPXCENVptr env CPXCLPptr lp int begin int end double lblower double lbupper double ublower double ubupper Definition file cplex h The routine CPXboundsa accesses upper and lower sensitivity ranges for lower and upper variable bounds for a specified range of variable indices The beginning and end of the range must be specified Information for variable j where begin lt j lt end is returned in position j begin of the arrays 1blower lbupper ublower and
101. an integer programming branch and cut search To describe this routine let s assume that an LP has been solved and that the optimal solution is resident Let indices be the list of variable indices for this problem and cnt be the length of that list Then indices gives rise to 2 cnt different LPs in which each of the listed variables in turn is fixed to the greatest integer value less than or equal to its value in the current optimal solution and then each variable is fixed to the least integer value greater than or equal to its value in the current optimal solution CPXst rongbranch performs at most itlim dual steepest edge iterations on each of these 2 cnt LPs starting from the current optimal solution of the base LP The objective values that these iterations yield are placed the arrays downobj for the downward fix and upobj 1 for the upward fix If either of the fixings results in a problem which is dual unbounded primal infeasible the corresponding objective value is set to a large positive value for a minimization problem and a large negative value for a maximization problem This value is system dependent but it is usually of magnitude 7 0 75 Setting PARAM DPRIIND to 2 may give more informative values for the arguments downobj and upobj for a given number of iterations it Lim A user might use other routines of the Callable Library directly to build a function that computes the same values as CPXstrongbranch Howe
102. and CPX 1 is returned for maximization If the problem object or environment does not exist a 0 is returned 284 Global function CPXpreslvwrite int CPXpreslvwrite CPXCENVptr env CPXLPptr lp const char filename str double objoff p Definition file cplex h The routine CPXpreslvwrite writes presolved version of the problem to a file The file is saved in binary format and can be read using the routine CPXreadcopyprob Note Reductions done by the CPLEX presolve algorithms can cause the objective value to shift As a result the optimal objective obtained from solving the presolved problem created using CPXpreslvwrite may not be the same as the optimal objective of the original problem The argument can be used to reconcile this difference Example Status CPXpreslvwrite env lp myfile pre amp objoff Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the presolved problem should be written objoff p A pointer to a double precision variable that is used to hold the objective value difference between the original problem and the presolved problem Thatis orginal objective value objoff p presolved objective valu Returns The routine returns zero if successful and nonzero if an error occurs
103. and the value in p specifies the number of variables participating in the conflict Use the routine CPXgetconflict to determine which constraints and variables participate in the conflict The parameters PARAM CUTUP CPX PARAM CUTLO CPX PARAM OBJULIM CPX PARAM OBJLLIM do not influence this routine If you want to study infeasibilities introduced by those parameters consider adding an objective function constraint to your model to enforce their effect before you invoke this routine Example status CPXrefineconflict env lp NULL NULL See Also CPXgetconflict CPXrefineconflictext CPXclpwrite Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob confnumrows p A pointer to an integer where the number of linear constraints in the conflict is returned confnumcols p A pointer to an integer where the number of variable bounds in the conflict is returned Returns The routine returns zero if successful and nonzero if an error occurs 480 Global function CPXcheckvals int CPXcheckvals CPXCENVptr env CPXCLPptr lp int cnt const int rowind const int colind const double values Definition file cplex h The routine CPXcheckvals checks an array of indices and a corresponding array of values for input errors The routine is useful for validating the arguments of problem modification rou
104. and vallist k specify that the matrix coefficient in row rowlist k and column collist k should be checked with respect to the value vallist k Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 95 Global function CPXgetcallbacknodeub int CPXgetcallbacknodeub CPXCENVptr env void cbdata int wherefrom double ub int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacknodeub retrieves the upper bound values for the subproblem at the current node during MIP optimization from within a user written callback The upper bounds are tightened after a new incumbent is found so the values returned by CPXgetcallbacknodex may violate these bounds at nodes where new incumbents have been found The values are from the original problem if CPX PARAM MIPCBREDLP is set to CPX OFF otherwise they are from the presolved problem This routine may be called only when the value of the wherefrom argument is one of the following CPX CALLBACK MIP CPX CALL
105. applicable Numeric meaning doub1e To access the sum of the infeasibilities of the indicator constraints Integer meaning not applicable Can use a supplied primal solution Concert Technology does not distinguish indicator constraints from linear constraints in this respect 610 Macro CPX SUM INFEAS Definition file cplex h CPX SUM INT INFEAS Concert Technology enum SumlntInfeas Numeric meaning double To access the sum of integer infeasibilities for the unscaled problem Integer meaning not applicable Can use a supplied primal solution 611 Macro CPX SUM Definition file cplex h CPX SUM PI Concert Technology enum SumPi Numeric meaning doub1e To access the sum of the absolute values in the dual solution vector for the unscaled problem Integer meaning not applicable 612 Macro CPX SUM PRIMAL INFEAS Definition file cplex h CPX SUM PRIMAL INFEAS Concert Technology enum SumPrimallnfeas Numeric meaning doub1e To access the sum of primal infeasibilities or equivalently the sum of bound violations for the unscaled problem Integer meaning not applicable Can use a supplied primal solution 613 Macro CPX SUM PRIMAL RESIDUAL Definition file cplex h CPX SUM PRIMAL RESIDUAL Concert Technology enum SumPrimalResidual Numeric meaning double To access the sum of the elements of vector Ax b for the unscaled problem Integer meaning not applicable Can use a su
106. argument buffer_str if the string does exist In that case buffer str contains the error message string It returns NULL if the error code does not have a corresponding string 255 Global function CPXgetconflictext int CPXgetconflictext CPXCENVptr env CPXCLPptr lp int grpstat int beg int end Definition file cplex h For an infeasible problem if the infeasibility has been analysed by CPXrefineconflictext this routine accesses information about the conflict computed by it The conflict status codes of the groups numbered beg for begin through end in the most recent call to CPXrefineconflictext are returned Group Status The conflict status for group beg i will be returned in grpstat i Possible values for the status of a group as returned in grpstat are the following CONFLICT EXCLUDED if the group was proven to be not relevant to the conflict CPX CONFLICT POSSIBLE MEMBER if the group may be relevant to the conflict but has not yet been proven so e CPX CONFLIC EMBER if the group has been proven to be relevant for the conflict Example Status CPXgetconflictext env lp grpstat 0 ngrp 1 See Also CPXrefineconflictext CPXclpwrite Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob grpstat Pointer to an array where the values denoting the co
107. array store It may be 0 zero surplus p A pointer to an integer to contain the difference between storesz and the amount of memory required to store the name of the solution which An integer specifying the index of the solution for which the name is returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the array store to hold the name of the solution 239 Global function CPXgetstatstring CPXCHARptr CPXgetstatstring CPXCENVptr env Definition file cplex h int statind char buffer str The routine CPXgetstatstring places in a buffer a string corresponding to the value of stat ind as returned by the routine CPXget stat The buffer to hold the string can be up to 510 characters maximum the buffer must be at least 56 characters Example statind CPXgetstat env p CPXgetstatstring env statind buffer Parameters env statind buffer str A pointer to a buffer to hold the string corresponding to the value of stat ind Returns A pointer to the CPLEX environment as returned by CPXopenCPLEX An integer specifying the status value to return The routine returns a pointer to a buffer if the st at ind value corresponds to a valid string Otherwise it returns NULL 240 Global function CPXgetqpcoef int CPXgetqpcoef CPXCENVptr env CPXCLPptr lp int row
108. basis Even if the entire LP is a network it may not be possible to load the basis to the network object if none of the slack or artificial variables are basic Example Status CPXNETextract env net lp colmap rowmap Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Ip A pointer to a CPLEX problem object as returned by CPXcreateprob colmap If not NULL after completion colmap i contains the index of the LP column that has been mapped to arc i If colmap i lt O arci corresponds to the slack variable for row colmap i 1 The size of colmap must be atleast CPXgetnumcols lp CPXgetnumrows env lp rowmap If not NULL after completion rowmap i contains the index of the LP row that has been mapped to node If rowmap i lt 0 nodeiis a dummy node that has no corresponding row in the LP The size of rowmap must be least CPXgetnumrows env lp 1 Returns The routine returns zero if successful and nonzero if an error occurs 419 Global function CPXsetbranchcallbackfunc int CPXsetbranchcallbackfunc CPXENVptr env int CPXPUBLIC branchcallback CALLBACK BRANCH ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect be
109. begin 1 containing the effort level for each start requested startspace An integer specifying the length of the arrays varindices and values May be 0 surplus p A pointer to an integer to contain the difference between startspace and the number of entries in each of the arrays varindices and values A nonnegative value of surplus p specifies that the length of the arrays was sufficient A negative value specifies that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetmipstarts returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays begin An integer specifying the beginning of the range of MIP starts to be returned end An integer specifying the end of the range of MIP starts to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the arrays varindices and values to hold the MIP start entries 372 Global function CPXftran int CPXftran CPXCENVptr env CPXCLPptr lp double x Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult
110. call this routine you must compile and link check with your application as well as the CPLEX Callable Library The routine CPXcheckcopylpwnames has the same argument list as the routine CPXcopylpwnames The second argument 1p is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the problem For most user applications this distinction is unimportant Example status CPXcheckcopylpwnames env lp num num obj obj rhs sen mat mat mat mat lb ub rng col row Returns The routine returns nonzero if it detects 15 rows sen se beg cnt ind val val name name an error in the data it returns zero if it does not detect any data errors 453 Global function CPXgetrngval int CPXgetrngval CPXCENVptr env CPXCLPptr lp double rngval int begin int end Definition file cplex h The routine CPXget rngval accesses the RHS range coefficients for a set of constraints in a CPLEX problem object The beginning and end of the set must be specified CPXget rngval checks if ranged constraints are present in the problem object Example Status CPXgetrngval env lp rngval 0 cur numrows 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob rngval An array where RHS range coefficients are returned
111. callback was called from This argument must be the value of the wherefrom passed to the user written callback nodelp p The 1p pointer specifying the current subproblem If no subproblem is defined the pointer is set to NULL Returns The routine returns zero if successful and nonzero if an error occurs A nonzero return value may mean that the requested value is not available 242 Global function CPXgetindconstr int CPXgetindconstr CPXCENVptr env CPXCLPptr lp int indvar p int complemented p int nzcnt p double rhs p char sense p int linind double linval int space int surplus p int which Definition file cplex h The routine CPXgetindconstr accesses a specified indicator constraint on the variables of a CPLEX problem object The length of the arrays in which the nonzero coefficients of the constraint are to be returned must be specified Note If the value of space is 0 zero then the negative of the value of surplus p returned specifies the length needed for the arrays 1inind and linval Example Status CPXgetindconstr env lp amp indvar amp complemented amp linnzcnt amp rhs amp sense linind linval Space amp surplus 0 Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to CPLEX problem object as returned by CPXcreateprob indvar p A pointer to an integer to contain the index of the binary indi
112. can accomplish the same task by means of other Callable Library routines instead 23 Group optim cplex callable advanced callbacks The API of the advanced C callback routines of the CPLEX Callable Library Function Summary CPXbranchcallbackbranchbds CPXbranchcallbackbranchconstraints CPXbranchcallbackbranchgeneral CPXocutcallbackadd CPXocutcallbackaddlocal CPXgetbranchcallbackfunc CPXgetcallbackctype CPXgetcallbackgloballb CPXgetcallbackglobalub CPXgetcallbackincumbent CPXgetcallbackindicatorinfo CPXgetcallbacklp CPXgetcallbacknodeinfo CPXgetcallbacknodeintfeas CPXgetcallbacknodelb CPXgetcallbacknodelp CPXgetcallbacknodeobjval CPXgetcallbacknodestat CPXgetcallbacknodeub CPXgetcallbacknodex CPXgetcallbackorder CPXgetcallbackpseudocosts CPXgetcallbackseqinfo CPXgetcallbacksosinfo CPXgetcutcallbackfunc CPXgetdeletenodecallbackfunc CPXgetheuristiccallbackfunc CPXgetincumbentcallbackfunc CPXgetnodecallbackfunc CPXgetsolvecallbackfunc CPXsetbranchcallbackfunc CPXsetbranchnosolncallbackfunc CPXsetcutcallbackfunc CPXsetdeletenodecallbackfunc CPXsetheuristiccallbackfunc CPXsetincumbentcallbackfunc CPXsetnodecallbackfunc 24 CPXsetsolvecallbackfunc Warning These advanced callback routines typically demand a profound understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encour
113. can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPX reeusercuts clears the list of user cuts that have been previously specified through calls to CPXaddusercuts Example Status CPXfreeusercuts env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 204 Global function CPXNETgetbase int CPXNETgetbase CPXCENVptr env CPXCNETptr net int astat int nstat Definition file cplex h The routine CPXNETgetbase is used to access the network basis for a network problem object Either of the arguments astat or nstat may be NULL For this function to succeed a solution must exist for the problem object Table 1 Status codes of network arcs CPX BASIC If the arc is basic CPX A If the arc is nonbasic and its flow is on the lower bound CPX A If the arc is nonbasic and its flow is on the upper bound CPX FRE If the arc is nonbasic but is free In this case its flow is O Table 2 Status of artificial arcs CPX BASIC If the arc is basic If the arc is nonbasic and its flow is on the lower bound Example status CPXNETgetbase env
114. current model an effort level may have been associated with it to specify to CPLEX how much effort to expend in transforming the MIP start into a feasible solution This routine respects effort levels except level 1 one check feasibility It does not check feasibility Table 1 Possible values for elements of grptype CPX CON LOWER BOUND variable lower bound CPX CON UPPER BOUND variable upper bound CPX CON LINEAR linear constraint CPX CON QUADRAT 4 quadratic constraint CPX CON SOS 5 special ordered set CPX CON INDICAT indicator constraint Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob grpcnt The number of constraint groups to be considered 158 An integer specifying the total number elements passed in the arrays grpind and grptype or equivalently the end of the last group in grpind grppref An array of preferences for the groups The value grppref i specifies the preference for the group designated by the index i A negative value specifies that the corresponding group should not be considered in the computation of a conflict In other words such groups are not considered part of the start Groups with a preference 0 zero are always considered to be part of the conflict No further checking is performed on such groups grpbeg An array of
115. d The index in the query routine is too large The symbol 96s represents a string a number 701 Macro CPXERR INDEX RANGE LOW Definition file cplex h CPXERR INDEX RANGE LOW 1205 96s begin value d is less than d The index in the query routine is too small The symbol 96s represents a string d a number 702 Definition file cplex h CPXERR INT TOO BIG 3018 Magnitude of variable 96s g exceeds integer limit d CPXmipopt tried to branch on the specified integer variable at a value larger than representable in the branch and cut tree Check the problem formulation 703 Macro CPXERR INT TOO BIG INPUT Definition file cplex h CPXERR INT TOO BIG INPUT 1463 Line 96d Magnitude exceeds integer limit d A number has been read that is greater than the largest integer value that can be represented by the computer 704 Macro CPXERR INVALID NUMBER Definition file cplex h CPXERR INVALID NUMBER 1650 Number not representable in exponential notation The number to be printed is not representable 705 Macro CPXERR LIMITS TOO BIG Definition file cplex h CPXERR LIMITS TOO BIG 1012 Problem size limits too large One of the problem dimensions or read limits requires an array length beyond the architectural maximum of the computer 706 Macro CPXERR LINE TOO LONG Definition file cplex h CPXERR LINE TOO LONG 1465 Line 96d Line longer than limit of d charact
116. deleted in these circumstances when a branch is carried out from that node or when the node relaxation is infeasible or when the node relaxation objective value is worse than the cutoff Example status CPXsetdeletenodecallbackfunc env mybranchfunc mydata See also the example admipexi c the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX deletecallback A pointer to a user written branch callback If the callback is set to NULL no callback is called during optimization cbhandle A pointer to user private data This pointer is passed to the callback Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle int seqnum void handle The call to the delete node callback routine occurs during MIP optimization when a node is to be deleted The main purpose of the callback is to provide an opportunity to free any user data associated with the node thus preventing memory leaks Callback return value 221 The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines cbdata A pointer passed from the optimization routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass it to the callback information routines
117. delstat i 1 The deletion of filters results in a renumbering of the remaining filters After termination delstat i is either 1 for filters that have been deleted or the new index number that has been assigned to the remaining filters Returns The routine returns zero if successful and nonzero if an error occurs 207 Global function CPXNETgetslack int CPXNETgetslack CPXCENVptr env CPXCNETptr net double slack int begin int end Definition file cplex h The routine CPXNETgetslack is used to access slack values or equivalently violations of supplies demands for a range of nodes in the network stored in a network problem object For this function to succeed a solution must exist for the problem object Example Status CPXNETgetslack env net slack 10 20 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob slack Array in which to write solution slack variables for requested nodes If NULL is passed no data is returned Otherwise slack must point to an array of size at least end begin 1 begin Index of the first node for which a slack value is to be obtained end Index of the last node for which a slack value is to be obtained Returns The routine returns zero on success and nonzero if an error occurs 208 Global function CPXgetray int CPXgetray CPXCENVptr env CPXCLPptr
118. does not necessarily mean that a solution exists Use query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 359 Global function CPXdisconnectchannel void CPXdisconnectchannel CPXCENVptr env CPXCHANNELptr channel Definition file cplex h The routine CPXdisconnectchannel flushes all message destinations associated with a channel and clears the corresponding message destination list Example CPXdisconnectchannel env mychannel Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel A pointer to the channel containing the message destinations to be flushed and cleared Returns This routine does not have a return value 360 Global function int CPXNETprimopt CPXCENVptr env CPXNETptr net Definition file cplex h The routine CPXNETprimopt can be called after a network problem has been copied to a network problem object to find a solution to that problem using the primal network simplex method When this function is called the CPLEX primal network algorithm attempts to optimize the problem The results of the optimization are recorded in the problem object and can be retrieved by calling the appropriate solution functions for that object Example Status CPXNETprimopt env net See also the examples netex1 c and netex2 c the standard distribution of the product
119. double rmatval void userhandle int seqnum p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbranchcallbackbranchgeneral specifies the branches to be taken from the current node when the branch includes variable bound changes and additional constraints It may be called only from within a user written branch callback function Branch variables in terms of the original problem if the parameter PARAM is set to CPX OFF before the call to CPXmipopt that calls the callback Otherwise branch variables are in terms of the presolved problem Table 1 Values of varlu i change the lower bound change the upper bound B both upper and lower bounds Table 2 Values of sense i less than or equal to constraint equal to constraint a greater than or equal to constraint Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed to the user written callback This argument must be the value of cbdata passed to the user written call
120. ennt Macro CPXERRENAN Ls ut udi ea i bein ed Macro CPXERR NEED SOLN entente ttt Macro CPXERR NEGATIVE 5 6 Macro CPXERR NET DATA Macro CPXERR NET FILE SHORT Macro CPXERR NO BARRIER SOLN netten ttt tassa Macro CPXERR NO BASIC SOLN entente tnt Macro CPXERR Macro CPXERR NO BOUND SENSE ttti ttt asta Macro CPXERR NO BOUND TYPE ttt ttt tnt ttt nasa Macro CPXERR NO COLUMNS 8 Macro CPXERR NO Macro CPXERR DUAL SOLN RC E 702 E d 709 722 729 Table of Contents Macro CPXERR NO ttt ttt ttt ttt 731 Macro CPXERR NO ttt 732 Macro CPXERR NO ttt 733 Macro 734 Macro CPXERR ID FIRST entente 735 Macro CPXERR NO X ttt 736 Macro CPXERR NO LU 4
121. env int CPXPUBLIC callback CPXCENVptr void int void void cbhandle Definition file cplex h The routine CPXsetmipcallbackfunc sets the user written callback routine to be called prior to solving each subproblem in the branch and cut tree including the root node during the optimization of a mixed integer program and during some cut generation routines This routine works the same way as the routine CPXset lpcallbackfunc It enables the user to create separate callback function to be called during the solution of mixed integer programming problems MIPs The prototype for the callback function is identical to that of CPXset 1pcallbackfunc Example Status CPXsetmipcallbackfunc env mycallback NULL Parameters env A pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines callback A pointer to a user written callback function Setting callback to NULL will prevent any callback function from being called during optimization The call to callback will occur after every node during optimization and during certain cut generation routines This function must be written by the user Its prototype is explained in the Callback description cbhandle A pointer to user private data This pointer will be passed to the callback function Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callb
122. for which to return the MIP start A value of 1 specifies that the current MIP start should be used instead of a solution pool member cnt p A pointer to an integer to contain the number of MIP start entries returned that is the true length of the arrays indices and values indices An array to contain the indices of the variables in the start indices k is the index of the variable which is entry x in the MIP start information Must be of length no less than mipstartspace value An array to contain the start values The start value corresponding to indices is returned in values k Must be of length at least nipstartspace mipstartspace An integer stating the length of the non NULL array indices and values mipstartspace may be 0 zero surplus p A pointer to an integer to contain the difference between mipstartspace and the number of entries in each of the arrays indices and values A nonnegative value of surplus p specifies that the length of the arrays was sufficient A negative value specifies that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetmipstart returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays The error CPXERR NO MIPSTART reports that no start information is available Returns The routine returns zero if successful and nonzero if an
123. generated by populate as specified by the parameter PARAM POPULATELIM has been reached 880 Macro SOL Definition file cplex h CPXMIP SOL LIM 104 MIP only enum SolLim The limit on mixed integer solutions has been reached 881 Macro CPXMIP TIME LIM FEAS Definition file cplex h CPXMIP TIME LIM FEAS 107 MIP only enum TimeLimFeas Time limit exceeded but integer solution exists 882 Macro TIME INFEAS Definition file cplex h CPXMIP TIME LIM INFEAS 108 MIP only enum TimeLimInfeas Time limit exceeded no integer solution 883 Macro CPXMIP UNBOUNDED Definition file cplex h CPXMIP UNBOUNDED 118 MIP only enum Unbounded Problem has an unbounded ray 884
124. global branching direction setting CPX PARAM BRDIR CPX BRANCH DOWN branch down first on variable 3 CPX BRANCH UP 1 branch up first on variable 3 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback priority An array where the priority values are to be returned This array must be of length at least end begin 1 If successful priority 0 through priority end begin contain the priority order values May be NULL direction An array where the preferred branch directions are to be returned This array must be of length atleast end begin 1 The value of direction j will be a value from the table of branching directions May be NULL begin An integer specifying the beginning of the range of priority order information to be returned end An integer specifying the end of the range of priority order information to be returned Returns 303 The routine returns zero if successful nonzero if an error occurs 304 Global function CPXgetsolnpoolnumsolns int CPXgetsolnpoolnumsolns CPXCENVptr env CPXCLPptr 1 Definition file cplex h Returns the number of s
125. h CPXMIP FAIL FEAS 109 MIP only enum FailFeas Terminated because of an error but integer solution exists 858 Macro CPXMIP FAIL FEAS NO TREE Definition file cplex h CPXMIP FAIL FEAS NO TREE 116 MIP only enum FailFeasNoTree Out of memory no tree available integer solution exists 859 Macro CPXMIP FAIL INFEAS Definition file cplex h CPXMIP FAIL INFEAS 110 MIP only enum Faillnfeas Terminated because of an error no integer solution 860 Macro CPXMIP FAIL INFEAS TREE Definition file cplex h CPXMIP FAIL INFEAS NO TREE 117 MIP only enum FaillnfeasNoTree Out of memory no tree available no integer solution 861 Macro CPXMIP FEASIBLE Definition file cplex h CPXMIP FEASIBLE 127 MIP only enum Feasible This status occurs only after a call to the Callable Library routine CPX easopt or the Concert Technology method easopt on a MIP problem The problem under consideration was found to be feasible after phase 1 of FeasOpt A feasible solution is available This status is also used in the status field of solution and mipstart files for solutions from the solution pool 862 Macro FEASIBLE RELAXED Definition file cplex h CPXMIP FEASIBLE RELAXED INF 122 MIP only enum FeasibleRelaxedlnf This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE
126. in the same order as before the deletion Note The delstat array must have at least CPXgetnumrows env lp elements Example status CPXdelsetrows env lp delstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob delstat An array specifying the rows to be deleted The routine CPXdelsetrows deletes each row i for which delstat i 1 The deletion of rows results in a renumbering of the remaining rows After termination delstat i is either 1 for rows that have been deleted or the new index number that has been assigned to the remaining rows Returns The routine returns zero if successful and nonzero if an error occurs 530 Global function CPXgetcolindex int CPXgetcolindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXgetcolindex searches for the index number of the specified column in a CPLEX problem object Example Status CPXgetcolindex env lp power43 amp colindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str A column name to search for index p A pointer to an integer to hold the index number of the column with name 1name str If the routine is successful index p contains the index number otherwise in
127. int CPXgetbasednorms CPXCENVptr env CPXCLPptr lp int cstat int rstat double dnorm Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetbasednorms works in conjunction with the routine CPXcopybasednorms CPXgetbasednorms retrieves the resident basis and dual norms from a specified problem object Each of the arrays cstat rstat and dnorm must be non NULL That is each of these arrays must be allocated The allocated size of cst at is assumed by this routine to be at least the number returned by CPXgetnumcols The allocated size of rstat and dnorm are assumed to be at least the number returned by CPXgetnumrows Other details of cstat rstat and dnorm are not documented Success Failure If this routine succeeds cstat and rstat contain information about the resident basis and dnorm contains the dual steepest edge norms If there is no basis or if there is no set of dual steepest edge norms this routine returns an error code The returned data are intended solely for use by CPXcopybasednorms Example For example if a given LP has just been s
128. it to the callback information routines wherefrom An integer value reporting where in the optimization this function was called It will have the value CPX CALLBACK SOLVE cbhandle A pointer to user private data useraction p A pointer to an integer specifying the action to be taken on completion of the user callback Table 11 summarizes the possible actions Actions to be Taken after a User Written Solve Callback Use CPLEX subproblem optimizer CPX CALLBACK FAIL Exit optimization CPX CALLBACK SE The subproblem has been solved in the callback Returns The routine returns zero if successful and nonzero if an error occurs 375 Global function CPXuncrushform int CPXuncrushform CPXCENVptr env CPXCLPptr lp int plen const int pind const double pval int len p double offset p int ind double val Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXuncrushform uncrushes a linear formula of the presolved problem to a linear formula of the original problem Let cols CPXgetnumcols env lp lfind i
129. measure of dual infeasibility li 1 if primal feasible 0 if not 385 CPX CALL K INFO CROSSOVER DPUSH dual push crossover itn count CPX CALL K INFO CROSSOVER D dual exchange crossover itn count number of super basic variables left in the basis K INFO CROSSOVI returns pointer to original user problem available for primal dual barrier mip CPX CALLBACK INFO USER PROBLEM CPXCLPptr Crossover from a barrier to a simplex solution reduces the super basic count In fact in a barrier crossover if the count reaches 0 zero the crossover has finished Thus the super basic count serves as a measure of progress for the crossover algorithm For Network algorithms whichinfo type of result p description ENDTIME double time stamp PRIMAL double primal objective value PRIMAL double measure of primal infeasibility ITCOU int iteration count 1 if primal feasible O if not For Presolve algorithms whichinfo type of result p double time stamp E ROWSGONI int number of rows eliminated number of columns eliminated E COLSGONI int number of aggregator Dan gn substitutions number of modified coefficients For
130. msg string Status CPXdelfuncdest env mychannel fileptr msgfunction Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel The pointer to the channel to which the function destination is to be added handle A void pointer that can be used the msg unct ion routine to direct the message to a file the screen or a memory location msgfunction The pointer to the function to be called when a message is sent to a channel For details about this callback function see CPXaddfuncdest See Also CPXaddfuncdest Returns The routines return zero if successful and nonzero if an error occurs Failure occurs when msgfunct ion is not in the message destination list or the channel does not exist 521 Global function CPXgetheuristiccallbackfunc void CPXgetheuristiccallbackfunc CPXCENVptr env int CPXPUBLIC heuristiccallback p CALLBACK HEURISTIC ARGS void cbhandle p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetheuristiccallbackfunc accesses the user written callback to be called
131. must be of length at least the number of rows in the LP problem object prepi An array that contains dual solution pi values for the presolved problem as returned by routines such as CPXgetpi and CPXsolution when applied to the presolved problem object The array must be of length at least the number of rows in the presolved problem object Returns The routine returns zero if successful and nonzero if an error occurs 290 Global function CPXgetsolnpoolsolnindex int CPXgetsolnpoolsolnindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXgetsolnpoolsolnindex searches for the index number of the specified solution in the solution pool of a CPLEX problem object Example Status CPXgetsolnpoolsolnindex env lp amp setindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str A solution name to search for index p A pointer to an integer to hold the index number of the solution with name 1name str If the routine is successful index p contains the index number otherwise index is undefined Returns The routine returns zero on success and nonzero if an error occurs 291 Global function CPXdelsetmipstarts int CPXdelsetmipstarts CPXCENVptr env CPXLPptr lp int delstat Definition file cplex h The routine CPXdelsetmipst
132. net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob nnames Where to copy pointers to arc names stored in the namestore array The length of this array must be at least end begin 1 The pointer to the name of arc i is returned in nnames i begin namestore Array of characters to which the specified arc names are to be copied It may be NULL if namespc is 0 namespc Length of the namestore array surplus Pointer to an integer to which the difference between namespc and the number of characters required to store the requested names is returned A nonnegative value indicates that namespc was sufficient A negative value indicates that it was insufficient In that case CPXERR NEGATIVE SURPLUS is returned and the negative value of surplus p indicates the amount of insufficient space in the array namestore begin Index of the first arc for which a name is to be obtained end Index of the last arc for which a name is to be obtained Returns The routine returns zero on success and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS indicates that insufficient space was available in the namestore array to hold the names 259 Global function CPXgetsense int CPXgetsense CPXCENVptr env CPXCLPptr lp char sense int begin int end Definition file cplex h The routine CPXgetsense accesses the sense for a range of constraints in a CPLEX problem object The beginni
133. no solution problem or environment exists CPXgetnodeleftocnt returns 0 zero otherwise CPXgetnodeleftcnt returns the number of unexplored nodes left in the branch and cut tree 199 Global function CPXfltwrite int CPXfltwrite CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h The routine CPX 1twrite writes filters from the selected problem object to a file in FLT format This format is documented in the CPLEX File Formats Reference Manual See Also CPXreadcopysolnpoolfilters Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the filters should be written Returns The routine returns zero if successful and nonzero if an error occurs 200 Global function CPXgetcallbacknodeobjval int CPXgetcallbacknodeobjval CPXCENVptr env void cbdata int wherefrom double p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine C
134. nzcnt p int qmatbeg int qmatind double qmatval int qmatspace int surplus p int begin int end Definition file cplex h The routine CPXgetquad is used to access a range of columns of the matrix Q of a model with a quadratic objective function The beginning and end of the range along with the length of the arrays in which the nonzero entries of these columns are to be returned must be specified Specifically column j consists of the entries in qmatval and qmatind the range from qmatbeg j begin to qmatbeg j 1 begin 1 Column end consists of the entries from qmatbeg end begin to nzcnt p 1 This array must be of length at least end begin 1 Note If the value of qmat space is zero the negative of the value of surplus p returned indicates the length needed for the arrays qmatind and qmatval Example Status CPXgetquad env lp amp nzcnt qmatbeg qmatind qmatval qmatspace amp surplus 0 cur numquad 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob nzcnt p A pointer to an integer to contain the number of nonzeros returned that is the true length of the arrays qmatind and qmatval qmatbeg array to contain indices indicating where each of the requested columns of Q begins in the arrays qmatval and qmatind qmatind array to contain the row indices associated with
135. object The list is prepared as a set of triples 1 j value where i is the row index 5 is the column index and value is the new value The list may be in any order Note The corresponding rows and columns must already exist in the CPLEX problem object This routine cannot be used to change objective righthand side range or bound coefficients Duplicate entries that is two triplets with identical i and 5 are not allowed When you build or modify your problem with this routine you can verify that the results are as you intended by calling CPXcheckchgcoeflist during application development Example status CPXchgcoeflist env lp numcoefs rowlist collist vallist Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob numcoefs The number of coefficients to change or equivalently the length of the arrays rowlist collist and vallist rowlist An array of length numcoefs that with collist and vallist specifies the coefficients to change collist An array of length numcoefs that with rowlist and vallist specifies the coefficients to change vallist An array of length numcoefs that with rowlist and collist specifies the coefficients to change The entries rowlist collist k and vallist k specify that the matrix coefficient in row rowlist k and column collist k should be changed to the value vallist k Re
136. occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object CPXERR PROBLEM Exceeding a user specified CPLEX limit is not considered an error Proving the problem infeasible or unbounded is not considered an error A zero return value does not necessarily mean that a solution exists Use the query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 402 Global function CPXNETgetpi int CPXNETgetpi CPXCENVptr env CPXCNETptr net double pi int begin int end Definition file cplex h The routine CPXNETgetpi is used to access dual values for a range of nodes in the network stored in a network problem object For this function to succeed a solution must exist for the problem object Example Status CPXNETgetpi env net 10 20 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob pi Array in which to write solution dual values for requested nodes If NULL is passed no data is returned Otherwise pi must point to an array of size at least end begin 1 begin Index of the first node for which the dual value is to be obtained end Index of the last node for which the dual value is to be obtained Returns
137. of branches required to solve the MIP As an example of a cut first consider the following constraint involving three binary 0 1 variables 20x 25y 30z 40 That sample constraint can be strengthened by adding the following cut to the model 1 ly 12 lt 1 No feasible integer solutions are ruled out by the cut but some fractional solutions for example 0 0 0 4 1 0 can no longer be obtained in any LP or QP subproblems at the nodes possibly reducing the amount of searching needed The branch and cut procedure then consists of performing branches and applying cuts at the nodes of the tree Here is a more detailed outline of the steps involved First the branch and cut tree is initialized to contain the root node as the only active node The root node of the tree represents the entire problem ignoring all of the explicit integrality requirements Potential cuts are generated for the root node but in the interest of keeping the problem size reasonable not all such cuts are applied to the model immediately If possible an incumbent solution that is the best known solution that satisfies all the integrality requirements is established at this point for later use in the algorithm Such a solution may be established either by CPLEX or by a user who specifies a starting solution by means of the Callable Library routine CPXcopymipstart or the Concert Technology method IloCplex setVectors When processing a node CPLEX start
138. penalties in the two arrays downratio and upratio For a given indices i downratio i has the following meaning Let xj be the name of the basic variable with index j and that the value of xj is and suppose that xj is fixed to some value t lt t In a subsequent call to CPXdualopt the leaving variable in the first iteration of this call is uniquely determined It must be xj There are then two possibilities Either an entering variable is determined or it is concluded in the first iteration that the changed problem is dual unbounded primal infeasible In the latter case downratio i is set equal to a large positive value this number is system dependent but is usually 7 0 75 In the former case where ris the change in the objective function after this one iteration downratio i is determined by r t t downratio i The meaning of upratio i is analogous to that of downratio i except that xj is fixed to a value t t Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned byCPXcreateprob indices An array of integers that must be of length at least cnt The entries in indices must all be indices of current basic variables Moreover these indices must all be indices of original problem variables that is they must all take values smaller than the number of columns in the problem as returned by CPXgetnumcols Negative indi
139. pointer found for message routine The message routine needs a pointer to a file 713 Macro CPXERR MSG FUNCTION Definition file cplex h CPXERR MSG NO FUNCTION 1053 No function pointer found for message routine The message routine needs a pointer to a function 714 Macro CPXERR NAME CREATION Definition file cplex h CPXERR NAME CREATION 1209 Unable to create default names The current names of rows or columns don t allow the creation of default names 715 Macro CPXERR NAME NOT FOUND Definition file cplex h CPXERR NAME NOT FOUND 1210 Name not found Name does not exist Check the arguments of CPXgetcolindex or CPXget rowindex 716 Macro CPXERR NAME TOO LONG Definition file cplex h CPXERR NAME TOO LONG 1464 Line 96d Identifier name too long to process The length of the identifier or name was beyond the size CPLEX can process 717 Definition file cplex h CPXERR NAN 1225 Numeric entry d is a double precision number The value is not a number 718 Macro CPXERR NEED SOLN Definition file cplex h CPXERR NEED OPT SOLN 1252 Optimal solution required An optimal solution must exist before the requested operation can be performed 719 Macro CPXERR NEGATIVE SURPLUS Definition file cplex h CPXERR NEGATIVE SURPLUS 1207 Insufficient array length The array is too short to hold the requested data 720 Macro CPXERR D
140. relaxation of that constraint or bound For example consider a preference of p on a constraint that is relaxed by 2 units The penalty of this relaxation will be 1 p when minimizing the weighted number of infeasibilities the penalty will be 2 p when minimizing the weighted sum of infeasibilities and the penalty will be 4 p when minimizing the weighted sum of the squares of the infeasibilities The user may specify a preference less than or equal to 0 zero which denotes that the corresponding constraint or bound must not be relaxed To determine whether CPXfeasopt found relaxed values to make the problem feasible call the routine CPXsolninfo for continuous problems or CPXget stat for any problem type CPXsolninfo Will return a value of CPX SOLN for the argument solntype_p if CPXfeasopt could not find a feasible relaxation Otherwise it will return one of the following depending on the value of CPX PARAM FEASOPTMODE STAT FEASIBLE RELAXED SUM STAT OPTIMAL RELAXED SUM STAT FEASIBLE RELAXED INF STAT OPTIMAL RELAXED INF 509 CPX STAT FEASIBLE RELAXED QUAD CPX STAT OPTIMAL RELAXED QUAD For a MIP problem the routine CPXget stat will return a value of INFEASIBLE or CPX STAT INFEASIBLE if it could not find a feasible relaxation Otherwise it will return one of the following depending on the value PARAM FEASOPTMODE
141. returns zero if not it returns nonzero to indicate an error 250 Global function CPXgetstrparam int CPXgetstrparam CPXCENVptr env int whichparam char value str Definition file cplex h The routine CPXgetstrparam obtains the current value of a CPLEX string parameter Example Status CPXgetstrparam env CPX PARAM WORKDIR dirname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter for which the value is to be obtained value str A pointer to a buffer of length at least CPX STR PARAM to hold the current value of the CPLEX parameter Returns The routine returns zero if successful and nonzero if an error occurs 251 Global function CPXstrlen int CPXstrlen const char s str Definition file cplex h The routine CPXst rlen determines the length of a string It is exactly the same as the standard C library routine strlen This routine is provided so that strings passed to the message function routines see CPXaddfuncdest can be analyzed by languages that do not allow dereferencing of pointers for example older versions of Visual Basic Example len CPXstrlen p Parameters S Str A pointer to a character string Returns The routine returns the length of the string 252 Global function CPXNETgetnodearcs int CPXNETgetnodearcs CPXCENVptr env CPXCNETptr net int arccnt p int arc
142. risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXpivotout pivots a list of fixed variables out of the resident basis Variables are fixed when the absolute difference between the lower and upper bounds is at most 1 0e 10 Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob clist An array of length clen containing the column indices of the variables to be pivoted out of the basis If any of these variables is not fixed CPXpivotout returns an error code clen An integer that specifies the number of entries in the array clist Returns The routine returns zero if successful and nonzero if an error occurs 165 Global function CPXgetnumcuts int CPXgetnumcuts CPXCENVptr env CPXCLPptr lp int cuttype int num p Definition file cplex h The routine CPXgetnumcuts accesses the number of cuts of the specified type in use at the end of the previous optimization Example Status CPXgetnumcuts env lp CPX CUT COVER amp numcovers Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cuttype An integer specifying the typ
143. routine returns zero if successful and nonzero if an error occurs 524 Global function CPXcrushform int CPXcrushform CPXCENVptr env CPXCLPptr lp int len const int ind const double val int plen p double poffset p int pind double pval Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcrushform crushes a linear formula of the original problem to a linear formula of the presolved problem Example status CPXcrushform env lp len ind val amp plen amp poffset pind pval Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob len The number of entries in the arrays ind and val ind An array to hold the column indices of coefficients in the array 1 val The linear formula in terms of the original problem Each entry ind i specifies the column index of the corresponding coefficient val i plen p A pointer to an integer to receive the number of nonzero coefficients that is the true length of the arrays a
144. routine returns zero on success and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS indicates that there was not enough space in the namest ore array to hold the names 110 Global function CPXsetheuristiccallbackfunc int CPXsetheuristiccallbackfunc CPXENVptr env int CPXPUBLIC heuristiccallback CALLBACK HEURISTIC ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetheuristiccallbackfunc sets or modifies the user written callback to be called by CPLEX during MIP optimization after the subproblem has been solved to optimality That callback is not called when the subproblem is infeasible or cut off The callback supplies CPLEX with heuristically derived integer solutions If a linear program must be solved as part of a heuristic callback make a copy of the node LP and solve the copy not the CPLEX node LP Example Status CPXsetheuristiccallbackfunc env myheuristicfunc mydata See also the example admipex2 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by
145. senes snnt 322 Global function 323 Global function 324 Global function CPXbinvCol ci eter eerie nice recte uer lae 325 Global function CPXgetcallbackgloballb eeeeeeeee eene eene enne nn nnnm nnne nnns nnne nnne 326 Global function CPXgetqconstrindex esee eee eeee eene e eene nennt nnn nn nannten nnt a nnnm ss nnn ninm anten nnns 327 Global function 328 Global function CPXdeltoWs ien rient n eietesc ken 329 Global function 330 Global function CPXgetijdiv 2 nce eere Ideen reete iter 331 Global function 332 Global function 333 Global function CPXgetcallbacklp eeeeeeeee eene eene eene nennen nnne nnn ntnn nana nn nn nnns nnnm n stra sinn 334 Global function 336 Global function 337 Global function CPXopenCPLEX 1 2 rie cei He eek nie tk enses uere 338 Global function 5
146. set of variables In order to say Give me solutions that are different from this one specify a finite 1ower bound and an infinite that is very large upper bound on the diversity CPLEX then looks for solutions that differ from the reference values by at least the value of 1ower bound within the specified set of variables Example status CPXaddsolnpooldivfilter env lp loval hival cnt ind val refval fnamestr Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob lower bound Lower bound on the diversity measure for new solutions allowed in the pool upper bound Upper bound on the diversity measure for new solutions allowed in the pool nzcnt Number of variables used to define the diversity measure ind An array of indices of variables in the diversity measure weight An array of weights to be used in the diversity measure The indices and corresponding weights must be stored in sequential locations in the arrays ind and weight from positions O zero to num 1 Each entry ind i specifies the variable index of the corresponding weight weight i be NULL in which case CPLEX uses weights of 1 0 one 269 An array of reference values for the variables with indices the array ind to compare with a solution when CPLEX computes the diversity measure Iname str The name of the filter May be NULL Returns ref
147. table ordspace An integer specifying the length of the non NULL arrays indices priority and direction May be 0 surplus p A pointer to an integer to contain the difference between ordspace and the number of entries in each of the arrays indices priority and direction A nonnegative value of surplus p reports that the length of the arrays was sufficient A negative value reports that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetorder returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in the indices priority and direction arrays to hold the priority order information 319 Global function CPXchgqpcoef int CPXchgqpcoef CPXCENVptr env CPXLPptr lp int i int j double newvalue Definition file cplex h The routine CPXchgapcoef changes the coefficient in the quadratic objective of a quadratic problem corresponding to the variable pair i j to the value newvalue If i is not equal to j both i j and Q j i are changed to newvalue Example Status CPXchgqpcoef env lp 10 12 82 5 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip
148. that define the CPLEX selected branch nodeest An array with nodecnt entries that contains estimates of the integer objective function value that will be attained from the created node nodebeg An array with nodecnt entries The i th entry is the index into the arrays indices lu and bd of the first bound changed for the ith node indices Together with 1u and this array defines the bound changes for each of the created nodes The entry indices i is the index for the variable lu Together with indices and bd this array defines the bound changes for each of the created nodes The entry lu i is one of the three possible values specifying which bound to change e L for lower bound or 0 for upper bound or e B for both bounds bd Together with indices and 1u this array defines the bound changes for each of the created nodes The entry bd i specifies the new value of the bound useraction p A pointer to an integer specifying the action for CPLEX to take at the completion of the user callback The table summarizes the possible actions Actions to be Taken After a User Written Branch Callback 1 CPX CALLBACK FAIL Exit optimization 5 Use user selected branch as defined by calls to ARN CPXbranchcallbackbranchbds Returns 422 The routine returns zero if successful nonzero if an error occurs 423 Global function CPXsolwritesolnpool int CPXsolwritesoln
149. the Callable Library for information about the cause 837 Macro CPXERR THREAD FAILED Definition file cplex h CPXERR THREAD FAILED 1234 Creation of parallel thread failed Could not create one or more requested parallel threads 838 Macro CPXERR TILIM CONDITION NO Definition file cplex h CPXERR TILIM CONDITION NO 1268 Time limit reached in computing condition number Condition number computation was not completed due to a time limit 839 Macro CPXERR TILIM STRONGBRANCH Definition file cplex h CPXERR TILIM STRONGBRANCH 1266 Time limit reached in strong branching Strong branching was not completed due to a time limit 840 Macro CPXERR TOO MANY COEFFS Definition file cplex h CPXERR TOO MANY COEFFS 1433 Too many coefficients The problem contains more matrix coefficients than are allowed 841 Macro CPXERR TOO COLS Definition file cplex h CPXERR TOO MANY COLS 1432 Too many columns The problem contains more columns than are allowed 842 Macro CPXERR TOO MANY RIMNZ Definition file cplex h CPXERR TOO MANY RIMNZ 1485 Too many rim nonzeros Reset the rim vector nonzero read limit to a larger number 843 Macro CPXERR TOO MANY RIMS Definition file cplex h CPXERR TOO MANY RIMS 1484 Too many rim vectors Reset the rim vector read limit to a larger number 844 Macro CPXERR TOO MANY ROWS Definition file cplex h CPXERR TOO MANY ROWS 1431 Too many rows The problem cont
150. the SOS definition 544 Global function CPXgetchgparam int CPXgetchgparam CPXCENVptr env int cnt p int paramnum int pspace int surplus p Definition file cplex h The routine CPXgetchgparam returns an arrary of parameter numbers unique identifiers for parameters which are not set at their default values Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cnt p A pointer to an integer to contain the number of parameter numbers unique identifiers returned that is the true length of the array paramnum paramnum The array to contain the numbers of the parameters with nondefault values pspace An integer specifying the length of the array paramnum surplus A pointer to an integer to contain the difference between pspace and the number of entries in paramnum nonnegative value of surplus p specifies that the length of the arrays was sufficient A negative value specifies that the length was insufficient and that the routine could not complete its task In that case the routine CPXgetchgparam returns the value CPXERR NEGATIVE SURPLUS and the value of surplus p specifies the amount of insufficiency that is how much more space is needed in the arrays Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the array paramnum to hold the pa
151. the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value specifying which optimization algorithm the user written callback function was called from Possible values and their meaning appear in the table Value Symbolic Constant Meaning CPX CALLBACK PRIMAL From primal simplex BACK DUAL From dual simplex RI CPX CAI Li Li CPX_CALI L_CROSSOVER From dual crossover UA CPX_CALLBACK_BARRIER From barrier ESOLVE From presolve CPX_CALI E From QP barrier Li Li CPX_CALLBACK_PR CPX_CALI PLE From QP simplex cbhandle Pointer to user private data as passed to CPXsetlpcallbackfunc Parameters 277 env A pointer to the CPLEX environment as returned by CPXopenCPLEX callback p The address of the pointer to the current user written callback function If no callback function has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer Example status CPXgetlpcallbackfunc env mycallback NULL See Also CPXgetcallbackinfo Returns The routine returns zero if successful and nonzero if an error occurs 278 Global function CPXgetchannels int CPXgetchannels CPXCENVptr env CPXCHANNELptr cpxresults p CPXCHANNELptr cpxwarning p CPXCHANNELptr cpxerror p CPXCHANNELptr cpxlog p Definition file cplex h The routine CPXgetchannels obtains po
152. the new rows or equivalently the constraint names May be NULL in which case the new rows are assigned default names if the rows already resident in the CPLEX problem object have names otherwise no names are associated with the constraints If row names are passed to CPXaddrows but existing constraints have no names assigned default names are created for them The routine returns zero if successful and nonzero if an error occurs 214 Global function CPXgetcallbackpseudocosts int CPXgetcallbackpseudocosts CPXCENVptr env void cbdata int wherefrom double uppc double downpc int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackpseudocosts retrieves the pseudo cost values during MIP optimization from within a user written callback The values are from the original problem if CPX PARAM MIPCBREDLP is set to CPX OFF Otherwise they are from the presolved problem Note When pseudo costs are retrieved for the original problem variables pseudo costs are zero for variables that have been removed from the problem s
153. to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXft ran solves By x and puts the answer in the vector x where is the basis matrix Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned CPXcreateprob x An array that holds the righthand side vector on input and the solution vector on output The array must be of length at least equal to the number of rows in the LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 373 Global function CPXsetsolvecallbackfunc int CPXsetsolvecallbackfunc CPXENVptr env int CPXPUBLIC solvecallback CALLBACK SOLVE ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetsolvecallbackfunc sets and modifies the user written callback to be called during optimization to optimize subproblems for example node and heuristic sub
154. upper bounds of the variables present in indices Returns The routine returns zero if successful and nonzero if an error occurs 184 Global function CPXreadcopymipstarts int CPXreadcopymipstarts CPXCENVptr env CPXLPptr lp const char filename str Definition file cplex h The routine CPXreadcopymipstarts reads a MST file and copies the information of all the MIP starts contained in this file into a CPLEX problem object The parameter PARAM ADVIND must be set to 1 one its default value or 2 two in order for the MIP starts to be used Example Status CPXreadcopymipstart env lp myprob mst Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A string containing the name of the MST file Returns The routine returns zero if successful and nonzero if an error occurs 185 Global function CPXgetnumquad int CPXgetnumquad CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumquad returns the number of variables that have quadratic objective coefficients in a CPLEX problem object Example numquad CPXgetnumquad env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If successful the routine returns the number of variables having quadra
155. upper range values are to be returned This array must be of length atleast end begin 1 Returns The routine returns zero if successful and nonzero if an error occurs This routine fails if no optimal basis exists 145 Global function CPXgetnummipstarts int CPXgetnummipstarts CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnummipstarts accesses the number of MIP starts in the CPLEX problem object Example numsolns CPXgetnummipstarts env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the CPLEX problem object or environment does not exist CPXgetnummipstarts returns the value 0 zero otherwise it returns the number of solutions 146 Global function CPXgetdj int CPXgetdj CPXCENVptr env CPXCLPptr lp double dj int begin int end Definition file cplex h The routine CPXgetd accesses the reduced costs for a range of the variables of a linear or quadratic program The beginning and end of the range must be specified Example status CPXgetdj env lp dj 0 CPXgetnumcols env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob dj An array to receive the values of the reduced costs for each of the variables This array must be of leng
156. used at any time even after problem modifications That is these routines access information about a problem object with a quadratic objective function 43 Group optim cplex callable readfiles The routines in the CPLEX Callable Library to read files CPXreadcopymipstarts CPXreadcopyorder CPXreadcopyprob CPXreadcopysol CPXreadcopysolnpoolfilters Use these routines to read data from system files CPLEX can read problem files stored in a variety of formats For more information about the file formats see the CPLEX File Formats Reference Manual 44 Group optim cplex callable readnetworkfiles The routines in the CPLEX Callable Library to read network files Function Summary CPXNETreadcopybase CPXNETreadcopyprob Use these routines to read data from system files into a network problem object 45 Group optim cplex callable solutionpool The routines in the CPLEX Callable Library for the solution pool CPX SOLNPOOL DIV CPX SOLNPOOL FIFO CPX SOLNPOOL FILTER DIVERSITY CPX SOLNPOOL FILTER RANGE CPX SOLNPOOL OBJ CPXgetsolnpoolnummipstarts CPXgetsolnpoolslack CPXmstwritesolnpool CPXmstwritesolnpoolall 46 CPXpopulate CPXreadcopysolnpoolfilters CPXsolwritesolnpool CPXsolwritesolnpoolall These routines populate filter and manage the solution pool to accumulate or generate multiple solutions 47 Group optim cplex callable util The general utilities in the CPLEX Callab
157. varindices values effortlevel See Also CPXaddmipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob ment An integer giving the number of MIP starts to be changed This specifies the length of the array mipstartindices mipstartindices An array of length mcnt containing the numeric indices of the MIP starts to be changed nzcnt An integer giving the number of entries to be changed This specifies the length of the arrays varindices and values beg An array of length mcnt specifying which part of arrays varindices and values concern which start to be changed beg 0 must be 0 zero The elements specific to each start i must be stored in sequential locations in arrays varindices and values from position 1 to beg i 1 1 or from beg i to 1 if i mcnt 1 varindices An array of length nzcnt containing the numeric indices of the columns corresponding to the variables which are assigned starting values values An array of length nzcnt containing the values to use for the starts The entry values j is the value assigned to the variable indices j entry values j greater than or equal to INFBOUND specifies that no value is set for the variable 3 Returns The routine returns zero if successful and nonzero if an error occurs 472 Global function CPXgetcallb
158. your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcrushpi crushes a dual solution for the original problem to a dual solution for the presolved problem Example Status CPXcrushpi env lp origpi reducepi Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob pi An array that contains dual solution pi values for the original problem as returned by routines such as CPXgetpi Of CPXsolution The array must be of length at least the number of rows in the LP problem object prepi An array to receive dual values corresponding to the presolved problem The array must be of length at least the number of rows in the presolved problem object Returns The routine returns zero if successful and nonzero if an error occurs 486 Global function CPXgetqconstr int CPXgetqconstr CPXCENVptr env CPXCLPptr lp int linnzcnt p int quadnzcnt p double rhs p char sense p int linind double linval int linspace int linsurplus p int quadrow int quadcol double quadval int quadspace int quadsurplus p int which Definition file cplex h The routine CPXgetqconstr is used to access a specified quadratic constraint on the variables of a CPLEX
159. 1106 Aborted during presolve The user halted preprocessing by means of a callback 789 Definition file cplex h CPXERR PRESLV BAD PARAM RESLV BAD PARAM 1122 Bad presolve parameter setting Dual presolve reductions CPX PARAM REDUCE were specified in the presence of lazy constraints or nonlinear reductions PARAM PRELIN EAR were specified in the presence of user cuts 790 Macro CPXERR PRESLV BASIS Definition file cplex h CPXERR PRESLV BASIS MEM 1107 Not enough memory to build basis for original LP Insufficient memory exists to complete the uncrushing of the presolved problem 791 Macro CPXERR PRESLV COPYORDER Definition file cplex h CPXERR PRESLV COPYORDER 1109 Can t copy priority order info from original MIP The CPLEX call to CPXcopyorder failed 792 Macro CPXERR PRESLV COPYSOS Definition file cplex h CPXERR PRESLV COPYSOS 1108 Can t copy SOS info from original MIP The CPLEX call to CPXcopysos failed 793 Macro CPXERR PRESLV CRUSHFORM Definition file cplex h CPXERR PRESLV CRUSHFORM 1121 Can t crush solution form Presolve could not reduce the solution 794 Macro CPXERR PRESLV DUAL Definition file cplex h CPXERR PRESLV DUAL 1119 The feature is not available for solving dual formulation Certain presolve features are not compatible with its creating an explicit dual formulation 795 Macro CPXERR PRESL
160. 249 Global function CPXNETsolution int CPXNETsolution CPXCENVptr env CPXCNETptr net int netstat p double objval p double x double pi double slack double dj Definition file cplex h The routine CPXNETsolution accesses solution values for a network problem object computed by the most recent call to CPXNETprimopt for that object The solution values are maintained in the object as long as no changes are applied to it with one of the CPXNETchg CPXNETcopy Or CPXNETadd functions Whether or not a solution exists can be determined by CPXNETsolninfo The arguments to CPXNETsolution are pointers to locations where data is to be written Such data includes the solution status the value of the objective function primal dual and slack values and the reduced costs Although all the above data exists after a successful call to CPXNETprimopt it is possible that the user only needs a subset of the available data Thus if any part of the solution represented by an argument to CPXNETsolution is not required a NULL pointer can be passed for that argument Example status CPXNETsolution env net amp netstatus amp objval x pi slack dj Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob netstat p Pointer to which the solution status is to be written The specific valu
161. 285 Global function CPXqpindefcertificate int CPXqpindefcertificate CPXCENVptr env CPXCLPptr lp double x Definition file cplex h The routine CPXqpindefcertificate computes a vector x that satisfies the inequality lt 0 Such a vector demonstrates that the matrix Q violates the assumption of positive semi definiteness and can be an aid in debugging a user s program if indefiniteness is an unexpected outcome Example Status CPXqpindefcertificate env lp x Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob x array to receive the values of the vector that is to be returned The length of this array must be the same as the number of quadratic variables in the problem which can be obtained by calling CPXgetnumquad for example Returns The routine returns zero on success and nonzero if an error occurs 286 Global function CPXgetcrosspexchcnt int CPXgetcrosspexchent CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetcrosspexchocnt accesses the number of primal exchange iterations in the crossover method An exchange occurs when a nonbasic variable is forced to enter the basis as it is pushed toward a bound Example itcnt CPXgetcrosspexchcnt env 1p Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem o
162. 458 Global function CPXordwrite int CPXordwrite CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h The routine CPXordwrite writes a priority order to an ORD file If a priority order has been associated with the CPLEX problem object or the parameter PARAM MIPORDT YPE is nonzero or a MIP feasible solution exists this routine writes the priority order into a file Example Status CPXordwrite env lp myfile ord See also the example mipex3 c in the standard distribution See Also CPXreadcopyorder Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the ORD information should be written Returns The routine returns zero if successful and nonzero if an error occurs 459 Global function CPXgetrhs int CPXgetrhs CPXCENVptr env CPXCLPptr lp double rhs int begin int end Definition file cplex h The routine CPXget rhs accesses the righthand side coefficients for a range of constraints in a CPLEX problem object The beginning and end of the range must be specified Example Status CPXgetrhs env lp rhs 0 cur numrows 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob rhs An array whe
163. 518 Global function CPXgetsolnpoolqconstrslack Leserinnen eese nennen nennen nnne nnne nnns nnne nnn 519 CIERRE 520 Global function 521 Global function CPXgetheuristiccallbackfunc sees eese e eese eene nennen nenne nennen nennen nnne nnnm nnn nnne 522 Global function 523 Global function 5 525 Global function 526 XV Table of Contents Global function 527 Global function 528 Global function 529 Global function 5 530 Global function 531 Global function CPXclpwirite nnt era eee tend kae 532 Global function 533 Global function CPXgetsolnpoolslack e eeeeeeeee esee eene eene eene nennen nnn nn nnn a nnns nennt nnn anten nnns 534 Global function CPXgettuningcallbackfunc eere esee eene 535 Global function GPXfclose idit 537 Global function 5 538 Global function
164. 526 Global function CPXNETdelarcs int CPXNETdelarcs CPXCENVptr env CPXNETptr net int begin int end Definition file cplex h The routine CPXNETdelarcs is used to remove a range of arcs from the network stored in a network problem object The remaining arcs are renumbered starting at zero their order is preserved If removing arcs disconnects some nodes from the rest of the network the disconnected nodes remain part of the network Any solution information stored in the problem object is lost Example status CPXNETdelarcs env net 10 20 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX net pointer to a CPLEX network problem object as returned by CPXNETcreateprob begin Index of the first arc to be deleted end Index of the last arc to be deleted Returns The routine returns zero on success and nonzero if an error occurs 527 Global function CPXgetcolname int CPXgetcolname CPXCENVptr env CPXCLPptr lp char name char namestore int storespace int surplus p int begin int end Definition file cplex h The routine CPXgetcolname accesses a range of column names or equivalently the variable names of a CPLEX problem object The beginning and end of the range along with the length of the array in which the column names are to be returned must be specified Note If the value of storespace is 0 the negative of the value of surplus p returned spe
165. A pointer to a CPLEX LP problem object as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 163 Global function CPXchgobj int CPXchgobj CPXCENVptr env CPXLPptr lp int cnt const int indices const double values Definition file cplex h The routine CPXchgob changes the linear objective coefficients of a set of variables in a CPLEX problem object Example status CPXchgobj env lp cnt indices values Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer that specifies the total number of objective coefficients to be changed and thus specifies the length of the arrays indices and values indices An array of length cnt containing the numeric indices of the columns corresponding to the variables for which objective coefficients are to be changed values An array of length cnt containing the new values of the objective coefficients of the variables specified in indices Returns The routine returns zero if successful and nonzero if an error occurs 164 Global function CPXpivotout int CPXpivotout CPXCENVptr env CPXLPptr lp const int clist int clen Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher
166. AILED centres taii Macro CPXERR TILIM CONDITION NO cnncta Macro CPXERR TILIM 5 ttt Macro CPXERR TOO COEFFS ettet ttt tnt tai Macro CPXERR TOO MANY COLS enenatis Macro CPXERR TOO 2 1441 Macro CPXERR TOO 6 Macro CPXERR TOO ROWS eet Macro CPXERR TOO TTT 820 TT 828 834 E 839 Table of Contents Macro CPXERR TREE MEMORY LIMIT tnnt 847 Macro CPXERR UNIQUE 2 ttt 848 Macro UNSUPPORTED CONSTRAINT 849 Macro CPXERR UP BOUND REPEATS ettet 850 Macro CPXERR WORK FILE 4 2 851 Macro CPXERR WORK FILE ttt 852 Macro CPXERR WORK FILE WRITE entente ttt ttt ttt 853 Macro CPXERR ttt ttt 854 Macro CPXMIP_ABORT_FEAS cccsssssssssssssssssss
167. ATA Definition file cplex h CPXERR NET DATA 1530 Inconsistent network file Check the NET format file for errors 721 Macro CPXERR NET FILE SHORT Definition file cplex h CPXERR NET FILE SHORT 1538 Unexpected end of network file Check the NET format file for errors 722 Macro CPXERR NO BARRIER SOLN Definition file cplex h CPXERR NO BARRIER SOLN 1223 No barrier solution exists The requested operation requires the existence of a barrier solution 723 Macro CPXERR NO BASIC SOLN Definition file cplex h CPXERR NO BASIC SOLN 1261 No basic solution exists The requested operation requires the existence of a basic solution Apply primal or dual simplex or crossover 724 Macro CPXERR BASIS Definition file cplex h CPXERR NO BASIS 1262 No basis exists The requested operation requires the existence of a basis 725 Macro CPXERR NO BOUND SENSE Definition file cplex h CPXERR NO BOUND SENSE 1621 Line No bound sense The sense marker is missing from the specified line 726 Macro NO BOUND TYPE Definition file cplex h CPXERR NO BOUND TYPE 1460 Line 96d Bound type missing No bound type could be found for the specified column bound on the specified line Check the MPS file 727 Macro CPXERR NO COLUMNS SECTION Definition file cplex h CPXERR NO COLUMNS SECTION 1472 Line 96d No COLUMNS section The required COLUMNS section is missing from the MPS file Check the fil
168. BACK MIP BRANCH CPX CALLBACK MIP INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT Example status CPXgetcallbacknodeub env cbdata wherefrom ub 0 cols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback ub An array to receive the values of the upper bound values This array must be of length at least end begin 1 If successful ub 0 through ub end begin contain the upper bound values for the current subproblem begin An integer specifying the beginning of the range of upper bound values to be returned end An integer specifying the end of the range of upper bound values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 96 Global function CPXnewcols int CPXnewcols CPXCENVptr env CPXLPptr lp int ccnt const double obj const double 1b const double ub const char xctype char colname Definition file cplex h The routine CPXnewcols adds empty columns to a specified CPLEX problem object This r
169. BENT CALLBACK NODE CALLBACK HEURISTIC CALLBACK SOLVE CPX CALLBACK CUT Example Status CPXgetcallbacklp env cbdata wherefrom amp origlp See also admipexl c admipex2 c and admipex3 c the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback lp p A pointer to a variable of type CPXLPptr to receive the pointer to the LP problem object which is a MIP 334 Returns The routine returns zero if successful and nonzero if an error occurs 335 Global function CPXNETbasewrite int CPXNETbasewrite CPXCENVptr env CPXCNETptr net const char filename str Definition file cplex h The routine CPXNETbasewrite writes the current basis stored in a network problem object to a file in BAS format If no arc or node names are available for the problem object default names are used Example status CPXNETbasewrite env net netbasis bas Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network probl
170. CPXERR SIGNS nennen treten tente tte treten tentes essa sesso Macro CPXERR 00110111 Macro CPXERR INDEX Macro CPXERR ARRAY BAD SOS 2 4 424 Macro CPXERR ARRAY 21 Macro CPXERR ARRAY LONG tette tests Macro CPXERR BAD Macro CPXERR BAD BOUND 5 entrent ttn tentent tattoo sons Macro CPXERR BAD BOUND TYPE Macro CPXERR BAD nosse sse sos Macro CPXERR BAD Macro CPXERR BAD ocu NE 618 EET 638 xix Table of Contents Macro CPXERR BAD EXPO 4 644 Macro CPXERR BAD 645 Macro oet cde und ees eaters M E E e Ed 646 Macro CPXERR BAD IDs d eec toties etm sue LE D DL M M DD C Md 647 Macro CPXERR BAD INDCONSTR ennt 648 Macro CPXERR BAD
171. DEX ttt 699 Macro CPXERR INDEX 700 Macro CPXERR INDEX RANGE 701 Table of Contents Macro CPXERR INDEX RANGE LOW nennen Macro CPXERR INT BIG eene ttt tatit Macro CPXERR INT TOO BIG INPUT ennt Macro CPXERR INVALID Macro CPXERR LIMITS TOO ttt tnt Macro CPXERR LINE TOO LONQG ennt Macro CPXERR LO BOUND Macro CPXERR LP NOT IN Macro CPXERR MIPSEARCH WITH Macro CPXERR MISS SOS TYPE ttt ttt ttt ttt ttt asta Macro CPXERR MSG NO CHANNEL ttt tatnen ttt tassa Macro CPXERR MSG NO FILEPTR ecenntttnntttnttttn ttt ttt tnt ttt asta Macro CPXERR MSG NO Macro CPXERR_NAME_CREATIONL u ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssseesssseesseseesees Macro CPXERR NAME NOT FOUND ttt Macro CPXERR NAME TOO LONQG
172. E PRIMALONLY 1 of CPX PREREDUCE DUALONLY 2 so the routine CPX reepresolve can be used to free it manually Example status CPXfreepresolve env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 265 Global function CPXgetindconstrinfeas int CPXgetindconstrinfeas CPXCENVptr env CPXCLPptr lp const double x double infeasout int begin int end Definition file cplex h The routine CPXgetindconstrinfeas computes the infeasibility of a given solution for a range of indicator constraints The beginning and end of the range must be specified For each constraint the infeasibility value returned is 0 zero if the constraint is satisfied In particular the infeasibility value returned is 0 zero if the indicator constraint is not active in the queried solution Otherwise the infeasibility value returned is the amount by which the righthand side of the linear portion of the constraint must be changed to make the queried solution valid It is positive for a less than or equal to constraint negative for a greater than or equal to constraint and can be of any sign for an equality constraint Example status CPXgetindconstrinfeas env lp NULL infeasout 0 CPXgetnumindcons
173. E ae Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX pointer to CPLEX problem object as returned by CPXcreateprob ftype p The filter type either diversity or range filter which The index of the filter Returns The routine returns zero if successful and nonzero if an error occurs 176 Global function CPXcheckcopyqpsep int CPXcheckcopyqpsep CPXCENVptr env CPXCLPptr lp const double qsepvec Definition file cplex h The routine CPXcheckcopyapsep validates the argument of the corresponding routine This data checking routine is found in source format in the file check c provided with the standard CPLEX distribution To call this routine you must compile and link check c with your program as well as the CPLEX Callable Library The routine CPXcheckcopyapsep has the same argument list as CPXcopyqpsep The second argument 1p is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the model For most user applications this distinction is unimportant Example Status CPXcheckcopyqpsep env lp qsepvec Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 177 Global function CPXcheckaddcols int CPXcheckaddcols CPXCENVptr env CPXCLPptr lp int ccnt int nzcnt const double obj const int cmatbeg
174. ENT CALLBACK NODE CALLBACK HEURISTIC CALLBACK CUT Integer feasibility status information for a node of the subproblem CPX INTEG ASIBLE 0 variable j begin is integer valued ER FF CPX INTEGER INFEASIBLE 1 variable j begin is not integer valued variable j begin may have a fractional value in the current solution CPX IMPLIED INTEGER FEASIBLE 2 butit will take on an integer value when all integer variables still in the problem have integer values It should not be branched upon Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback feas An array to receive integer feasibility information for the node subproblem This array must be of length at least end begin 1 If successful feas 0 through feas end begin will contain the integer feasibility information Possible return values appear in the table begin An integer specifying the beginning of the range of integer feasibility information to be returned end An integer specifying the end of the range of intege
175. ERR QUAD EXP 2 ttt Macro CPXERR QUAD ttt ttt tat nsi Macro CPXERR RANGE SECTION Macro CPXERR RESTRICTED VERSION ener ttt Macro CPXERR RHS OBL ttt ttt ttt ttt tates ttai Macro CPXERR RIM REPEATS eene Macro CPXERR_RIM_ROW_REPEATS sssssssssssssssssssssssssssssssssssssssessssssssssesssssneesssssesssssees Macro CPXERR RIMNZ REPEATS entente ttt ttt Macro CPXERR ROW INDEX RANGE ntn Macro CPXERR ROW REPEAT PRINT entrent tnt tsi Macro CPXERR_ROW_REPEATS scssssssssssssssssssssssssssssssssssssssstsssssseessssssssssesssssneesssueesssssees Macro ROW ttt ttt Macro CPXERR SAV FILE DATA Macro CPXERR SAV FILE WhRITE centenis taii Macro CPXERR SBASE ILLEGAL tnter ttt ttt hsii Macro CPXERR_SBASE_INCOMPAT sscsssssssssssssssssssssssssssssssssssssstsssssssssssstsssssseesssssesssasees Macro CPXERR_SINGULAR Q w ssssssssssssssssssssssssssssssssssssssssssssssssssssssseesssssesssstsssssseessssieessssees Macro CPXERR STR TOO 2 441 ttt taii Macro CPXERR SUBPROB SOLVE Macro CPXERR THREAD F
176. Example status CPXinfodblparam env CPX PARAM TILIM amp default tilim amp min tilim amp max tilim Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter value to be obtained defvalue p A pointer to a variable of type double to hold the default value of the CPLEX parameter May be NULL minvalue p A pointer to a variable of type double to hold the minimum value of the CPLEX parameter May be NULL maxvalue p A pointer to a variable of type double to hold the maximum value of the CPLEX parameter be NULL Returns The routine returns zero if successful and nonzero if an error occurs 515 Global function CPXreadcopybase int CPXreadcopybase CPXCENVptr env CPXLPptr lp const char filename str Definition file cplex h The routine CPXreadcopybase reads a basis from a BAS file and copies that basis into a CPLEX problem object The parameter PARAM ADVIND must be set to 1 one its default value or 2 two in order for the basis to be used for starting a subsequent optimization Example Status CPXreadcopybase env lp myprob bas Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str The name of the file from which the basis should be read Returns The routine returns zero if s
177. FIXEDMILP See Also CPXchgprobtype Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob type An integer specifying the target problem type soln An integer specifying the index of the solution pool member whose values are to be used A value of 1 specifies that the incumbent solution should be used instead of a solution pool member Returns The routine returns zero if successful and nonzero if an error occurs 445 Global function CPXgetnodecallbackfunc void CPXgetnodecallbackfunc CPXCENVptr env int CPXPUBLIC nodecallback_p CALLBACK_NODE_ARGS void cbhandle_p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetnodecallbackfunc accesses the user written callback to be called during optimization after CPLEX has selected a node to explore but before this exploration is carried out The callback routine can change the node selected by CPLEX to a node selected by the user For documentation of callback arguments see the ro
178. For this function to succeed a solution must exist for the problem object If the solution is not feasible CPXNETsolninfo returns 0 in argument pfeasind p the reduced costs are computed with respect to an objective function that penalizes infeasibilities Example status CPXNETgetdj env net dj 10 20 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob dj Array in which to write requested reduced costs If NULL is passed no reduced cost values are returned Otherwise 43 must point to an array of size at least end begin 1 begin Index of the first arc for which a reduced cost value is to be obtained end Index of the last arc for which a reduced cost value is to be obtained Example status CPXNETgetdj env net dj 10 20 Returns The routine returns zero on success and nonzero if an error occurs 152 Global function CPXdjfrompi int CPXdjfrompi CPXCENVptr env CPXCLPptr lp const double pi double dj Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callab
179. IBM ILOG CPLEX Callable Library version 12 1 C API Reference Manual 2009 Copyright International Business Machines Corporation 1987 2009 US Government Users Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp IBM the IBM logo ibm com WebSphere ILOG the ILOG design and CPLEX are trademarks or registered trademarks of International Business Machines Corp registered in many jurisdictions worldwide Other product and service names might be trademarks of IBM or other companies A current list of IBM trademarks is available on the Web at Copyright and trademark information at http www ibm com legal copytrade shtml Adobe the Adobe logo PostScript and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and or other countries Linux is a registered trademark of Linus Torvalds in the United States other countries or both Java and all Java based marks are trademarks of Sun Microsystems Inc in the United States other countries or both Microsoft Windows Windows NT and the Windows logo are trademarks of Microsoft Corporation in the United States other countries or both All other brand product and company names are trademarks or registered trademarks of their respective holders Table of Contents Abo t This MaNi m 1
180. IDUAL Definition file cplex h CPX MAX PRIMAL RESIDUAL Concert Technology enum MaxPrimalResidual Numeric meaning double To access the maximum of the vector Ax b for the unscaled problem Integer meaning To access the lowest index where the maximum primal residual occurs for the unscaled problem Can use a supplied primal solution 556 Macro CPX QCPRIMAL RESIDUAL Definition file cplex h MAX RESIDUAL Concert Technology enum MaxPrimalResidual Numeric meaning double To access the maximum residual f overall the quadratic constraints in the unscaled problem Integer meaning To access the lowest index over all the quadratic constraints where the maximum residual occurs in the unscaled problem Concert Technology does not distinguish quadratic constraints from linear constraints in this respect 557 Macro QCSLACK Definition file cplex h CPX MAX QCSLACK Concert Technology enum not applicable Numeric meaning doub1e To access the maximum absolute quadratic constraint slack value Integer meaning To access the lowest index of the quadratic constraints where the maximum quadratic constraint slack values occcurs Can use a supplied primal solution Concert Technology does not distinguish quadratic constraints from linear constraints in this respect 558 Macro CPX QCSLACK INFEAS Definition file cplex h CPX MAX QCSLACK INFEAS
181. ILE DATA 1561 Not enough data in SAV file The file is corrupted or was generated by an incompatible version of the software 831 Macro CPXERR SAV FILE WRITE Definition file cplex h CPXERR SAV FILE WRITE 1562 Unable to write SAV file to disk CPLEX could not open or write to the requested SAV file Check the file designation and disk space 832 Macro CPXERR SBASE ILLEGAL Definition file cplex h CPXERR SBASE ILLEGAL 1554 Superbases are not allowed Basis or restart file contains superbasis that cannot be read 833 Macro CPXERR SBASE Definition file cplex h CPXERR SBASE INCOMPAT 1255 Incompatible with superbasis The requested operation is incompatible with an existing superbasis 834 Macro CPXERR SINGULAR Definition file cplex h CPXERR SINGULAR 1256 Basis singular CPLEX cannot factor a singular basis See the discussion of numeric difficulties in the CPLEX User s Manual 835 Macro CPXERR STR PARAM TOO LONG Definition file cplex h CPXERR STR PARAM TOO LONG 1026 String parameter is too long Length of the string was greater than 510 836 Macro CPXERR SUBPROB SOLVE Definition file cplex h CPXERR SUBPROB SOLVE 3019 Failure to solve MIP subproblem CPXmipopt failed to solve one of the subproblems in the branch and cut tree This failure can be due to a limit for example an iteration limit or due to numeric trouble Check the log or add a call to CPXgetsubstat in
182. IMALORDUAL 0 atthe time of the presolve in order to add rows and preserve the presolved problem This routine should be used in place of CPXaddrows when you want to preserve the presolved problem The arguments of CPXpreaddrows are the same as those of CPXaddrows With the exception that new columns may not be added so there are no ccnt and colname arguments The new rows are added to both the original LP problem object and the associated presolved LP problem object Examples Status CPXpreaddrows env lp rcnt nzcnt rhs sense rmatbeg rmatind rmatval newrowname See also the example in the standard distribution Returns The routine returns zero if successful and nonzero if an error occurs 438 Global function CPXsolwrite int CPXsolwrite CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h The routine CPXsolwrite writes a solution file for the selected CPLEX problem object The routine writes files in SOL format which is an XML format The SOL format is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly Example Status CPXsolwrite env lp myfile sol See Also CPXsolwritesolnpool CPXsolwritesolnpoolall Parameters env A pointer to the CPLEX environment as returned by CPXop
183. INF t can minimize the weighted sum of the squared penalties of the relaxations denoted by QUAD This routine can also optionally perform a secondary optimizaton denoted by in the name of the option where it optimizes the original objective function over all possible relaxations for which the relaxation metric does not exceed the amount computed in the first phase These options are controlled by the parameter PARAM FEASOPTMODE Thus for example the value CPX FEASOPT MIN SUM denotes that CPXfeasopt should find a relaxation that minimizes the weighted sum of relaxations Similarly the value CPX INF specifies that CPXfeasopt should find a solution that optimizes the original objective function choosing from among all possible relaxations that minimize the number of relaxed constraints and bounds If you use INF mode the resulting feasopt problems will be MIPs even if your problem is continuous Similarly if you use QUAD mode the feasopt problems will become quadratic even if your original problem is linear This change in problem type can result in higher than expected solve times The user can specify preferences associated with relaxing a bound or righthand side value through input values of the rhs rng 1b and ub arguments The input value denotes the user s willingness to relax a constraint or bound More precisely the reciprocal of the specified preference is used to weight the
184. ION 1027 Decompression of unpresolved problem failed CPXERR DUP ENTRY 1222 Duplicate entry or entries CPXERR EXTRA BV BOUND Wm Line 96d BV bound type illegal when prior bound CPXERR EXTRA FR BOUND 1 Line d FR bound type illegal when prior bound CPXERR EXTRA FX BOUND Pm Line 96d FX bound type illegal when prior bound CPXERR EXTRA INTEND 1481 Line d INTEND found while not reading integers 1480 Line d INTORG found while reading integers 1483 Line d SOSEND found while not reading a SOS 1482 Line 96d SOSORG found while reading SOS 1422 Could not open file 925 for writing CPXERR FILE ENTRIES 1553 Line 96d Wrong number of entries 1 10 4 FILE FORMAT 1563 File s has an incompatible format Try setting reverse flag CPXERR FILTER VARIABLE TYPE 3414 Diversity filter has non binary variable s 52 CPXERR INDEX RANGE 1200 Index is outside range of valid values CPXERR INDEX RANGE HIGH 1206 96s end value d is greater than d CPXERR INDEX RANGE LOW CPXERR INT TOO BIG CPXERR INT TOO BIG INPUT CPXERR INVALID NUMBER CPXERR LIMITS TOO BIG CPXERR LINE TOO LONG CPXERR LO BOUND REPEATS CPXERR ENVIRONMENT CPXERR MIPSEARCH WITH CALLBACKS CPXERR MISS SOS TYPE 1205 96s begin value d is less than d 3018 Magnitude of variable 96s 0 exceeds integer limit 1805 dynamic search incompatible with control callbacks
185. L CPXERR PRESLV ABORT CPXERR PRESLV BAD PARAM CPXERR PRESLV BASIS MEM 3007 Illegal direction entry d CPXERR_PRESLV_COPYORDER CPXERR_PRESLV_COPYSOS CPXERR_PRESLV_CRUSHFORM CPXERR_PRESLV_DUAL CPXERR_PRESLV_FAIL_BASIS CPXERR_PRESLV_INF CPXERR_PRESLV_INForUNBD CPXERR_PRESLV_NO_BASIS CPXERR_PRESLV_NO_PROB CPXERR_PRESLV_SOLN_MIP CPXERR_PRESLV_SOLN_QP CPXERR_PRESLV_START_LP 1107 Not enough memory to build basis for original LP 1119 The feature is not available for solving dual formulation 1114 Could not load unpresolved basis for original LP 1117 Presolve determines problem is infeasible 1101 Presolve determines problem is infeasible or unbounded 1115 Failed to find basis in presolved LP 1103 No presolved problem created 1110 Not enough memory to recover solution for original MIP 1111 Not enough memory to compute solution to original QP CPXERR_PRESLV_TIME_LIM CPXERR_PRESLV_UNBD CPXERR_PRESLV_UNCRUSHFORM CPXERR_PRIIND CPXERR_PRM_DATA CPXERR_PRM_HEADER CPXERR_PTHREAD_CREATE 1123 Time limit exceeded during presolve CPXERR PTHREAD MUTEX INIT CPXERR Q DIVISOR CPXERR Q DUP ENTRY CPXERR Q NOT INDEF CPXERR Q NOT POS DEF CPXERR NOT SYMMETRIC CPXERR QCP SENSE CPXERR QCP SENSE FILE 3603 Could not create thread 55 CPXERR RANGE SECTION ORDER CPXERR RESTRICTED VERSION CPXERR RHS IN OBJ 1603 Line 96d RHS sense in objective CPXERR RIM REPEATS 1447 Line 96d 96s s repeats CPXERR RI
186. M ROW REPEATS CPXERR RIMNZ REPEATS 1479 Line 96d 96s 96s repeats CPXERR ROW INDEX RANGE CPXERR ROW REPEAT PRINT CPXERR ROW REPEATS CPXERR ROW UNKNOWN 1448 Line 96d s is not a row name CPXERR SAV FILE DATA 1561 Not enough data in SAV file CPXERR SBASE ILLEGAL CPXERR SBASE INCOMPAT CPXERR SINGULAR CPXERR STR PARAM LONG CPXERR SUBPROB SOLVE CPXERR THREAD FAILED CPXERR TIUM CONDITION NO CPXERR_TILIM_STRONGBRANCH CPXERR TOO MANY COEFFS CPXERR TOO MANY RIMNZ 1485 Too many rim nonzeros CPXERR CPXERR ROWS CPXERR TOO MANY THREADS CPXERR TREE MEMORY LIMIT CPXERR UNIQUE WEIGHTS CPXERR UNSUPPORTED CONSTRAINT TYPE 1212 Unsupported constraint type was used CPXERR UP BOUND REPEATS CPXERR WORK FILE OPEN CPXERR WORK FILE READ CPXERR WORK FILE WRITE 1803 Failure on temporary file write CPXERR XMLPARSE 1425 XML parsing error at line d 905 Each error code such as 1616 is associated with a symbolic constant such as CPXERR NO ID and a short message string such as Line d Expected identifier found c In the short message strings the following symbols occur means a number such as a line number 56 96s means a string such as file name variable name or other 9 6c means a character such as a letter or arithmetic operator Click the symbolic constant in the table to go to a longer explanation of an error code 57 Group optim cp
187. NFEASIBLE 103 MIP only enum Infeasible Solution is integer infeasible 866 Macro INForUNBD Definition file cplex h CPXMIP_INForUNBD 119 MIP only enum InfOrUnbd Problem has been proved either infeasible or unbounded 867 Macro CPXMIP FEAS Definition file cplex h CPXMIP MEM LIM FEAS 111 MIP only enum MemLimFeas Limit on tree memory has been reached but an integer solution exists 868 Macro CPXMIP INFEAS Definition file cplex h CPXMIP MEM LIM INFEAS 112 MIP only enum MemLimlInfeas Limit on tree memory has been reached no integer solution 869 Macro CPXMIP NODE FEAS Definition file cplex h CPXMIP NODE LIM FEAS 105 MIP only enum NodeLimFeas Node limit has been exceeded but integer solution exists 870 Macro NODE INFEAS Definition file cplex h CPXMIP NODE LIM INFEAS 106 only enum NodeLimInfeas Node limit has been reached no integer solution 871 Macro OPTIMAL Definition file cplex h 101 only enum Optimal Optimal integer solution has been found 872 Macro CPXMIP OPTIMAL INFEAS Definition file cplex h CPXMIP OPTIMAL INFEAS 115 MIP only enum Optimallnfeas Problem is optimal with unscaled infeasibilities 873 Macro CPXMIP OPTIMAL POPULATED Definition file cplex h OPTIMAL POPULATED 129 MIP only enum OptimalPop
188. NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT Example status CPXgetcallbackincumbent env cbdata wherefrom bestx 0 cols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback x An array to receive the values of the incumbent best available integer solution This array must be of length at least end begin 1 If successful x 0 through x end begin contain the incumbent values begin An integer specifying the beginning of the range of incumbent values to be returned end An integer specifying the end of the range of incumbent values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 73 Global function CPXcopyquad int CPXcopyquad CPXCENVptr env CPXLPptr lp const int qmatbeg const int qmatcnt const int qmatind const double qmatval Definition file cplex h The routine CPXcopyquad is used to copy a quadratic objective matrix Q when Q is not diagonal The arguments qmatbeg qmatcnt qmatind and qmatval are used to specify the nonze
189. NVptr env CPXLPptr lp const double qsepvec Definition file cplex h The routine is used to copy the quadratic objective matrix for separable QP problem A separable QP problem is one where the coefficients of Q have no nonzero off diagonal elements Note CPLEX evaluates the corresponding objective with a factor of 0 5 in front of the quadratic objective term When you build or modify your model with this routine you can verify that the results are as you intended by calling CPXcheckcopyapsep during application development Example status CPXcopyqpsep env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob qsepvec An array of length CPXgetnumcols 1p qsepvec 0 qsepvec 1 numcols 1 should contain the quadratic coefficients of the separable quadratic objective Returns The routine returns zero on success and nonzero if an error occurs 219 Global function CPXNETchgsupply int CPXNETchgsupply CPXCENVptr env CPXNETptr net int cnt const int indices const double supply Definition file cplex h The routine CPXNETchgsupply is used to change supply values for a set of nodes in the network stored in network problem object Any solution information stored in the problem object is lost Example Status CPXNETch
190. P problem object is unbounded and if the diverging variable is a slack or ranged variable CPXget i jdiv returns the index of the corresponding row in idiv p Otherwise idiv pis setto 1 If one of the CPLEX simplex optimizers has concluded that the LP problem object is unbounded and if the diverging variable is a normal structural variable CPXgeti jdiv sets jdiv p to the index of that variable Otherwise jdiv pis set to 1 Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX LP problem object as returned by CPXcreateprob idiv p A pointer to an integer indexing the row of a diverging variable If one of the CPLEX simplex optimizers has concluded that the LP problem object is unbounded and if the diverging variable is a slack or ranged variable CPXget i jdiv returns the index of the corresponding row in idiv p Otherwise idiv pis set to 1 jdiv_p A pointer to an integer indexing the column of a diverging variable If one of the CPLEX simplex optimizers has concluded that the LP problem object is unbounded and if the diverging variable is a normal structural variable CPXget i jdiv sets jdiv p to the index of that variable Otherwise 3div pis set to 1 Returns The routine returns zero if successful and nonzero if an error occurs 331 Global function CPXcopynettolp int CPXcopynettolp CPXCENVptr env CPXLPptr lp CPXCNETptr net Definition fi
191. P start e Level CPX SOLVEMIP CPLEX solves a subMIP Level 4 CPX REPAIR CPLEX attempts to repair the MIP start if it is infeasible according to the parameter that sets the frequency to try to repair infeasible MIP start CPX PARAM REPAIRTRIES By default CPLEX expends effort at level CPX MIPSTART REPAIR 4 for the first MIP start and at level CPX MIPSTART CHECKFEAS 1 one for all other MIP starts The user may change that level of effort A user may specify a different level of effort for each MIP start for example differing levels of effort for a MIP start derived from the incumbent for a MIP start derived from a solution in the solution pool for a MIP start supplied by the user When partial MIP start is provided and the effort level is at level CPX MIPSTART SOLVEMIP or higher CPLEX tries to extend it to a complete solution by solving a MIP over the variables whose values are not specified in the start The parameter PARAM SUBMIPNODELIM controls the amount of effort CPLEX expends in trying to solve this secondary MIP If CPLEX is able to find a complete feasible solution that solution becomes the incumbent If the specified MIP start values are infeasible and the effort level is CPX MIPSTART REPAIR these values are retained for use in a subsequent repair heuristic See the description of the parameter PARAM REPAIRTRIES for more information about this repair heuristic
192. P start values are infeasible these values are retained for use in a subsequent repair heuristic See the description of the parameter PARAM REPAIRTRIES for more information about this repair heuristic This routine replaces any existing MIP start information in the problem Use the routine CPXchgmipstart to modify or extend an existing MIP start Example Status CPXcopymipstart env lp cnt indices values The parameter CPX PARAM ADVIND must be set to 1 its default value or 2 two in order for the MIP start to be used See Also CPXreadcopyorder CPXreadcopymipstart CPXchgmipstart CPXaddmipstarts CPXreadcopymipstart CPXchgmipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer giving the number of entries in the list indices An array of length cnt containing the numeric indices of the columns corresponding to the variables which are assigned starting values values An array of length cnt containing the values to be used for the starting integer solution The entry values j is the value assigned to the variable indices j An entry values j greater than or equal to INFBOUND specifies that no value is set for the variable indices j Returns The routine returns zero if successful and nonzero if an error occurs 150 Global function CPXcopyprotected int CPX
193. PLEX problem object as returned by CPXcreateprob lpstat pointer to an integer specifying the result of the optimization The specific values which 1pstat can take and their meanings are the same as the return values documented for CPXgetstat and are found in the group optim cplex statuscodes of this reference manual p A pointer to a double precision variable where the objective function value is to be stored x An array to receive the values of the variables for the problem The length of the array must be at least as great as the number of columns in the problem object If the solution was computed using the dual simplex optimizer and the solution is not feasible x values are calculated relative to the phase RHS used by CPXdualopt pi An array to receive the values of the dual variables for each of the constraints The length of the array must be at least as great as the number of rows in the problem object If the solution was computed using the primal simplex optimizer and the solution is not feasible pi values are calculated relative to the phase objective the infeasibility function slack array to receive the values of the slack or surplus variables for each of the constraints The length of the array must be at least as great as the number of rows in the problem object If the solution was computed by the dual simplex optimizer and the solution is not feasible slack values are calculated relative to the phas
194. PX BINARY make column indices j binary make column indices j general integer S make column indices j semi continuous N make column indices 5 semi integer Example status CPXchgctype env lp cnt indices ctype Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer that states the total number of types to be changed and thus specifies the length of the arrays indices and ctype indices An array containing the numeric indices of the columns corresponding to the variables the types of which are to be changed xctype An array containing characters that represent the new types for the columns specified in indices Possible values for ctype j appear in Table 1 Returns The routine returns zero if successful and nonzero if an error occurs 346 Global function CPXgetsosinfeas int CPXgetsosinfeas CPXCENVptr env CPXCLPptr lp const double x double infeasout int begin int end Definition file cplex h The routine CPXgetsosinfeas computes the infeasibility of a given solution for a range of special ordered sets 5055 The beginning and end of the range must be specified This routine checks whether the SOS type 1 or SOS type 2 condition is satisfied but it does not check for integer feasibility in the case of integer variables For each SO
195. PXENVptr env CPXFILEptr lfile Definition file cplex h The routine CPXsetlogfile modifies the log file to which messages from all four CPLEX defined channels are written Note A call to CPXset logfile is equivalent to directing output from the cpxresults cpxwarning cpxerror and cpxlog message channels to a single file Example status CPXsetlogfile env logfile Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ifile A CPXFILEptr to the log file This routine sets 1file to be the file pointer for the current log file A NULL pointer may be passed if no log file is desired NULL is the default value Before calling this routine obtain this pointer with a call to CPX open Returns The routine returns zero if successful and nonzero if an error occurs 169 Global function CPXgetprobtype int CPXgetprobtype CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetprobtype accesses the problem type that is currently stored in a CPLEX problem object Example probtype CPXgetprobtype env lp Return values Error no problem or environment lo Linear program no quadratic data or ct ype information stored Problem with ctype information EDMILP Problem with ct ype information integer variables fixed See Also CPXchgprobtype Parameters env A pointer to the CPLEX environment as returned by CPXope
196. PXNETgetnodename is used to obtain the names of a range of nodes in a network stored in a network problem object The beginning and end of the range along with the length of the array in which the node names are to be returned must be specified Example status CPXNETgetnodename env net nnames namestore namespc amp surplus 0 nnodes 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob nnames Where to copy pointers to node names stored in the namestore array The length of this array must be at least end begin 1 The pointer to the name of node i is returned in nnames i begin namestore Array of characters to which the specified node names are to be copied It may be NULL if namespc is 0 namespc Length of the namestore array surplus Pointer to an integer in which the difference between namespc and the number of characters required to store the requested names is returned A nonnegative value indicates that namespc was sufficient A negative value indicates that it was insufficient In that case CPXERR NEGATIVE SURPLUS is returned and the negative value of surplus p indicates the amount of insufficient space in the array namestore begin Index of the first node for which a name is to be obtained end Index of the last node for which a name is to be obtained Returns The
197. PXcreateprob env amp status myprob See also all the Callable Library examples except those pertaining to networks in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX status p A pointer to an integer used to return any error code produced by this routine probname str A character string that specifies the name of the problem being created Returns If successful CPXcreateprob returns a pointer that can be passed to other CPLEX routines to identify the problem object that is created If not successful a NULL pointer is returned and an error status is returned in the variable status p If the routine is successful status is 0 zero 476 Global function CPXmbasewrite int CPXmbasewrite CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h The routine CPXnbasewrite writes the most current basis associated with a CPLEX problem object to a file The file is saved in BAS format which corresponds to the industry standard MPS insert format for bases When CPXmbasewrite is invoked the current basis is written to a file This routine does not remove the basis from the problem object Example Status CPXmbasewrite env lp myprob bas Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX problem object as returned by CPXcreateprob filename str A character string conta
198. PXgetcallbacknodeobjval retrieves the objective value for the subproblem at the current node during MIP optimization from within a user written callback This routine may be called only when the value of the wheref rom argument is one of the following CALLBACK CALLBACK BRANCH CALLBACK INCUMBENT CALLBACK NODE CALLBACK HEURISTIC CALLBACK CUT Example status CPXgetcallbacknodeobjval env cbdata wherefrom amp objval See also admipex1 c admipex3 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback objval p A pointer to a variable of type double where the objective value of the node subproblem is to be stored Returns The routine returns zero if successful and nonzero if an error occurs 201 Global function CPXgetrowinfeas int CPXgetrowinfeas CPXCENVptr env CPXCLPptr lp const double x double infeasout int begin int end Definition file cplex h The routine CPXget rowinfeas computes the infeasibility of
199. PXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob j An integer that specifies the index of the column of the basis inverse to be computed x An array containing the j th column of Binv the inverse of the matrix B The array must be of length at least equal to the number of rows in the problem Returns The routine returns zero if successful and nonzero if an error occurs 325 Global function CPXgetcallbackgloballb int CPXgetcallbackgloballb CPXCENVptr env void cbdata int wherefrom double lb int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackgloballb retrieves the best known global lower bound values during optimization from within a user written callback The global lower bounds are tightened after a new incumbent is found so the values returned by CPXgetcallbacknodex may violate these bounds at nodes where new incumbents have been found The values are from the original problem if CPX PARAM MIPCBREDLIP is set to OFF otherwise they are from the presolved proble
200. Pptr as this routine will not modify the problem For most user applications this distinction is unimportant Example Status CPXcheckcopysos env lp numsos numsosnz sostype sosbeg sosind soswt sosname Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 72 Global function CPXgetcallbackincumbent int CPXgetcallbackincumbent CPXCENVptr env void cbdata int wherefrom double x int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackincumbent retrieves the incumbent values during MIP optimization from within a user written callback The values are from the original problem if CPX PARAM MIPCBREDLP is set to CPX OFF or if the routine is called from an informational callback Otherwise they are from the presolved problem This routine may be called only when the value of the wherefrom argument is one of the following CALLBACK CPX CALLBACK MIP BRANCH CALLBACK INCUMBENT CALLBACK
201. Pptr lp int mipstartindex int confnumrows p int 15 p Definition file cplex h The routine CPXrefinemipstartconflict refines a conflict in order to determine why a given MIP start is not feasible In other words this routine identifies a minimal conflict for the infeasibility of the linear constraints and bounds in a MIP start In order to analyze the infeasibility of a MIP start containing quadratic constraints indicator constraints or special ordered sets as well as linear contraints and bounds use the routine CPXrefinemipstartconflictext The given MIP start need not be complete that is it is not necessary to specify all the variables When this routine returns the value in con numrows p specifies the number of constraints participating in the conflict and the value in con numcols p specifies the number of variables participating in the conflict Use the routine CPXget conflict to determine which constraints and variables participate in the conflict Use the routine CPXclpwrite to write the conflict to a file This conflict is a submodel of the original model with the property that CPLEX cannot generate a solution from the chosen MIP start using the given level of effort and that removal of any constraint or bound in the conflict invalidates that property The parameters PARAM CUTUP CPX PARAM CUTLO CPX PARAM OBJULIM CPX PARAM OBJLLIM do not influence this routine If you want to study infeasi
202. R EXTRA SOSEND Definition file cplex h CPXERR EXTRA SOSEND 1483 Line SOSEND found while not reading SOS SOS markers are incorrectly positioned in the MPS file 689 Macro CPXERR EXTRA SOSORG Definition file cplex h CPXERR EXTRA SOSORG 1482 Line 96d SOSORG found while reading SOS SOS markers are incorrectly positioned in the MPS file 690 Macro CPXERR FAIL OPEN READ Definition file cplex h CPXERR FAIL OPEN READ 1423 Could not open file s for reading CPLEX could not read the specified file Check the file specification 691 Macro CPXERR FAIL OPEN WRITE Definition file cplex h CPXERR FAIL OPEN WRITE 1422 Could not open file s for writing CPLEX could not create the specified file Check the file specification 692 Macro CPXERR FILE ENTRIES Definition file cplex h CPXERR FILE ENTRIES 1553 Line d Wrong number of entries The BAS or VEC or FLT file contains a line with too many or too few entries 693 Macro CPXERR FILE FORMAT Definition file cplex h CPXERR FILE FORMAT 1563 File s has an incompatible format Try setting reverse flag When binary file that has been produced on a different computer system is being read reversing the setting of the byte order may allow reading 694 Macro CPXERR FILTER VARIABLE TYPE Definition file cplex h CPXERR FILTER VARIABLE TYPE 3414 Diversity filter has non binary variable s Only binary variables are allowed in dive
203. R PTHREAD CREATE 3603 Could not create thread An error occurred during a system call needed to initialize parallel MIP 810 Macro CPXERR PTHREAD MUTEX INIT Definition file cplex h CPXERR PTHREAD MUTEX INIT 3601 Could not initialize mutex An error occurred during a system call needed to initialize parallel MIP 811 Macro CPXERR Q DIVISOR Definition file cplex h CPXERR Q DIVISOR 1619 Line 96d Missing or incorrect divisor for Q terms Quadratic terms must be enclosed in square brackets and followed by a division sign with the divisor 2 that is 2 812 Macro CPXERR Q DUP ENTRY Definition file cplex h CPXERR Q DUP ENTRY 5011 Duplicate entry for pair s and s There are duplicate entries for the quadratic term 813 Macro CPXERR Q NOT INDEF Definition file cplex h CPXERR NOT INDEF 5014 Q is not indefinite Function requires that the Q matrix be indefinite 814 Macro CPXERR Q NOT POS DEF Definition file cplex h CPXERR Q NOT POS DEF 5002 Q in 96s is not positive semi definite The Q matrix associated with the quadratic objective or with a quadratic constraint must be positive semi definite for minimizations Check the appropriate quadratic term s 815 Macro CPXERR Q NOT SYMMETRIC Definition file cplex h CPXERR Q NOT SYMMETRIC 5012 Q is not symmetric The Q matrix must be symmetric Check off diagonal elements Look for either a missing or superfluous element 816 Macro
204. RAM TILIM as in standard optimization e Node limit PARAM NODELIM as in standard optimization e n the absence of other stopping criteria CPXpopulate stops when it cannot enumerate any more solutions In particular if the user specifies an objective tolerance with the relative or absolute solution pool gap parameters CPXpopulate stops if it cannot enumerate any more solutions within the specified objective tolerance However there may exist additional solutions that are feasible and if the user has specified an objective tolerance those feasible solutions may also satisfy this additional criterion For example there may be a great many solutions to a given problem with the same integer values but different values for continuous variables Depending on the setting of the solution pool intensity parameter PARAM SOLNPOOLINTENSITY CPXpopulate may or may not enumerate all possible solutions Consequently CPXpopulate may stop when it has enumerated only a subset of the solutions satisfying your criteria Successive calls to CPXpopulate create solutions that are stored in the solution pool However each call to CPXpopulate applies only to the subset of solutions created in the current call the call does not affect the solutions already in the pool In other words solutions in the pool are persistent The user may call this routine independently of any MIP optimization of a problem such as CPXmipopt In that c
205. RAM WORKDIR 851 Macro CPXERR WORK FILE READ Definition file cplex h CPXERR WORK FILE READ 1802 Failure on temporary file read CPLEX was unable to read a temporary file in the directory specified CPX PARAM WORKDIR 852 Macro CPXERR WORK FILE WRITE Definition file cplex h CPXERR WORK FILE WRITE 1803 Failure on temporary file write CPLEX was unable to write a temporary file in the directory specified PARAM WORKDIR 853 Macro CPXERR XMLPARSE Definition file cplex h CPXERR XMLPARSE 1425 XML parsing error at line 96d 965 The parser was unable to parse the input file Additional information about the reason is given in the message 854 Macro CPXMIP FEAS Definition file cplex h CPXMIP ABORT FEAS 113 MIP only enum AbortFeas Stopped but an integer solution exists 855 Macro INFEAS Definition file cplex h CPXMIP ABORT INFEAS 114 MIP only enum AbortInfeas Stopped no integer solution 856 Macro ABORT RELAXED Definition file cplex h CPXMIP ABORT RELAXED 126 MIP only enum AbortRelaxed This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method feasOpt when the algorithm terminates prematurely for example after reaching a limit This status means that a relaxed solution is available and can be queried 857 Macro FAIL FEAS Definition file cplex
206. S the infeasibility value returned is 0 zero if the SOS condition is satisfied and nonzero otherwise Example Status CPXgetsosinfeas env lp NULL infeasout 0 CPXgetnumsos env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob x The solution whose infeasibility is to be computed May be NULL in which case the resident solution is used infeasout An array to receive the infeasibility value for each of the special ordered sets This array must be of length at least end begin 1 begin An integer specifying the beginning of the range of special ordered sets whose infeasibility is to be returned Returns The routine returns zero if successful and nonzero if an error occurs 347 Global function CPXNETcreateprob CPXNETptr CPXNETcreateprob CPXENVptr env int status p const char name str Definition file cplex h The routine CPXNETcreateprob constructs a new network problem object The new object contains a minimization problem for a network with 0 zero nodes and 0 zero arcs Other network problem data can be copied to a network with one of the routines CPXNETaddnodes CPXNETaddarcs CPXNETcopynet CPXNETextract Of CPXNETreadcopyprob Example CPXNETptr net CPXNETcreateprob env amp status mynet See Also CPXNETaddnodes CPXNETaddarcs CPXNETcopynet CPXNETextract
207. SOLNPOOL FILTER RANGE Filter type filter on linear expression values If linear expression of solution does not fall within specified bounds it will be discarded from the pool 576 Macro SOLNPOOL Definition file cplex h CPX SOLNPOOL OBJ Solution replacement strategy when pool is full keep solutions with best objective value 577 Macro CPX STAT ABORT DUAL LIM Definition file cplex h CPX STAT ABORT DUAL OBJ LIM 22 Barrier only enum AbortDualObjLim Stopped due to a limit on the dual objective 578 Macro CPX STAT IT Definition file cplex h CPX STAT ABORT IT LIM 10 Simplex or Barrier enum AbortltLim Stopped due to limit on number of iterations 579 Macro CPX STAT Definition file cplex h CPX STAT ABORT OBJ LIM 12 Simplex or Barrier enum AbortObjLim Stopped due to an objective limit 580 Macro CPX STAT ABORT PRIM LIM Definition file cplex h CPX STAT ABORT PRIM OBJ LIM 21 Barrier only enum AbortPrimObjLim Stopped due to a limit on the primal objective 581 Macro CPX STAT ABORT TIME LIM Definition file cplex h CPX STAT ABORT TIME LIM 11 Simplex or Barrier enum AbortTimeLim Stopped due to a time limit 582 Macro CPX STAT ABORT USER Definition file cplex h CPX STAT ABORT USER 13 Simplex or Barrier enum AbortUser Stopped due to a request from the user 583 Macro CPX
208. STAT CONFLICT CONTRADICTION Definition file cplex h CPX STAT CONFLICT ABORT CONTRADICTION 32 conflict refiner enum ConflictAbortContradiction The conflict refiner concluded contradictory feasibility for the same set of constraints due to numeric problems A conflict is available but it is not minimal 584 Macro CPX STAT CONFLICT LIM Definition file cplex h CPX STAT CONFLICT ABORT IT LIM 34 conflict refiner enum ConflictAbortltL im The conflict refiner terminated because of an iteration limit A conflict is available but it is not minimal 585 Macro CPX STAT CONFLICT ABORT Definition file cplex h CPX STAT CONFLICT ABORT MEM LIM 37 conflict refiner enum ConflictAbortMemL The conflict refiner terminated because of a memory limit A conflict is available but it is not minimal 586 Macro CPX STAT CONFLICT ABORT NODE LIM Definition file cplex h CPX STAT CONFLICT ABORT NODE LIM 35 conflict refiner enum ConflictAbortNodeLim The conflict refiner terminated because of a node limit A conflict is available but it is not minimal 587 Macro CPX STAT CONFLICT LIM Definition file cplex h CPX STAT CONFLICT ABORT OBJ LIM 36 conflict refiner enum ConflictAbortObjLim The conflict refiner terminated because of an objective limit A conflict is available but it is not minimal 588 Macro CPX STAT CONFLICT ABORT TIME Definition fil
209. This array must be of length at least end begin 1 A value of 0 for any entry means that the corresponding row is not ranged begin An integer specifying the beginning of the set of rows for which RHS range coefficients are returned end integer specifying the end of the set of rows for which RHS range coefficients are returned Returns The routine returns zero if successful and nonzero if an error occurs 454 Global function CPXcloseCPLEX int CPXcloseCPLEX CPXENVptr env p Definition file cplex h This routine frees all of the data structures associated with CPLEX and releases the license It should be the last CPLEX routine called in any Callable Library application Example Status CPXcloseCPLEX amp env See also 1pex1 c in the CPLEX User s Manual Parameters env p A pointer to a variable holding the pointer to the CPLEX environment as returned by CPXopenCPLEX Returns The routine returns zero if successful and nonzero if an error occurs 455 Global function CPXgetnodeint int CPXgetnodeint CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnodeint accesses the node number of the best known integer solution Example nodeint CPXgetnodeint env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example nodeint CPXgetnodeint env 1 Ret
210. UADRAT quadratic constraint CPX CON INDICAT indicator constraint The parameters PARAM CUTUP CPX PARAM CPX PARAM OBJULIM CPX PARAM OBJLLIM do not influence this routine If you want to study infeasibilities introduced by those parameters consider adding an objective function constraint to your model to enforce their effect before you invoke this routine Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob grpcnt The number of constraint groups to be considered concnt An integer specifying the total number of indices passed in the array grpind equivalently the end of the last group in grpind grppref An array of preferences for the groups The value grppref i specifies the preference for the group 356 grpbeg grpind grptype designated by the index i A negative or zero value specifies that the corresponding group should not be relaxed An array of integers specifying where the constraint indices for each group begin in the array grpind Its length must be at least grpcnt An array of integers containing the constraint indices for the constraints as they appear in groups Group i contains the constraints with the indices gzpind grpbeg i grpind grpbeg i 1 1 for i less than grpcnt 1 and grpind grpbeg il l grpind concnt 1 fori grpocnt 1 lts length must be at
211. V FAIL BASIS Definition file cplex h CPXERR PRESLV FAIL BASIS 1114 Could not load unpresolved basis for original LP Most likely insufficient memory exists to complete the uncrushing of the presolved problem 796 Macro CPXERR PRESLV Definition file cplex h CPXERR PRESLV INF 1117 Presolve determines problem is infeasible The loaded problem contains blatant infeasibilities 797 Macro CPXERR PRESLV INForUNBD Definition file cplex h CPXERR_PRESLV_INForUNBD 1101 Presolve determines problem is infeasible or unbounded The loaded problem contains blatant infeasibilities or unboundedness 798 Macro CPXERR PRESLV BASIS Definition file cplex h CPXERR PRESLV NO BASIS 1115 Failed to find basis in presolved LP A basis could not be recovered during uncrushing most likely due to lack of memory 799 Macro CPXERR PRESLV NO PROB Definition file cplex h CPXERR PRESLV NO PROB 1103 No presolved problem created Most likely insufficient memory exists to complete the loading of the presolved problem 800 Macro CPXERR PRESLV SOLN Definition file cplex h CPXERR PRESLV SOLN MIP 1110 Not enough memory to recover solution for original MIP Most likely insufficient memory exists to complete the uncrushing of the presolved problem 801 Macro CPXERR PRESLV SOLN Definition file cplex h CPXERR PRESLV SOLN 1111 Not enough memory to compute solution to original QP Most likely insuffici
212. X environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX LP problem object as returned by CPXcreateprob cstat An array containing the basis status of the columns in the constraint matrix The length of the allocated array is at least the value returned by CPXgetnumcols rstat An array containing the basis status of the rows the constraint matrix The length of the allocated array is at least the value returned by CPXgetnumrows 263 dnorm An array containing the dual steepest edge norms The length of the allocated array is at least the value returned by CPXgetnumrows Returns The routine returns zero if successful and nonzero if an error occurs 264 Global function CPXfreepresolve int CPXfreepresolve CPXCENVptr env CPXLPptr lp Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPX reepresolve frees the presolved problem from the LP problem object Under the default setting of PARAM REDUCE the presolved problem is freed when an optimal solution is found It is not freed when PARAM REDUCE is set to PREREDUC
213. XPROB FIXEDMIQCP where bounds on integer variables are fixed to the values attained in the integer solution A mixed integer problem or its related fixed type can also be changed to a continuous problem LPCPXPROB Or CPXPROB QCP which causes existing ct ype values to be permanently discarded from the problem object The original mixed integer problem can be recovered from the fixed problem If the current problem type is CPXPROB FIXEDMILP CPXPROB FIXEDMIQP CPXPROB FIXEDMIQCP any calls to problem modification routines fail To modify the problem object the problem type should be changed to CPXPROB MILP CPXPROB MIQP CPXPROB MIQCP Changing a problem from a continuous type to a mixed integer type causes a ct ype array to be created such that all variables are considered continuous A problem of type CPXPROB_MILP CPXPROB MIQP or CPXPROB can be solved only by the routine CPXmipopt even if all of its variables are continuous A quadratic problem CPXPROB QCP Or CPXPROB MIQCP can be changed to linear program CPXPROB LP causing any existing quadratic information to be permanently discarded from the problem object Changing a problem from a linear program CPXPROB_LP or CPXPROB_MILP to a quadratic program CPXPROB QP Or CPXPROB MIQP causes an empty quadratic matrix to be created such that the problem is quadratic with th
214. Xcutcallbackaddlocal env cbdata wherefrom mynzcnt myrhs LS mycutind mycutval See Also CPXcutcallbackadd CPXgetcutcallbackfunc CPXsetcutcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value that reports where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback nzcnt An integer value that specifies the number of coefficients in the cut or equivalently the length of the arrays cutind and cutval rhs A double value that specifies the value of the righthand side of the cut sense An integer value that specifies the sense of the cut cutind An array containing the column indices of cut coefficients cutval An array containing the values of cut coefficients Returns The routine returns zero if successful and nonzero if an error occurs 114 Global function CPXgetnumsos int CPXgetnumsos CPXCENVptr env CPXCLPptr 1 Definition file cplex h The routine CPXgetnumsos accesses the number of special ordered sets SOS in a CPLEX problem object Example numsos CPXgetnumsos env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob
215. Xgetlb CPXgetlogfile CPXgetlpcallbackfunc CPXgetmethod CPXgetmipcallbackfunc CPXgetmipitcnt CPXgetmiprelgap CPXgetmipstart CPXgetmipstartindex CPXgetmipstartname CPXgetmipstarts CPXgetnetcallbackfunc CPXgetnodecnt CPXgetnodeint CPXgetnodeleftcnt CPXgetnumbin CPXgetnumcols CPXgetnumcuts CPXgetnumindconstrs CPXgetnumint CPXgetnummipstarts CPXgetnumnz CPXgetnumqconstrs CPXgetnumqpnz CPXgetnumquad CPXgetnumrows CPXgetnumsemicont 11 CPXgetnumsemiint CPXgetnumsos CPXgetobj CPXgetobjname CPXgetobjsen CPXgetobjval CPXgetorder CPXgetparamname CPXgetparamnum CPXgetparamtype CPXgetphase1 CPXgetprobname CPXgetprobtype CPXgetpsbont CPXgetqconstr CPXgetqconstrindex CPXgetqconstrinfeas CPXgetqconstrname CPXgetqconstrslack CPXgetqpcoef CPXgetquad CPXgetrhs CPXgetrngval CPXgetrowindex CPXgetrowinfeas CPXgetrowname CPXgetrows CPXgetsense CPXgetsiftitcnt CPXgetsiftphase1cnt CPXgetslack CPXgetsolnpooldblquality CPXgetsolnpooldivfilter CPXgetsolnpoolfilterindex CPXgetsolnpoolfiltername CPXgetsolnpoolfiltertype CPXgetsolnpoolintquality CPXgetsolnpoolmeanobjval CPXgetsolnpoolmipstart CPXgetsolnpoolnumfilters 12 CPXgetsolnpoolnummipstarts CPXgetsolnpoolnumreplaced CPXgetsolnpoolnumsolns CPXgetsolnpoolnumsolns CPXgetsolnpoolobjval CPXgetsolnpoolqconstrslack CPXgetsolnpoolrngfilter CPXgetsolnpoolslack CPXgetsolnpoolsolnindex CPXgetsol
216. able accessresults The routines in the CPLEX Callable Library to access results Function Summary CPXgetax CPXgetbaritcnt CPXgetbase CPXgetcolinfeas CPXgetcrossdexchcnt CPXgetcrossdpushcnt CPXgetcrosspexchcnt CPXgetcrossppushcnt CPXgetdj CPXgetdsbent CPXgetitcnt CPXgetmethod CPXgetobjval CPXgetphase1 cnt CPXgetpi CPXgetpsbont CPXgetrowinfeas CPXgetsiftitcnt CPXgetsiftphase1 cnt CPXgetslack CPXgetstat CPXgetstatstring CPXgetx CPXsolninfo CPXsolution Solution query routines are used to access information about the results of applying an optimization method to a problem object For MIP problem objects you can access variable and slack values Other values specific to MIPs are accessible through routines in the group optim cplex callable accessmipresults For LP and QP problem objects you can access the values of variables constraint slacks reduced costs and dual variables Additionally for an LP or QP problem object solved with a simplex method you can query the simplex basis Methods and routines are also available to retrieve other information about the optimization process such as the iteration count 20 Group optim cplex callable advanced The API of the advanced C routines of the CPLEX Callable Library CPXbinvrow CPXbranchcallbackbranchbds CPXbranchcallbackbranchconstraints CPXbranchcallbackbranchgeneral CPXbtran CPXfreepresolve CPXgetcallbackgloballb CPXgetcallbackindicatorinfo
217. ables Calling CPXcopy1p destroys any existing data associated with the problem object The routine CPXcopylp does not copy names The more comprehensive routine CPXcopylpwnames can be used in place of CPXcopylp to copy linear programs with associated names The arguments passed to define a linear program Since these arguments are copied into local arrays maintained by CPLEX the LP problem data passed via CPXcopylp may be modified or freed after the call to CPXcopylp without affecting the state of the CPLEX problem object Table 1 Values of objsense Table 2 Values of sense lt constraint sense 1 1 constraint sense i constraint R ranged constraint The arrays matbeg matcnt matind and matval are accessed as follows Suppose that CPLEX wants to access the entries in some column 3 These are assumed to be given by the array entries matval matbeg j matval matbeg j matcnt j 1 The corresponding row indices are matind matbeg j matind matbeg j matcnt j 1 Entries in mat ind are not required to be in row order Duplicate entries in mat ind within a single column are not allowed The length of the arrays matbeg and mat ind should be at least numcols The length of arrays matind and matval should be at least matbeg numcols 1 matcnt numcols 1 When you build or modify your problem with this routine you can verify that the results are as you intended by cal
218. ack return value A nonzero terminates the optimization Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata A pointer passed from the optimization routine to the user written callback function that identifies the problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo 350 wherefrom An integer value reporting from which optimization algorithm the user written callback function was called Possible values and their meaning appear in the table CPX CAL DISJCUT From disjunctive cuts cbhandle LBACK LBACK bm mem Gomon 109 LBACK 1 pointer to user private data as passed to CPXsetmipcallbackfunc See Also CPXgetcallbackinfo CPXsetlpcallbackfunc CPXsetnetcallbackfunc Returns The routine returns zero if successful and nonzero if an error occurs 351 Global function CPXNETreadcopyprob int CPXNETreadcopyprob CPXCENVptr env CPXNETptr net const char filename str Definition file cplex h The routine CPXNETreadcopyprob reads a network in the CPLEX net or DIMACS min format from a file and copies it to a network problem object Any existing network or solution data in the problem object is replaced Example status CPXNETreadcopyprob env net network net Parameters e
219. ackfunc env amp current callback amp current cbdata See also Advanced MIP Control Interface in the CPLEX User s Manual For documentation of callback arguments see the routine CPXsetsolvecallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX solvecallback p The address of the pointer to the current user written solve callback If no callback has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer See Also CPXgetcallbacknodelp CPXsetsolvecallbackfunc Returns This routine does not return a result 84 Global function CPXmdleave int CPXmdleave CPXCENVptr env CPXLPptr lp const int indices int cnt double downratio double upratio Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXndleave assumes that there is a resident optimal simplex basis and a resident LU factorization associated with this basis It takes as input a list of basic variables as specified by indices and cnt and returns values commonly known as Driebeek
220. ackseqinfo int CPXgetcallbackseqinfo CPXCENVptr env void cbdata int wherefrom int seqid int whichinfo void result p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackseqinfo accesses information about nodes during the MIP optimization from within user written callbacks This routine may be called only when the value of its wherefrom argument is CPX CALLBACK MIP NODE The information accessed from this routine can also be accessed with the routine CPXgetcallbacknodeinfo Nodes are not stored by sequence number but by node number so using the routine CPXgetcallbackseqinfo can be much more time consuming than using the routine CPXgetcallbacknodeinfo A typical use of this routine is to obtain the node number of a node for which the sequence number is known and then use that node number to select the node with the node callback Note This routine cannot retrieve information about nodes that have been moved to node files For more information about node files see the CPLEX User s Manual If the argument seqnum refers to a node in a node fi
221. acro CPXERR NO OP OR SENSE Definition file cplex h CPXERR NO OP OR SENSE 1608 Line 96d Expected or sense found c Some character other than a or operator as required appears on the specified line 748 Macro CPXERR OPERATOR Definition file cplex h CPXERR NO OPERATOR 1607 Line 96d Expected found c Some character other than or appears between variable names on the specified line 749 Macro CPXERR NO ORDER Definition file cplex h CPXERR NO ORDER 3016 No priority order exists The requested command cannot be executed because no priority order has been loaded 750 Macro CPXERR PROBLEM Definition file cplex h CPXERR NO PROBLEM 1009 No problem exists The requested command cannot be executed because no problem has been loaded 751 Macro CPXERR SECTION Definition file cplex h CPXERR NO SECTION 1461 Line d No QMATRIX section The required QMATRIX section for quadratic programs is missing from the QP file Check the file 752 Definition file cplex h CPXERR NO QP OPERATOR 1614 Line 96d Expected The or operator is missing from the QP term 753 Macro CPXERR QUAD EXP Definition file cplex h CPXERR NO QUAD EXP 1612 Line 96d Expected quadratic exponent An exponent of 2 is expected after the operator 754 Macro CPXERR RHS COEFF Def
222. adcopybase CPXreadcopymipstart CPXreadcopymipstarts CPXreadcopyorder CPXreadcopyparam CPXreadcopyprob CPXreadcopysol CPXreadcopysolnpoolfilters CPXrefineconflict CPXrefineconflictext CPXrefinemipstartconflict CPXrefinemipstartconflictext CPXrhssa CPXsetdblparam CPXsetdefaults CPXsetinfocallbackfunc CPXsetintparam CPXsetlogfile CPXsetlpcallbackfunc CPXsetmipcallbackfunc CPXsetnetcallbackfunc CPXsetstrparam CPXsetterminate CPXsettuningcallbackfunc 15 CPXsiftopt CPXsolninfo CPXsolution CPXsolwrite CPXsolwritesolnpool CPXsolwritesolnpoolall CPXstrlen CPXtuneparam CPXtuneparamprobset CPXversion CPXwritemipstarts CPXwriteparam CPXwriteprob For access to the routines of the Callable Library organized by their purpose see the Overview of the API or see the groups of optim cplex callable 16 Group optim cplex callable accessmipresults The routines in the CPLEX Callable Library to access MIP results Function Summary CPXgetbestobjval CPXgetcutoff CPXgetindconstrinfeas CPXgetindconstrslack CPXgetmipitcnt CPXgetmiprelgap CPXgetmipstart CPXgetmipstartindex CPXgetmipstartname CPXgetmipstarts CPXgetnodecnt CPXgetnodeint CPXgetnodeleftcnt CPXgetnumcuts CPXgetnummipstarts CPXgetsolnpoolmipstart CPXgetsolnpoolnummipstarts CPXgetsosinfeas CPXgetsubmethod CPXgetsubstat Solution query routines are used to access information about the results
223. ady resident in the CPLEX problem object 106 have names otherwise no names are associated with the variables If column names are passed to CPXaddcols but existing variables have no names assigned default names are created for them Returns The routine returns zero if successful and nonzero if an error occurs 107 Global function CPXkilldnorms void CPXkilldnorms CPXLPptr lp Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXkilldnorms deletes any dual steepest edge norms that have been retained relative to an active basis If the user believes that the values of these norms may be significantly in error and the setting of the parameter PARAM DPRIIND S CPX DPRIIND STEEP CPX DPRIIND FULLSTEEP calling CPXkilldnorms means that fresh dual steepest edge norms will be computed on the next call to CPXdualopt Parameters The pointer to a CPLEX LP problem object as returned by CPXcreateprob 108 Global function CPXdelsetsolnpoolsolns int CPXdelsetsolnpoolsolns CPXCENVptr env CPXLPptr lp int delstat
224. ages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead Advanced callback routines are not compatible with dynamic search 25 Group optim cplex callable analyzesolution The routines in the CPLEX Callable Library to analyze solutions CPXboundsa CPXclpwrite CPXfeasopt CPXfeasoptext CPXgetconflict Function Summary CPXgetconflictext CPXgetablquality CPXgetgrad CPXgetintquality CPXgetsolnpooldblquality CPXgetsolnpoolintquality CPXobjsa CPXgapindefcertificate CPXrefineconflict CPXrefineconflictext CPXrefinemipstartconflict CPXrefinemipstartconflictext CPXrhssa Solution analysis routines give further information about a solution As the solutions are computed with finite precision arithmetic there may be some numeric residuals the quality routines give information about what these numeric residuals are The sensitivity analysis routines give information about how the solution would change if some aspect of the problem is changed these routines require a simplex basis so they may be used only after a simplex optimization of an LP 26 Group optim cplex callable callbacks The CPLEX Callable Library routines for managing callbacks Function Summary CPXgetnetcallbackfunc CPXsetnetcallbackfunc CPXsettuningcallbackfunc These callback routines also known as interrupt routines make it possible for you to define your own functions an
225. ains more rows than are allowed 845 Macro CPXERR TOO MANY THREADS Definition file cplex h CPXERR TOO MANY THREADS 1020 Thread limit exceeded The maximum number of cloned threads has been exceeded 846 Macro CPXERR TREE MEMORY LIMIT Definition file cplex h CPXERR TREE MEMORY LIMIT 3413 Tree memory limit exceeded The reading of the tree file has stopped because the tree memory limit has been reached 847 Macro CPXERR UNIQUE WEIGHTS Definition file cplex h CPXERR UNIQUE WEIGHTS 3010 Set does not have unique weights SOS weights must be unique 848 Macro UNSUPPORTED CONSTRAINT TYPE Definition file cplex h CPXERR UNSUPPORTED CONSTRAINT TYPE 1212 Unsupported constraint type was used CPLEX was unable to use the specified constraint type or the constraint type identifier is invalid in a parameter passed to the routine CPXrefineconflictext Or CPXfeasoptext 849 Macro CPXERR UP BOUND REPEATS Definition file cplex h CPXERR UP BOUND REPEATS 1458 Line 96d Repeated upper bound The upper bound for a column is repeated within the problem file on the specified line Two individual upper bounds could exist Alternatively a PL bound and individual bound could be in conflict Check the MPS file 850 Macro CPXERR WORK FILE OPEN Definition file cplex h CPXERR WORK FILE OPEN 1801 Could not open temporary file CPLEX was unable to access a temporary file in the directory specified by PA
226. alled Possible values are NONE CPX ALG PRIMAL PX DUAL CPX BARRIER for LP CPX NONE should be used for MIP Returns The routine returns zero if successful and nonzero if an error occurs 484 Global function CPXreadcopysolnpoolfilters int CPXreadcopysolnpoolfilters CPXCENVptr env CPXLPptr lp const char filename str Definition file cplex h The routine CPXreadcopysolnpoolfilters reads solution pool filters from an FLT format file and copies the filters into a CPLEX problem object This operation replaces all existing filters previously associated with the CPLEX problem object This format is documented in the CPLEX File Formats Reference Manual Example status CPXreadcopysolnpoolfilters env lp myfilters flt See Also CPXfltwrite Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str The name of the file from which the filters should be read Returns The routine returns zero if successful and nonzero if an error occurs 485 Global function CPXcrushpi int CPXcrushpi CPXCENVptr env CPXCLPptr lp const double pi double prepi Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in
227. an error occurs See admipex6 c the CPLEX User s Manual 67 Global function CPXgetslack int CPXgetslack CPXCENVptr env CPXCLPptr lp double slack int begin int end Definition file cplex h The routine CPXgetslack accesses the slack values for a range of linear constraints The beginning and end of the range must be specified Except for ranged rows the slack values returned consist of the righthand side minus the row activity level For ranged rows the value returned is the row activity level minus the righthand side or equivalently the value of the internal structural variable that CPLEX creates to represent ranged rows Example Status CPXgetslack env lp slack 0 CPXgetnumrows env lp 1 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob slack An array to receive the values of the slack or surplus variables for each of the constraints This array must be of length at least end begin 1 If successful s1ack 0 through slack end begin contain the values of the slacks begin An integer specifying the beginning of the range of slack values to be returned end integer specifying the end of the range of slack values to be returned Example Status CPXgetslack env lp slack 0 CPXgetnumrows env lp 1 Returns The routine returns zero if successful and nonzero if an error occurs 68
228. an integer variable in which the requested quality value is to be stored what A symbolic constant specifying the quality value to be retrieved The possible quality values for a solution are listed in the group optim cplex solutionquality in the Callable Library Reference Manual Returns The routine returns zero if successful and nonzero if an error occurs 212 Global function CPXaddrows int CPXaddrows CPXC double rhs const double rmatval c ENVptr env CPXLPptr lp char sense har colname int cont const int rmatbeg char rowname Definition file cplex h int rent const int rmatind const const int nzcnt The routine CPXaddrows adds constraints to a specified CPLEX problem object This routine may be called any time after a call to CPXcreateprob When you add a ranged row CPXaddrows sets the corresponding range value to 0 zero Use the routine CPXchgrngval to change the range value Values of sense lt constraint constraint gt constraint ranged constraint When you build or modify your problem with this routine you can verify that t calling CPXcheckaddrows during application development he results are as you intended by Note The use of CPXaddrows as a way to add new columns is discouraged in favor of a direct call to CPXnewcols before calling CPXaddrows Example status CPXaddrows env lp ccnt rcnt n
229. anches Branch variables in terms of the original problem if the parameter PARAM is set to CPX OFF before the call to CPXmipopt that calls the callback Otherwise branch variables are in terms of the presolved problem Callback return value The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed from the optimization routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass it to the callback information routines wherefrom An integer value reporting where in the optimization this function was called It will have the value CPX CALLBACK MIP BRANCH cbhandle A pointer to user private data int type An integer that specifies the type of branch This table summarizes possible values Branch Types Returned from a User Written Branch Callback CPX TYPE VAR lo variable branch CPX TYPE 5051 SOS1 branch CPX TYPE SOS2 5052 branch CPX TYPE USER user defined 505 An integer that specifies the special ordered set SOS used for this branch A value 1 specifies that this branch is not an SOS type branch nodecnt An integer that specifies the number of nodes CPLEX will create from this branch Possible values are 0 zero or 1 0r 42 196 If the ar
230. aram CPXCENVptr env int whichparam int defvalue p int minvalue p int maxvalue p Definition file cplex h The routine CPXinfointparam obtains the default minimum and maximum values of a CPLEX parameter of type int The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example status CPXinfointparam env CPX PARAM PREIND amp default preind amp min preind amp max preind Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter for which the value is to be obtained defvalue p A pointer to an integer variable to hold the default value of the CPLEX parameter May be NULL minvalue p A pointer to an integer variable to hold the minimum value of the CPLEX parameter May be NULL maxvalue p A pointer to an integer variable to hold the maximum value of the CPLEX parameter May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 377 Global function int CPXprimopt CPXCENVptr env CPXLPptr lp Definition file cplex h The routine CPXprimopt may be used after a linear program has been created via a call to CPXcreateprob to find a solution to that problem using the primal simplex method When this function is called the CPLEX primal simplex algorithm attempts to optimize the specified problem T
231. are created before the change is made Example Status CPXchgname env lp c 10 10 Values of key change row name change column name See Also CPXdelnames Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob key A character to specify whether a row name or a column name should be changed Possible values appear in the table ij An integer that specifies the numeric index of the column or row whose name is to be changed newname Str A pointer to a character string containing the new name Returns The routine returns zero if successful and nonzero if an error occurs 504 Global function CPXpperwrite int CPXpperwrite CPXCENVptr env CPXLPptr lp const char filename str double epsilon Definition file cplex h When solving degenerate linear programs with the primal simplex method CPLEX may initiate a perturbation of the bounds of the problem in order to improve performance The routine CPXpperwrite writes a similarly perturbed problem to a binary SAV format file Example Status CPXpperwrite env lp myprob ppe epsilon Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the perturbed problem should be written
232. ariable indices of the entries of Linval May be NULL if 1inspace is 0 linval An array to contain the linear coefficients of the specified constraint May be NULL if 1inspace is 0 linspace An integer indicating the length of the arrays 1 and linval May be 0 linsurplus A pointer to an integer to contain the difference between 1inspace and the number of entries in each of the arrays 1inind and linval A nonnegative value of 1insurplus p indicates that the length of the arrays was sufficient A negative value indicates that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetqconstr returns the value CPXERR NEGATIVE SURPLUS and the negative value of 1insurplus p indicates the amount of insufficient space in the arrays May be NULL if 11nspace is 0 quadrow An array to contain the variable indices of the entries of quadval If the quadratic coefficients were stored in a matrix quadrow would give the row indexes of the quadratic terms May be NULL if quadspace is O quadcol An array to contain the variable indices of the entries of quadval If the quadratic coefficients were stored in a matrix quadcol would give the column indexes of the quadratic terms May be 487 NULL if quadspace is 0 quadval An array to contain the quadratic coefficients of the specified constraint May be NULL if quadspace is 0 quadspace An integer indicating the length of the arr
233. arts deletes a set of MIP starts Unlike the routine CPXdelmipstarts CPXdelsetmipstarts does not require the MIP starts to be in a contiguous range After the deletion occurs the remaining MIP starts are indexed consecutively starting at 0 and in the same order as before the deletion Note The delstat array must have at least CPXgetnummipstarts env lp elements Example Status CPXdelsetmipstarts env lp delstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob delstat An array specifying the MIP starts to be deleted The routine CPXdelsetmipstarts deletes each start i for which delstat i 1 The deletion of starts results in a renumbering of the remaining starts After termination delstat i is either 1 for starts that have been deleted or the new index number that has been assigned to the remaining MIP starts Returns The routine returns zero if successful and nonzero if an error occurs 292 Global function CPXgetprestat int CPXgetprestat CPXCENVptr env CPXCLPptr lp int prestat p int pcstat int prstat int ocstat int orstat Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavio
234. as installed The relaxation is minimal 596 Macro CPX STAT INFEASIBLE Definition file cplex h CPX STAT INFEASIBLE 3 Simplex or Barrier enum Infeasible Problem has been proven infeasible see the topic nterpreting Solution Quality in the CPLEX User s Manual for more details 597 Macro CPX STAT INForUNBD Definition file cplex h CPX STAT INFOrUNBD 4 Simplex or Barrier enum InfOrUnbd Problem has been proven either infeasible or unbounded see the topic Effect of Preprocessing on Feasibility in the CPLEX User s Manual for more detail 598 Macro CPX STAT NUM BEST Definition file cplex h CPX STAT NUM BEST 6 Simplex or Barrier enum NumBest Solution is available but not proved optimal due to numeric difficulties during optimization 599 Macro CPX STAT OPTIMAL Definition file cplex h CPX STAT OPTIMAL 1 Simplex or Barrier enum Optimal Optimal solution is available 600 Macro CPX STAT OPTIMAL FACE UNBOUNDED Definition file cplex h CPX STAT OPTIMAL FACE UNBOUNDED 20 Barrier only enum OptimalFaceUnbounded Model has an unbounded optimal face 601 Macro CPX STAT OPTIMAL INFEAS Definition file cplex h CPX STAT OPTIMAL INFEAS 5 Simplex or Barrier enum Optimallnfeas Optimal solution is available but with infeasibilities after unscaling 602 Macro CPX STAT OPTIMAL RELAXED Definition file cplex h CPX STAT OPTIMAL RELAXED INF 17 Simplex or Barrier enu
235. ase CPXpopulate carries out the first and second phase itself The user may also call CPXpopulate after CPXmipopt The activity of CPXmipopt constitutes the first phase of the populate algorithm CPXpopulate then re uses the information computed and stored by CPXmipopt and thus carries out only the second phase CPXpopulate does not try to generate multiple solutions for unbounded MIP problems As soon as the proof of unboundedness is obtained CPXpopulate stops Example status CPXpopulate env lp For more detail about populate see also the chapter titled Solution Pool Generating and Keeping Multiple Solutions in the CPLEX User s Manual Parameters 121 env pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to the CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 122 Global function CPXgetmipstart int CPXgetmipstart CPXCENVptr env CPXCLPptr lp int cnt p int indices double value int mipstartspace int surplus p Definition file cplex h This routine is deprecated Use CPXgetmipstarts instead The routine CPXgetmipstart accesses information about the incumbent MIP start stored in a CPLEX problem object Values are returned for all integer binary semi continuous and nonzero SOS variables Note If the value of mipstartspace is 0 zero then the negative of the value of surplus p r
236. asic associated slack variable nonbasic at its upper bound Example Status CPXcopypartialbase env lp ccnt colind colstat rcnt rowind rowstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob ccnt An integer that specifies the number of variable or column status values specified and is the length of the cindices and cstat arrays cindices An array of length ccnt that contains the indices of the variables for which status values are being specified cstat An array of length ccnt where the ith entry contains the status for variable cindices i rcnt An integer that specifies the number of slack surplus or artificial status values specified and is the length of the rindices and rstat arrays rindices An array of length rcnt that contains the indices of the slack surplus or artificial variables for which status values are being specified rstat An array of length rcnt where the i th entry contains the status for slack surplus or artificial i For rows other than ranged rows the array element rstat i has the meaning summarized in Table 2 For ranged rows the array element rstat i has the meaning summarized 167 3 Returns The routine returns zero if successful and nonzero if an error occurs 168 Global function CPXsetlogfile int CPXsetlogfile C
237. asic row j An integer specifying the index of a basic column CPXgetijrow must find the position of this basic column in the basis header A negative value in this argument specifies to CPXget i jrow not to seek a basic column row p A pointer to an integer specifying the position in the basis header of the row i or column 5 If CPXgetijrow encounters an error and if p is NULL p is set to 1 Returns The routine returns zero if successful and nonzero if an error occurs 540 Global function CPXchgcoef int CPXchgcoef CPXCENVptr env CPXLPptr lp int i int j double newvalue Definition file cplex h The routine CPXchgcoef changes a single coefficient in the constraint matrix linear objective coefficients righthand side or ranges of a CPLEX problem object The coefficient is specified by its coordinates in the constraint matrix When you change matrix coefficients from zero to nonzero values be sure that the corresponding row and column indices exist in the problem so that 1 lt i lt CPXgetnumrows env 2 lt j lt CPXgetnumcols env lp Example Status CPXchgcoef env lp 10 15 23 2 See Also CPXchgobj CPXchgrhs CPXchgrngval Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob An integer that specifies the numeric index of the row which the coefficient i
238. at specifies the number of string parameters to be fixed during tuning This specifies the length of the arrays strnum and strval An array containing the parameter numbers unique identifiers of the integer parameters which remain fixed May be NULL if sc rcnt is 0 zero An array containing the values for the parameters listed in st rnum be NULL if strent is 0 zero tunestat p A pointer to an integer to receive the tuning status Returns The routine returns zero if successful and nonzero if an error occurs 276 Global function CPXgetlpcallbackfunc int CPXgetlpcallbackfunc CPXCENVptr env int CPXPUBLIC callback p CPXCENVptr void int void void cbhandle p Definition file cplex h The routine CPXget lpcallbackfunc accesses the user written callback routine to be called after each iteration during the optimization of a continuous problem LP QP or QCP and also periodically during the CPLEX presolve algorithm Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the optimization Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata A pointer passed from the optimization routine to the user written callback function that identifies the LP problem being optimized The only purpose for
239. at the upper bound is part of the conflict Finally if both bounds are required in the conflict a MEMBER status is assigned to that variable The status values marked POSSIBLE specify that the corresponding constraints and variables in the conflict are possibly not required to produce a minimal conflict but the conflict refinement algorithm was not able to remove them before it terminated for example because it reached a time limit set by the user Example 404 Status CPXgetconflictext env lp grpstat 0 ngrp 1 See Also CPXrefineconflict CPXclpwrite Parameters env Ip confstat p rowind rowbdstat A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX A pointer to a CPLEX problem object as returned by CPXcreateprob A pointer to an integer used to return the status of the conflict An array to receive the list of the indices of the constraints that participate in the conflict The length of the array must not be less than the number of rows in the conflict If that number is not known use the total number of rows in the problem object instead An array to receive the conflict status of the rows Entry rowbdstat i gives the status of row rowind i The length of the array must not be less than the number of rows in the conflict If that number is not known use the number of rows in the problem object instead confnumrows p A pointer to an integer where the number of rows in the confl
240. atbeg qmatcnt qmatind qmatval Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob qmatbeg An array that with qmat cnt qmat ind and qmatval defines the quadratic coefficient matrix qmatcnt array that with qmatbeg qmat ind and qmatval defines the quadratic coefficient matrix qmatind An array that with qmatbeg qmatcnt and qmatval defines the quadratic coefficient matrix qmatval An array that with qmatbeg qmatcnt qmat ind defines the quadratic coefficient matrix The arrays qmatbeg and qmatcnt should be of length at least CPXgetnumcols env 1p The arrays qmatind and qmatval should be of length at least qmatbeg numcols 1 qmatcnt numcols 1 CPLEX requires only the nonzero coefficients grouped by column in the array qmatval The nonzero elements of every column must be stored in sequential locations in this array with qmatbeg j containing the index of the beginning of column j and gmat cnt j containing the number of entries in column j Note that the components of 74 qmatbeg must be in ascending order For each qmatind k indicates the column number of the corresponding coefficient qmat val k These arrays are accessed as explained above Returns The routine returns zero on success and nonzero if an error occurs 75 Global function int CPXNETgetphaselcnt CPXCENVpt
241. atbeg i 1 1 or from rmatbeg 1 tonzcnt 1 if i rcnt 1 Each entry rmatind i specifies the column index of the corresponding coefficient rmatval i All rows must be contiguous and rmatbeg 0 must be 0 userhandle A pointer to user private data that should be associated with the node created by this branch May 156 be NULL seqnum p A pointer to an integer that on return will contain the sequence number that CPLEX has assigned to the node created from this branch The sequence number may be used to select this node in later calls to the node callback Returns The routine returns zero if successful and nonzero if an error occurs 157 Global function CPXrefinemipstartconflictext int CPXrefinemipstartconflictext CPXCENVptr env CPXLPptr lp int mipstartindex int grpcnt int concnt const double grppref const int grpbeg const int grpind const char grptype Definition file cplex h The routine CPXrefinemipstartconflictext refines a conflict of a MIP start that may include quadratic constraints indicator constraints or special ordered sets as well as linear contraints and bounds In other words this routine extends CPXrefinemipstartconflict to MIP starts with indicator constraints quadratic constraints or special ordered sets SOSs and to situations where groups of constraints should be considered as a single constraint That is this routine identifies a minimal conflict for the infeasibility of the
242. ation gives insight into the smallest setting for the feasibility tolerance that would not cause the problem to terminate infeasibly Example Status CPXgetdblquality env lp amp max x CPX MAX X Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob quality p A pointer to a double variable in which the requested quality value is to be stored If an error occurs the quality value remains unchanged what A symbolic constant specifying the quality value to be retrieved The possible quality values for a solution are listed in the group optim cplex solutionquality in the Callable Library Reference Manual Returns The routine returns zero if successful and nonzero if an error occurs If an error occurs the quality value remains unchanged 81 Global function CPXsolninfo int CPXsolninfo CPXCENVptr env CPXCLPptr lp int solnmethod p int solntype p int pfeasind p int dfeasind p Definition file cplex h The routine CPXsolninfo accesses solution information produced by the routines e CPXlpopt e e CPXdualopt e CPXbaropt e CPXhybbaropt e CPXhybnetopt e CPXqpopt e CPXfeasopt or e CPXmipopt This information is maintained until the CPLEX problem object is freed by a call to CPX reeprob or until the solution is rendered invalid because of a call to one of the proble
243. ay be 0 surplus p A pointer to an integer to contain the difference between bufspace and the amount of memory required to store the indicator constraint name nonnegative value of surplus_p reports that the length of the array str was sufficient A negative value reports that the length of the array was insufficient and that the routine could not complete its task In this case CPXgetindconstrname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array str which An integer specifying the index of the indicator constraint for which the name is to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in the buf_str array to hold the indicator constraint name 333 Global function CPXgetcallbacklp int CPXgetcallbacklp CPXCENVptr env void cbdata int wherefrom CPXCLPptr 1 Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library ro
244. ay of length cnt containing the strings of the new variable names for the columns specified in indices Returns The routine returns zero if successful and nonzero if an error occurs 311 Global function CPXinfostrparam int CPXinfostrparam CPXCENVptr env int whichparam char defvalue str Definition file cplex h The routine CPXinfostrparam obtains the default value of a CPLEX string parameter Example Status CPXinfostrparam env CPX PARAM WORKDIR defdirname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter for which the default value is to be obtained defvalue str A pointer to a buffer of length at least STR PARAM to hold the default value of the CPLEX parameter Returns The routine returns zero if successful and nonzero if an error occurs 312 Global function CPXgetitcnt int CPXgetitcnt CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetitcnt accesses the total number of simplex iterations to solve an LP problem or the number of crossover iterations in the case that the barrier optimizer is used Example itcnt CPXgetitcnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If a solution exists CPXgetitcnt returns the total it
245. ays quadrow quadcol and quadval May be 0 quadsurplus p A pointer to an integer to contain the difference between quadspace and the number of entries in each of the arrays quadrow quadcol and quadval nonnegative value of quadsurplus p indicates that the length of the arrays was sufficient A negative value indicates that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetqconstr returns the value CPXERR NEGATIVE SURPLUS and the negative value of quadsurplus p indicates the amount of insufficient space in the arrays May be NULL if quadspace is O which An integer indicating which quadratic constraint to return Returns The routine returns zero on success and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS indicates that insufficient space was available in either the arrays 1inind and linval or quadrow quadcol and quadval to hold the nonzero coefficients 488 Global function 5 int CPXgetrows CPXCENVptr env CPXCLPptr lp int nzcnt p int rmatbeg int rmatind double rmatval int rmatspace int surplus p int begin int end Definition file cplex h The routine CPXgetrows accesses a range of rows of the constraint matrix not including the objective function nor the bound constraints on the variables of a CPLEX problem object The beginning and end of the range along with the length of the ar
246. back wherefrom An integer value that reports where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback nodeest A double that specifies the value of the node estimate for the node to be created with this branch The node estimate is used to select nodes from the branch and cut tree with certain values of the node selection parameter PARAM NODESEL varcnt An integer that specifies the number of bound changes that are specified in the arrays varind varlu and varbd varind Together with variu and varba this array defines the bound changes for the branch The entry varind i is the index for the variable varlu Together with varind and varba this array defines the bound changes for the branch The entry varlu i is one three possible values specifying which bound to change Those values appear in Table 1 296 varbd rcnt nzcnt rhs sense rmatbeg rmatind rmatval userhandle seqnum p Returns Together with varind and varlu this array defines the bound changes for the branch The entry varbd i specifies the new value of the bound An integer that specifies the number of constraints for the branch An integer that specifies the number of nonzero constraint coefficients for the branch This specifies the length of the arrays rmatind and rmatval An array of length rcnt containing the righthand side term for each constraint for t
247. back p The address of the pointer to the current user written incumbent callback If no callback has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer See Also CPXsetincumbentcallbackfunc Returns This routine does not return a result 173 Global function CPXNETgetitcnt int CPXNETgetitcnt CPXCENVptr env CPXCNETptr net Definition file cplex h The routine CPXNETgetitcnt accesses the total number of network simplex iterations for the most recent call to CPXNETprimopt for a network problem object Example itcnt CPXNETgetitcnt env net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns Returns the total number of network simplex iterations for the last call to CPXNETprimopt for a network problem object If CPXNETprimopt has not been called zero is returned If an error occurs 1 is returned and an error message is issued 174 Global function CPXchgrowname int CPXchgrowname CPXCENVptr env CPXLPptr lp int cnt const int indices char newname Definition file cplex h This routine changes the names of linear constraints in a CPLEX problem object If this routine is performed on a problem object with no constraint names default names are created before the change is made Example Status
248. backfunc CPXCENVptr env int CPXPUBLIC callback_p CPXCENVptr void int void void cbhandle_p Definition file cplex h The routine CPXgettuningcallbackfunc accesses the user written callback routine to be called before each trial run during the tuning process Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the tuning Callback arguments A pointer to the CPLEX environment that was passed into the associated tuning routine cbdata A pointer passed from the tuning routine to the user written callback function that contains information about the tuning process The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value specifying from which procedure the user written callback function was called This value will always be CPX CALLBACK TUNING for this callback cbhandle Pointer to user private data as passed to CPXsettuningcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX callback p The address of the pointer to the current user written callback function If no callback function has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer Example status CPXgettuningcallbackfunc env mycallback NULL
249. be NULL then the constraint will have no linear terms quadrow array that with quadcol and quadval defines the quadratic part of the quadratic constraint to be added quadcol array that with quadrow and quadval defines the quadratic part of the quadratic constraint to be added quadval array that with quadrow and quadco1l define the quadratic part of the constraint to be added The nonzero coefficients of the quadratic terms must be stored in sequential locations in the arrays quadrow quadcol and quadval from positions 0 to quadnzcnt 1 Each pair quadrow i quadcol i indicates the variable indices of the quadratic term and quadval i the corresponding coefficient Iname str The name of the constraint to be added May be NULL in which case the new constraint is assigned a default name if the quadratic constraints already resident in the CPLEX problem object have names otherwise no name is associated with the constraint Returns The routine returns zero on success and nonzero if an error occurs 492 493 Global function CPXgetcallbacknodelb int CPXgetcallbacknodelb CPXCENVptr env void cbdata int wherefrom double lb int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult t
250. because it does not incur the overhead of LP data structures This option is only available for the CPLEX Callable Library For more about formulating a problem in this way and applying the network optimizer in your application see this topic in the CPLEX User s Manual 36 Group optim cplex callable optimizers The routines in the CPLEX Callable Library to launch an optimizer Function Summary CPXbaropt CPXcleanup CPXdualopt CPXhybbaropt CPXhybnetopt CPXmipopt CPXNETprimopt CPXprimopt CPXqpopt CPXsiftopt After you have specified the problem by populating a problem object the problem can be optimized A default optimizer is provided for each problem type In most cases the default optimizer will solve your problem well but you may select a different optimizer that may suit your needs better for a particular model formulation Continuous LP and QP problem objects can be optimized with simplex or barrier optimizers Continuous QCP problem objects and the special case of second order cone programming SOCP problems can be optimized with the barrier optimizer only For MIP problem objects any appropriate continuous optimizer may be specified to solve the subproblems You can also specify a different optimizer for solving the root LP subproblem and for the LP subproblems that occur at the nodes of the branch and cut tree For more information about parameters and their settings see the CPLEX Parameters Refe
251. beg int arc int arcspace int surplus p int begin int end Definition file cplex h The routine CPXNETgetnodearcs is used to access the arc indices incident to a range of nodes in the network stored in a network problem object Example status CPXNETgetnodearcs env net amp arccnt arcbeg arc arcspace amp surplus begin end Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob arccnt p A pointer to an integer to contain the total number of arc indices returned in the array arc arcbeg An array that contain indices indicating where each of the requested arc lists start in array Specifically the list of arcs incident to node lt end consists of the entries in arc the range from arcbeg i begin to arcbeg i 1 begin 1 The list of arcs incident to node end consists of the entries in arc the range from arcbeg end begin to arccnt p 1 This array must have a length of at least end begin 1 arc An array that contain the arc indices for the arcs incident to the nodes in the specified range May be NULL if arcspace IS Zero arcspace An integer indicating the length of the array arc May be zero surplus_p A pointer to an integer to contain the difference between arcspace and the number of arcs incident to the nodes in the specified range A nonnegative value indica
252. beginning indices as explained soswt sosind An array stating indices as explained in soswt soswt Arrays declaring the indices and weights for the sets For every set the indices and weights must be stored in sequential locations in sosind and soswt respectively with sosbeg 4 containing the index of the beginning of set 5 The weights must be unique in their array lt numsos 1 the indices of set j must be stored in sosind sosbeg j sosind sosbeg j 1 1 and the weights in soswt sosbeg j soswt sosbeg j 1 1 Forthe last set j numsos 1 the indices must be stored in sosind sosbeg numsos 1 sosind numsosnz 1 and the corresponding weights in soswt sosbeg numsos 1 soswt numsosnz 1 Hence sosbeg must be of length at least numsos while sosind and soswt must be of length at least numsosnz sosname array containing pointers to character strings that represent the names of the 5055 May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 506 Global function CPXgetnetcallbackfunc int CPXgetnetcallbackfunc CPXCENVptr env int CPXPUBLIC callback p CPXCENVptr void int void void cbhandle p Definition file cplex h The CPXgetnetcallbackfunc accesses the user written callback routine to be called each time a log message is issued during the optimization of a network problem If the display log is turned off the callback routine is sti
253. ber of entries in each of the arrays rmat ind and rmatval A nonnegative value of surplus p specifies that the length of the arrays was sufficient A negative value specifies that the length was insufficient and that the routine could not complete its task In this case the routine CPXget rows returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays begin An integer specifying the beginning of the range of rows to be returned end An integer specifying the end of the range of rows to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the arrays rmat ind and rmatval to hold the nonzero coefficients 489 Global function CPXstrcpy CPXCHARptr CPXstrcpy char dest str const char sro str Definition file cplex h The routine CPXstrcpy copies strings It is exactly the same as the standard C library routine st rcpy This routine is provided so that strings passed to the message function routines see CPXaddfuncdest can be copied by languages that do not allow dereferencing of pointers for example older versions of Visual Basic Example CPXstrcpy p Parameters dest str A pointer to the string to hold the copy of the string pointed to by src str src str pointer to a string to be copied to dest s
254. ber of the SOS used in double objective value of LP subproblem branching 1 otherwise userhandle associated with the node upon its ERHANDLE v creation ENON i node index of the node only available for CPXgetcallbackseqinfo int sequence number of the node int int int int oid nt Symbolic Constant Branch Type PX TYPE C variable branch 5051 branch 5052 branch user defined multiple bound changes and or constraints were used for branching See also Advanced MIP Control Interface in the CPLEX User s Manual See Also CPXgetcallbackinfo CPXgetcallbackseqinfo Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback nodeindex The index of the node for which information is requested Nodes are indexed from 0 zero to nodecount 1 where nodecount is obtained from the callback information function CPXgetcallbackinfo with a whichinfo value of CALLBACK INFO NODES LEFT whichinfo An integer specifying which info
255. bilities introduced by those parameters consider adding an objective function constraint to your model to enforce their effect before you invoke this routine When the MIP start was added to the current model an effort level may have been associated with it to specify to CPLEX how much effort to expend in transforming the MIP start into a feasible solution This routine respects effort levels except level 1 one check feasibility It does not check feasibility Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob mipstartindex The index of the start among all the starts associated with the problem confnumrows p A pointer to an integer where the number of linear constraints in the conflict is returned confnumcols p pointer to an integer where the number of variable bounds in the conflict is returned Returns The routine returns zero if successful and nonzero if an error occurs 367 Global function CPXgetqconstrname int CPXgetqconstrname CPXCENVptr env CPXCLPptr lp char buf str int bufspace int surplus p int which Definition file cplex h The routine CPXgetqconstrname is used to access the name of a specified quadratic constraint of a CPLEX problem object Note If the value of bufspace is 0 then the negative of the value of surplus p returned indicates the total number of characters ne
256. bject Returns The routine returns zero if successful and nonzero if an error occurs 209 Global function CPXgetcrossppushcnt int CPXgetcrossppushent CPXCENVptr env CPXCLPptr 1 Definition file cplex h The routine CPXgetcrossppushocnt accesses the number of primal push iterations in the crossover method A push occurs when a nonbasic variable switches bounds and does not enter the basis Example itcnt CPXgetcrossppushcnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns the primal push iteration count if a solution exists If no solution exists it returns zero 210 Global function CPXrhssa int CPXrhssa CPXCENVptr env CPXCLPptr lp int begin int end double lower double upper Definition file cplex h The routine CPXrhssa accesses upper and lower sensitivity ranges for righthand side values of a range of constraints The beginning and end of the range of constraints must be specified Note Information for constraint j where begin lt j lt end is returned in position j begin ofthe arrays lower and upper The items 1ower j begin and upper j begin contain the lowest and highest value the righthand side value of constraint 5 can assume without affecting the optimality of the solution Example Status CPXrhssa env lp 0 CPXgetnumrow
257. bject as returned by CPXcreateprob Returns The routine returns the primal exchange iteration count if a solution exists If no solution exists it returns zero 287 Global function CPXNETgetlb int CPXNETgetlb CPXCENVptr env CPXCNETptr net double low int begin int end Definition file cplex h The routine CPXNETget 1b is used to access the lower capacity bounds for a range of arcs of the network stored in a network problem object Example Status CPXNETgetlb env net low 0 cur narcs 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob low Array in which to write the lower bound on the flow for the requested arcs If NULL is passed no lower bounds are retrieved Otherwise the size of the array must be end begin 1 begin Index of the first arc for which lower bounds are to be obtained end Index of the last arc for which lower bounds are to be obtained Returns The routine returns zero on success and nonzero if an error occurs 288 Global function CPXcompletelp int CPXcompletelp CPXCENVptr env CPXLPptr 1 Definition file cplex h The routine CPXcompletelp is provided to allow users to handle those rare cases where modification steps need to be closely managed for example when careful timings are desired for the individual steps in a user s solution process or more
258. bject as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 140 Global function CPXfreeprob int CPXfreeprob CPXCENVptr env CPXLPptr lp p Definition file cplex h The routine CPX reeprob removes the specified CPLEX problem object from the CPLEX environment and frees the associated memory used internally by CPLEX The routine is used when the user has no need for further access to the specified problem data Example Status CPXfreeprob env amp lp See also the example 1pex1 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp p A pointer to a CPLEX problem object as returned by CPXcreateprob Example Status CPXfreeprob env amp 1p See also the example 1pex1 c in the CPLEX User s Manual in the standard distribution Returns The routine returns zero if successful and nonzero if an error occurs 141 Global function CPXgetsiftitcnt int CPXgetsiftitcnt CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetsiftitcnt accesses the total number of sifting iterations to solve an LP problem Example itcnt CPXgetsiftitcnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX A pointer to a CPLEX LP problem object as returned by CPXcreateprob Returns The routine returns the to
259. ble Library to query network problem data The routines in the CPLEX Callable Library to query QCP problem data that is problems with one or more quadratic constraints including the special case of second order cone programming SOCP problems The routines in the CPLEX Callable Library to query QP problem data that is problems with a quadratic objective function optim cplex callable querynetwork optim cplex callable queryqcp optim cplex callable queryqp optim cplex callable writefiles The routines in the CPLEX Callable Library to write files optim cplex callable writenetworkfiles The routines in the CPLEX Callable Library to write network files The Callable Library macros that define error codes their symbolic constants their short message strings and their explanations There is a key to the symbols in the short message strings after the table optim cplex errorcodes The Callable Library macros that indicate the qualities of a solution optim cplex solutionquality their symbolic constants and their meaning Methods for accessing solution quality are mentioned after the table The Callable Library macros that define solution status their symbolic constants their equivalent in Concert Technology enumerations and their meaning There is a note about unboundedness after the table optim cplex solutionstatus What Are the CPLEX Component Libraries The CPLEX Component Libraries are designed to
260. bufspace is 0 then the negative of the value of surplus p returned specifies the total number of characters needed for the array str Example status CPXgetprobname env lp probname lenname amp surplus Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob buf str A pointer to a buffer of size bufspace May be NULL if bufspace is 0 bufspace An integer specifying the length of the array str May be 0 surplus p A pointer to an integer to contain the difference between bu space and the amount of memory required to store the problem name A nonnegative value of surplus p specifies that the length of the array buf_str was sufficient A negative value specifies that the length of the array was insufficient and that the routine could not complete its task In this case CPXgetprobname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus specifies the amount of insufficient space in the array str Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the buf_str array to hold the problem name 465 Global function CPXgetsolnpoolnumreplaced int CPXgetsolnpoolnumreplaced CPXCENVptr env CPXCLPptr lp Definition file cp
261. by CPLEX during MIP optimization after the subproblem has been solved to optimality That callback is not called when the subproblem is infeasible or cut off The callback supplies CPLEX with heuristically derived integer solutions Example CPXgetheuristiccallbackfunc env amp current callback amp current handle See also Advanced MIP Control Interface in the CPLEX User s Manual For documentation of callback arguments see the routine CPXsetheuristiccallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX heuristiccallback p The address of the pointer to the current user written heuristic callback If no callback has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer See Also CPXsetheuristiccallbackfunc Returns This routine does not return a result 522 Global function CPXcopylp int CPXcopylp CPXCENVptr env CPXLPptr lp int numcols int numrows int objsense const double objective const double rhs const char sense const int matbeg const int matcnt const int matind const double matval const double lb const double ub const double rngval Definition file cplex h The routine 1 copies data that define an LP problem to a CPLEX problem object The arguments to CPXcopy lp define an objective function the constraint matrix the righthand side and the bounds on the vari
262. caled problem Integer meaning To access the lowest index where the maximum dual residual occurs for the scaled problem 562 Macro CPX SCALED Definition file cplex h CPX MAX SCALED PI Concert Technology enum MaxScaledPi Numeric meaning doub1e To access the maximum absolute value in the dual solution vector for the scaled problem Integer meaning To access the lowest index where the maximum pi value occurs for the scaled problem 563 Macro CPX SCALED PRIMAL INFEAS Definition file cplex h CPX MAX SCALED PRIMAL INFEAS Concert Technology enum MaxScaledPrimallnfeas Numeric meaning double To access the maximum primal infeasibility or equivalently the maximum bound violation including slacks for the scaled problem Integer meaning To access the lowest index of a column or row where the maximum primal infeasibility occurs for the scaled problem Can use a supplied primal solution 564 Macro CPX MAX SCALED PRIMAL RESIDUAL Definition file cplex h CPX MAX SCALED PRIMAL RESIDUAL Concert Technology enum MaxScaledPrimalResidual Numeric meaning double To access the maximum of the vector for the scaled problem Integer meaning To access the lowest index where the maximum primal residual occurs for the scaled problem Can use a supplied primal solution 565 Macro MAX SCALED RED COST Definition file cplex h CPX MAX SCALED RED COST Concert Technolog
263. cator variable May be NULL complemented p A pointer to a Boolean value that specifies whether the indicator variable is complemented May be NULL nzcnt p A pointer to an integer to contain the number of nonzero values in the linear portion of the indicator constraint that is the true length of the arrays 1inind and linval rhs p A pointer to a double containing the righthand side value of the linear portion of the indicator constraint sense p A pointer to a character specifying the sense of the linear portion of the constraint Possible values are L for a lt constraint E for an constraint or G for a gt constraint linind An array to contain the variable indices of the entries of 1inval May be NULL if space is 0 zero linval An array to contain the coefficients of the linear portion of the specified indicator constraint May be NULL if space is O space An integer specifying the length of the arrays 1inind and linval May be 0 zero surplus p A pointer to an integer to contain the difference between space and the number of entries in each of the arrays 1inind and linval A nonnegative value of surplus p reports that the length of the arrays was sufficient A negative value reports that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetindconstr returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus specifies the amount of insufficient space in
264. ccess the sum of the elements of vector Ax b for the unscaled problem Integer meaning not applicable Can use a supplied primal solution 623 Macro CPX SUM SCALED RED COST Definition file cplex h CPX SUM SCALED RED COST Concert Technology enum SumScaledRedCost Numeric meaning double To access the sum of the absolute reduced cost values for the unscaled problem Integer meaning not applicable 624 Macro CPX SUM SCALED SLACK Definition file cplex h CPX SUM SCALED SLACK Concert Technology enum SumScaledSlack Numeric meaning doub1e To access the sum of the absolute slack values for the scaled problem Integer meaning not applicable Can use a supplied primal solution 625 Macro CPX SUM SCALED X Definition file cplex h CPX SUM SCALED X Concert Technology enum SumScaledX Numeric meaning double To access the sum of the absolute values in the primal solution vector for the scaled problem Integer meaning not applicable Can use a supplied primal solution 626 Macro CPX SUM SLACK Definition file cplex h CPX SUM SLACK Concert Technology enum SumSlack Numeric meaning doub1e To access the sum of the absolute slack values for the unscaled problem Integer meaning not applicable Can use a supplied primal solution 627 50 Definition file cplex h CPX SUM X Concert Technology enum SumX Numeric meaning double To access the sum of the ab
265. ces and indices bigger than or equal to CPXgetnumcols result in an error cnt An integer specifying the number of entries in indices lf cnt lt 0 an error is returned downratio An array of type double that must be of length at least cnt upratio array of type double that must be of length at least cnt Returns The routine returns zero if successful and nonzero if an error occurs 85 Global function CPXreadcopyorder int CPXreadcopyorder CPXCENVptr env CPXLPptr lp const char filename str Definition file cplex h The routine CPXreadcopyorder reads an ORD file and copies the priority order information into a CPLEX problem object The parameter CPX PARAM MIPORDIND must be set to CPX ON its default value in order for the priority order to be used for starting a subsequent optimization Example Status CPXreadcopyorder env lp myprob ord See Also CPXordwrite Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str The name of the file from which the priority order should be read Returns The routine returns zero if successful and nonzero if an error occurs 86 Global function int CPXcopyobjname CPXCENVptr env CPXLPptr lp const char objname str Definition file cplex h The routine CPXcopyob jname copies a name for the objective function into a CPLEX prob
266. cifies the total number of characters needed for the array namestore Example Status CPXgetcolname env lp cur colname cur colnamestore cur storespace amp surplus 0 cur numcols 1 See also the example 1pex7 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob name An array of pointers to the column names stored in the array namestore This array must be of length atleast end begin 1 The pointer to the name of column 3 is returned in name j begin namestore An array of characters where the specified column names are to be returned May be NULL if storespace is 0 storespace An integer specifying the length of the array namestore May be O surplus A pointer to an integer to contain the difference between storespace and the total amount of memory required to store the requested names A nonnegative value of surplus p specifies that storespace Was sufficient A negative value specifies that it was insufficient and that the routine could not complete its task In that case CPXgetcolname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array namestore begin An integer specifying the beginning of the range of column names to be returned end An
267. const int cmatind const double cmatval const double lb const double ub char colname Definition file cplex h The routine CPXcheckaddcols validates the arguments of the corresponding CPXaddcols routine This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To call this routine you must compile and link check with your program as well as the CPLEX Callable Library The CPXcheckaddcols routine has the same argument list as the CPXaddcols routine The second argument lp is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the problem For most user applications this distinction is unimportant Example status CPXcheckaddcols env lp cont nzcnt obj cmatbeg cmatind cmatval lb ub newcolname Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 178 Global function CPXgetx int CPXgetx CPXCENVptr env CPXCLPptr lp double x int begin int end Definition file cplex h The routine CPXgetx accesses the solution values for a range of problem variables The beginning end of the range must be specified Example Status CPXgetx env lp x 0 CPXgetnumcols env 1p 1 See also the example 1pex2 c in the CPLEX User s Manual and in the standard distribution Parameters
268. control of memory allocations for problem modifications is needed Example status CPXcompletelp env 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 289 Global function CPXuncrushpi int CPXuncrushpi CPXCENVptr env CPXCLPptr lp double pi const double prepi Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXuncrushpi uncrushes a dual solution for the presolved problem to a dual solution for the original problem This routine is for linear programs Use CPXqpuncrushpi for quadratic programs Example status CPXuncrushpi env lp pi prepi Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob pi An array to receive dual solution pi values for the original problem as computed from the dual values of the presolved problem object The array
269. copyprotected CPXCENVptr env CPXLPptr lp int cnt const int indices Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcopyprotected specifies a set of variables that should not be substituted out of the problem If presolve can fix a variable to a value it is removed even if it is specified in the protected list Example status CPXcopyprotected env lp cnt indices Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob cnt The number of variables to be protected indices An array of length cnt containing the column indices of variables to be protected from being substituted out Returns The routine returns zero if successful and nonzero if an error occurs 151 Global function CPXNETgetdj int CPXNETgetdj CPXCENVptr env CPXCNETptr net double dj int begin int end Definition file cplex h The routine CPXNETgetdj is used to access reduced costs for a range of arcs of the network stored in a network problem object
270. ction CPXgeltrhs eret 460 Global function 461 Global function 462 Global function CPXgetcallbackindicatorinfa cessere eee eese nenne nennen nnne nnn nnn nnne 463 Global function 465 Global function 5 466 Global function CPXgetcallbacknodesstat eese eeeeeee eene enne nennt nennen nnne nnns nnn nennen 467 Global function CPXNETGdelset 1 nonien rre ek enu uer aaas MEE Sanoa 468 Global function 469 Global function 470 Global function 472 Global function CPXgetcallbackseqjinfoa cesses esee eene eene nn nennen nnne nnne n nnnm a nnne nennt nnne 473 Global function 5 474 Global function CPXcreateprob 3 2 ion LED oe guten 476 Global function CPXmbasewvtrite eese esee esee eene eene enne nnne natn nnn nnns nnns atn n inns atas nsns strass sn anten ns nn nn 477 Global function
271. ction resulting from the removal of fixed variables in the primal Returns The routine returns zero if successful and nonzero if an error occurs 66 Global function CPXcrushx int CPXcrushx CPXCENVptr env CPXCLPptr lp const double x double prex Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcrushx crushes a solution for the original problem to a solution for the presolved problem Example Status CPXcrushx env lp origx reducex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob x An array that contains primal solution x values for the original problem as returned by routines such as CPXgetx Or CPXsolution The array must be of length at least the number of columns in the problem object prex An array to receive the primal values corresponding to the presolved problem The array must be of length at least the number of columns in the presolved problem object Returns The routine returns zero if successful and nonzero if
272. d at any time after a linear program has been created via a call to CPXcreateprob to find a solution to that problem When this function is called the specified problem is solved using CPLEX Barrier followed by an automatic crossover to a basic solution if barrier determines that the problem is both primal and dual feasible Otherwise crossover is not performed In this case a call to CPXprimopt Or CPXdualopt can force a crossover to occur The results of the optimization are recorded in the problem object Methods of CPXhybbaropt method 0 use CPX PARAM BARCROSSALG to choose a crossover method method AL primal crossover method CPX_A dual crossover method NONE no crossover Example Status CPXhybbaropt env lp CPX ALG PRIMAL See also the example 1pex2 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob method Crossover method to be implemented according to the table Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object CPXERR NO PROBLEM Exceeding a user specified CPLEX limit or proving the model infeasible or unbounded are not considered errors Note that a zero return value
273. d by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob X An array that contains primal solution x values for the problem as returned by routines such as CPXcrushx and CPXuncrushx The array must be of length at least the number of columns in the LP problem object qcslack An array to receive the quadratic constraint slack values computed from the x values for the problem object The array must be of length at least the number of quadratic constraints in the LP problem object Returns The routine returns zero on success and nonzero if an error occurs 80 Global function CPXgetdblquality int CPXgetdblquality CPXCENVptr env CPXCLPptr lp double quality p int what Definition file cplex h The routine CPXgetdblquality accesses double valued information about the quality of the current solution of a problem A solution though not necessarily a feasible or optimal one must be available in the CPLEX problem object The quality values are returned in the double variable pointed to by the argument quality p The maximum bound infeasibility identifies the largest bound violation Largest bound violation may help determine the cause of an infeasible problem If the largest bound violation exceeds the feasibility tolerance by only a small amount it may be possible to obtain a feasible solution to the problem by increasing the feasibility tolerance If a problem is optimal the largest bound viol
274. d by R in the sense array If the row is not ranged the rngval array entry is ignored If rngval i gt 0 then row i activity is in rhs i rhs i rngval i and if rngval i lt 0 then row i activity isin zhs i rngval i rhs i This argument may be NULL colname array of length at least numcols containing pointers to character strings Each string is terminated with the NULL character These strings represent the names of the matrix columns or equivalently the variable names May be NULL if no names are associated with the variables If co1name is not NULL every variable must be given a name The addresses do not have to be in ascending order rowname An array of length at least numrows containing pointers to character strings Each string is terminated with the NULL character These strings represent the names of the matrix rows or equivalently the constraint names May be NULL if no names are associated with the constraints If rowname is not NULL every constraint must be given a name The addresses in rowname do not have to be in ascending order Returns The routine returns zero if successful and nonzero if an error occurs 382 Global function CPXchgcoeflist int CPXchgcoeflist CPXCENVptr env CPXLPptr lp int numcoefs const int rowlist const int collist const double vallist Definition file cplex h The routine CPXchgcoeflist changes a list of matrix coefficients of CPLEX problem
275. d by x a zero value states that it should not useraction p A pointer to an integer to contain the specifier of the action to be taken on completion of the user callback The table summarizes the possible values Actions to be Taken after a User Written Incumbent Callback Symbolic Constant Action CPX CALLBACK DEFAULT Proceed with optimization CPX CALLBACK FAIL Exit optimization CPX CALLBACK SE Proceed with optimization See Also CPXgetincumbentcallbackfunc Returns The routine returns zero if successful and nonzero if an error occurs 475 Global function CPXcreateprob CPXLPptr CPXcreateprob CPXCENVptr env int status p const char probname str Definition file cplex h The routine CPXcreateprob creates a CPLEX problem object in the CPLEX environment The arguments to CPXcreateprob define an LP problem name The problem that is created is an LP minimization problem with zero constraints zero variables and an empty constraint matrix The CPLEX problem object exists until the routine CPXfreeprob is called To define the constraints variables and nonzero entries of the constraint matrix any of the CPLEX LP problem modification routines may be used In addition any of the routines beginning with the prefix CPXcopy may be used to copy data into the CPLEX problem object New constraints or new variables can be created with the routines CPXnewrows Or CPXnewcols respectively Example lp C
276. d for CPX CALLBACK INFO NODE SIINF and CPX CALLBACK INFO NODE NIINF for the current node are the values that applied to the node when it was stored and thus before the branch was solved As a result these values should not be used to assess the feasibility of the node Instead use the routine CPXgetcallbacknodeintfeas to check the feasiblity of a node This routine cannot retrieve information about nodes that have been moved to node files For more information about node files see the CPLEX User s Manual If the argument nodeindex refers to a node in a node file CPXgetcallbacknodeinfo returns the value CPXERR NODE DISK Nodes still in memory have the lowest index numbers so a user can loop through the nodes until CPXget callbacknodeinfo returns an error and then exit the loop Example Status CPXgetcallbacknodeinfo env cbdata wherefrom 0 CPX CALLBACK INFO NODE NIINF amp numiinf Table 1 Information Requested for a User Written Node Callback 231 CPX CALLBACK INFO NODE SIINF sum of integer infeasibilities CPX CALLBACK INFO NODE NIINF lin number of integer infeasibilities CPX CALLBACK INFO NODE ESTIMATE estimated integer objective CPX CALLBACK INFO NODE DEPTH lin depth of node in branch and cut tree type of branch at this node see Table 2 for nodes of type CPX TYPE VAR the branching variable for this node for other types 1 is returned for nodes of type CPX TYPE 5051 or CPX TYPE SOS2 the num
277. d for your application to call those functions to interrupt and resume optimization You can also use callbacks to access progress information while the optimization is in process 27 Group optim cplex callable createdeletecopy The routines in the CPLEX Callable Library to create and delete problems and to copy data CPXcloneprob CPXcompletelp CPXcopybase CPXcopyctype CPXcopylp Function Summary CPXcopylpwnames CPXcopymipstart CPXcopynettolp CPXcopyobjname CPXcopyorder CPXcopystart CPXcreateprob CPXdelmipstarts CPXdelsetmipstarts CPXfreeprob CPXNETaddarcs CPXNETaddnodes CPXNETcheckcopynet CPXNETcopybase CPXNETcopynet CPXNETcreateprob CPXNETextract CPXNETfreeprob These routines create populate or delete a problem object You can also populate a problem object by means of the routines for modifying a problem or for reading data from a file 28 Group optim cplex callable debug The CPLEX Callable Library routines for debugging data Function Summary CPXcheckaddcols CPXcheckaddrows CPXcheckchgcoeflist CPXcheckcopyctype CPXcheckcopylp CPXcheckcopylpwnames CPXcheckcopyqpsep CPXcheckcopyquad CPXcheckcopysos CPXcheckvals These routines help you validate data in your problem to verify that you are solving the problem you intend 29 Group optim cplex callable manageparameters The routines in the CPLEX Callab
278. d is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly This routine is deprecated Use CPXwritemipstarts instead See Also CPXmstwrite CPXwritemipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool MIP start which should be written A value of 1 specifies that the current MIP start should be used instead of a solution pool member filename str A character string containing the name of the file to which the MIP start information should be written Returns The routine returns zero if successful and nonzero if an error occurs 418 Global function CPXNETextract int CPXNETextract CPXCENVptr env CPXNETptr net CPXCLPptr lp int colmap int rowmap Definition file cplex h The routine CPXNETextract finds an embedded network in the LP stored in a CPLEX problem object and copies it as a network to the network problem object net The extraction algorithm is controlled by the parameter CPX PARAM NETFIND If the CPLEX problem object has a basis an attempt is made to copy the basis to the network object However this may fail if the status values corresponding to the rows and columns of the subnetworks do not form a
279. d this error message use of the routines in check c 683 Macro CPXERR EXTRA BV BOUND Definition file cplex h CPXERR EXTRA BV BOUND 1456 Line 96d BV bound type illegal when prior bound given Check the MPS file for bound values which conflict with this type specification 684 Macro CPXERR EXTRA FR BOUND Definition file cplex h CPXERR EXTRA FR BOUND 1455 Line 96d FR bound type illegal when prior bound given A column with an upper or lower bound previously assigned has an illegal FR bound assignment Since the FR bound type has neither an upper nor lower bound no other bound type can be specified Check the MPS file 685 Macro CPXERR EXTRA BOUND Definition file cplex h CPXERR EXTRA FX BOUND 1454 Line 96d FX bound type illegal when prior bound given A column with either an upper or lower bound previously assigned has an illegal FX bound assignment Since the FX bound type fixes both upper and lower bounds no additional bounds can be specified Check the MPS file 686 Definition file cplex h CPXERR EXTRA INTEND 1481 Line 96d INTEND found while not reading integers Integer markers are incorrectly positioned in the MPS file 687 Macro CPXERR EXTRA INTORG Definition file cplex h CPXERR EXTRA INTORG 1480 Line 96d INTORG found while reading integers Integer markers are incorrectly positioned in the MPS file 688 Macro CPXER
280. dded According to Table 1 sostype i specifies the SOS type of set i The length of this array must be at least numsos sosbeg An array that with sosind and soswt defines the weights for the sets to be added sosind An array that with sosbeg and soswt defines the weights of the sets to be added soswt An array that with sosbeg and sosind defines the indices and weights for the sets to be added The indices of each set must be stored in sequential locations in sosind The weights of each set must be stored in sequential locations in soswt The array sosbeg j containing the index of the beginning of set 5 The weights must be unique within each set sosname An array containing pointers to character strings that represent the names of the new SOSs May be NULL in which case the new SOSs are assigned default names if the SOSs already resident in the CPLEX problem object have names otherwise no names are associated with the sets If SOS names are passed to CPXaddsos but existing SOSs have no names assigned default names are created for them Returns The routine returns zero if successful and nonzero if an error occurs 268 Global function CPXaddsolnpooldivfilter int CPXaddsolnpooldivfilter CPXCENVptr env CPXLPptr lp double lower bound double upper bound int nzcnt const int ind const double weight const double refval const char lname str Definition file cplex h The routine CPXaddsolnpooldivfilter adds a new diversity
281. ddfuncdest adds a function msgfunction to the message destination list for a channel This routine allows users to trap messages instead of printing them That is when a message is sent to the channel each destination that was added to the message destination list by CPXaddfuncdest calls its associated message To illustrate consider an application in which a developer wishes to trap CPLEX error messages and display them a dialog box that prompts the user for an action Use CPXaddfuncdest to add the address of a function to the list of message destinations associated with the cpxerror channel Then write the msg function routine It must contain the code that controls the dialog box When CPXmsg is called with cpxerror as its first argument it calls the msgfunction routine which can then display the error message Note The argument handle is a generic pointer that can be used to hold information needed by the msgfunction routine to avoid making such information global to all routines Example void msgfunction void handle char msg string FILE fp fp FILE handle fprintf fp s msg string status CPXaddfuncdest env mychannel fileptr msgfunction Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel A pointer to the channel to which the function destination is to be added handle A void pointer that can be used to pass arbitrary information into msgfunction
282. de value can be compared to the objective function value of the incumbent solution The resulting MIP Gap expressed as a percentage of the incumbent solution Serves as a measure of progress toward finding and proving optimality When active nodes no longer exist then these two values will have converged toward each other and the MIP Gap will thus be zero signifying that optimality of the incumbent has been proven It is possible to tell CPLEX to terminate the branch and cut procedure sooner than a completed proof of optimality For example a user can set a time limit or a limit on the number of nodes to be processed Indeed with default settings CPLEX will terminate the search when the MIP Gap has been brought lower than 0 0001 0 01 because it is often the case that much computation is invested in moving the Best Node value after the eventual optimal incumbent has been located This termination criterion for the MIP Gap can be changed by the user of course Callbacks in the Callable Library Callbacks are also known as an interrupt routines CPLEX supports various types of callbacks Informational callbacks allow your application to gather information about the progress of optimization without interfering with performance of the search In addition an informational callback also enables your application to terminate optimization Specifically informational callbacks check to determine whether your application has invoked the rout
283. ded involves a few subtleties Specifically a declaration of unboundedness means that CPLEX has determined that the model has an unbounded ray Given any feasible solution x with objective z a multiple of the unbounded ray can be added to x to give a feasible solution with objective 2 1 or 2 1 for maximization models Thus if a feasible solution exists then the optimal objective is unbounded Note that CPLEX has not necessarily concluded that a feasible solution exists Users can call the routine CPXsolninfo to determine whether CPLEX has also concluded that the model has a feasible solution Group optim cplex callable The API of the CPLEX Callable Library for users of C Macro Summary CPX SOLNPOOL DIV CPX SOLNPOOL FIFO CPX SOLNPOOL FILTER DIVERSITY CPX SOLNPOOL FILTER RANGE CPX SOLNPOOL OBJ Function Summary CPXaddchannel CPXaddcols CPXaddfpdest CPXaddfuncdest CPXaddindconstr CPXaddmipstarts CPXaddqconstr CPXaddrows CPXaddsolnpooldivfilter CPXaddsolnpoolrngfilter CPXaddsos CPXbaropt CPXboundsa CPXcheckaddcols CPXcheckaddrows CPXcheckchgcoeflist CPXcheckcopyctype CPXcheckcopylp CPXcheckcopylpwnames CPXcheckcopyqpsep CPXcheckcopyquad CPXcheckcopysos CPXcheckvals CPXchgbds CPXchgcoef CPXchgcoeflist CPXchgcolname CPXchgctype CPXchgmipstart CPXchgmipstarts CPXchgname CPXchgobj CPXchgobjsen CPXchgprobname CPXchgprobtype CPXchgprobtypesolnpool CPXchgrhs CPXch
284. dex pis undefined Returns The routine returns zero if successful and nonzero if an error occurs 531 Global function CPXclpwrite int CPXclpwrite CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h After cPXrefineconflict Or CPXrefineconflictext has been invoked on an infeasible problem to identify a minimal set of constraints that are in conflict this routine will write an LP format file containing the identified conflict The names will be modified to conform to LP format Example status CPXclpwrite env lp myfilename clp Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str Pointer to a character string naming the file Returns The routine returns zero if successful and nonzero if an error occurs 532 Global function CPXgetpnorms int CPXgetpnorms CPXCENVptr env CPXCLPptr lp double cnorm double rnorm int len p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The ro
285. dfeasind p Definition file cplex h The routine CPXNETsolninfo is used to access solution information computed by the most recent call to CPXNETprimopt The solution values are maintained in the object as long as no changes are applied to it with of the routines CPXNETchg CPXNETcopy CPXNETadd The arguments to CPXNETsolninfo are pointers to locations where data are to be written The returned values indicate what is known about the primal and dual feasibility of the current solution If either piece of information represented by an argument to CPXNETsolninfo is not required a NULL pointer can be passed for that argument Example status CPXNETsolninfo env lp amp pfeasind amp dfeasind Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob pfeasind p A pointer to an integer variables indicating whether the current solution is known to be primal feasible Note that a false return value does not necessarily mean that the solution is not feasible It simply means that the relevant algorithm was not able to conclude that it was feasible when it terminated dfeasind p A pointer to an integer variables indicating whether the current solution is known to be dual feasible Note that a false return value does not necessarily mean that the solution is not feasible It simply means
286. distinction is unimportant Example Status CPXcheckcopyquad env lp qmatbeg qmatont qmatind qmatval Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 93 Global function CPXbinvacol int CPXbinvacol CPXCENVptr env CPXCLPptr lp int j double x Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbinvacol computes the representation of the j th column in terms of the basis In other words it solves Bx Aj Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned CPXcreateprob j An integer that specifies the index of the column to be computed x array containing the solution of Bx Aj The array must be of length at least equal to the number of rows in the problem Returns The routine returns zero if successful and nonzero if an error occurs 94 Global function CPXcheckchgcoeflist int CPXcheckchgcoeflist CPXCENVptr env CPXCLPptr lp int numcoefs con
287. dspace is 0 then the negative of the value of surplus p returned specifies the length needed for the arrays indices priority and direction Example Status CPXgetorder env lp amp listsize indices priority direction numcols amp surplus Possible settings for direction CPX BRANCH GLOBAL o use global branching direction setting CPX PARAM BRDIR CPX BRANCH DOWN m branch down first on variable indices CPX BRANCH UP 2 branch up first on variable indices Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt p A pointer to an integer to contain the number of order entries returned i e the true length of the arrays indices priority and direction indices array where the indices of the variables in the order are to be returned indices k is the index of the variable which is entry k in the order information priority array where the priority values are to be returned The priority corresponding to the indices k is returned in priority k May be NULL If priority is not NULL it must be of length at least ordspace direction array where the preferred branching directions are to be returned The direction corresponding to indices k is returned in direction k May be NULL If direction is not NULL it must be of length at least ordspace Possible settings for direction k appear in the
288. e 728 Macro CPXERR NO CONFLICT Definition file cplex h CPXERR NO CONFLICT 1719 No conflict is available Either a conflict has not been computed or the computation failed For example computation may fail because the problem is feasible and thus does not contain conflicting constraints 729 Macro NO DUAL SOLN Definition file cplex h CPXERR NO DUAL SOLN 1232 No dual solution exists There is no dual solution available so there is no quality information about the dual either 730 Macro CPXERR Definition file cplex h CPXERR NO ENDATA 1552 ENDATA missing BAS files must have an ENDATA record as the last line of the file 731 Macro CPXERR NO ENVIRONMENT Definition file cplex h CPXERR NO ENVIRONMENT 1002 No environment Be sure to pass a valid environment pointer to the routines 732 Macro CPXERR NO FILENAME Definition file cplex h CPXERR NO FILENAME 1421 File name not specified A filename must be specified for the requested operation to succeed 733 Macro CPXERR NO Definition file cplex h CPXERR NO ID 1616 Line 96d Expected identifier found Instead of the expected identifier CPLEX found the character shown in the error message 734 Macro CPXERR NO ID FIRST Definition file cplex h CPXERR NO ID FIRST 1609 Line 96d Expected identifier first A variable name is missing on the specified line 735 Macro NO X
289. e RHS used by CPXdualopt dj An array to receive the values of the reduced costs for each of the variables The length of the array must be at least as great as the number of columns in the problem object If the solution was computed by the primal simplex optimizer and the solution is not feasible aj values are calculated relative to the phase objective the infeasibility function 117 Returns This routine returns zero if a solution exists If no solution exists or some other failure occurs CPXsolution returns nonzero 118 Global function CPXsetterminate int CPXsetterminate CPXENVptr env volatile int terminate Definition file cplex h This routine enables applications to terminate CPLEX gracefully Conventionally your application should first call this routine to set a pointer to the termination signal Then the application can set the termination signal to a nonzero value to tell CPLEX to abort These conventions will terminate CPLEX even in a different thread In other words this routine makes it possible to handle signals such as control C from a user interface These conventions also enable termination within CPLEX callbacks Example status CPXsetterminate env amp terminate To unset a termination signal set by this routine call this routine again later with a NULL pointer as the value of the argument terminate p Parameters env The pointer to the CPLEX environment as returned by CPXope
290. e cplex h CPX STAT CONFLICT ABORT TIME LIM 33 conflict refiner enum ConflictAbortTimeLim The conflict refiner terminated because of a time limit A conflict is available but it is not minimal 589 Macro CPX STAT CONFLICT ABORT USER Definition file cplex h CPX STAT CONFLICT ABORT USER 38 conflict refiner enum ConflictAbortUser The conflict refiner terminated because a user terminated the application A conflict is available but it is not minimal 590 Macro CPX STAT CONFLICT FEASIBLE Definition file cplex h CPX STAT CONFLICT FEASIBLE 30 conflict refiner enum ConflictFeasible The problem appears to be feasible no conflict is available 591 Macro CPX STAT CONFLICT MINIMAL Definition file cplex h CPX STAT CONFLICT MINIMAL 31 conflict refiner enum ConflictMinimal The conflict refiner found a minimal conflict 592 Macro STAT FEASIBLE Definition file cplex h CPX STAT FEASIBLE 23 Simplex or Barrier enum Feasible This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method feasOpt on a continuous problem The problem under consideration was found to be feasible after phase 1 of FeasOpt A feasible solution is available 593 Macro CPX STAT FEASIBLE RELAXED INF Definition file cplex h CPX STAT FEASIBLE RELAXED INF 16 Simplex or Barrier enum FeasibleRelaxedInf This status occurs only after a call to the Callable Librar
291. e index is negative or greater than or equal to the number of nodes in the network 768 Macro CPXERR NODE ON DISK Definition file cplex h CPXERR NODE ON DISK 3504 No callback info on disk compressed nodes Information about nodes stored in node files is not available through the advanced callback functions 769 Macro CPXERR NOT DUAL UNBOUNDED Definition file cplex h CPXERR NOT DUAL UNBOUNDED 1265 Dual unbounded solution required The called function requires that the LP stored in the problem object has been determined to be primal infeasible by the dual simplex algorithm 770 Macro FIXED Definition file cplex h CPXERR NOT FIXED 1221 Only fixed variables are pivoted out CPXpivotout can pivot out only fixed variables 771 Definition file cplex h CPXERR NOT FOR MIP 1017 Not available for mixed integer problems The requested operation can not be performed for mixed integer programs Change the problem type 772 Macro CPXERR NOT FOR Definition file cplex h CPXERR NOT FOR QCP 1031 Not available for QCP Function is not available for quadratically constrained problems 773 Macro CPXERR NOT FOR Definition file cplex h CPXERR NOT FOR 1018 Not available for quadratic programs The requested operation can not be performed for quadratic programs Change the problem type 774 Macro CPXERR NOT MILPCLASS Definitio
292. e is 0 zero then the negative of the value of surplus p returned specifies the total number of characters needed for the array str Example status CPXgetsolnpoolfiltername env lp fnamestr fnamespace amp surplus i Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob buf str A pointer to a buffer of size bufspace It may be NULL if bufspace is 0 zero bufspace An integer specifying the length of the array buf_str It may be 0 zero surplus p A pointer to an integer to contain the difference between bufspace and the amount of memory required to store the name of the filter A nonnegative value of surplus p specifies that the length of the array buf_str was sufficient A negative value specifies that the length of the array was insufficient and that the routine could not complete its task In this case CPXgetsolnpoolfiltername returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array bu str which An integer specifying the index of the filter for which the name is returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the array str to hold the name of the filter
293. e matrix 0 Example status CPXchgprobtype env lp CPXPROB MILP See Also CPXchgprobtypesolnpool Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob type An integer specifying the desired problem type See the previous discussion for possible values 470 Returns The routine returns zero if successful and nonzero if an error occurs 471 Global function CPXchgmipstarts int CPXchgmipstarts CPXCENVptr env CPXLPptr lp int mcnt const int mipstartindices int nzcnt const int beg const int varindices const double values const int effortlevel Definition file cplex h The routine CPXchgmipstarts modifies or extends multiple MIP starts If an existing MIP start has no value for the variable x j for example and the call to CPXchgmipstarts specifies a start value then the specified value is added to the MIP start If the existing MIP start already has a value for x 3 then the new value replaces the old If the MIP starts to be changed do not exist CPXchgmipstarts will not create them and will return an error CPXERR INDEX RANGE instead Start values may be specified for both integer and continuous variables See the routine CPXaddmipstarts for more information about how CPLEX uses MIP start information Example status CPXchgmipstarts env lp mcnt mipstartindices nzcnt beg
294. e of cut for which to return the number num p An pointer to an integer to contain the number of cuts Returns The routine returns zero if successful and nonzero if an error occurs 166 Global function CPXcopypartialbase int CPXcopypartialbase CPXCENVptr env CPXLPptr lp int ccnt const int cindices const int cstat int rcnt const int rindices const int rstat Definition file cplex h The routine CPXcopypartialbase copies a partial basis into an LP problem object Basis status values do not need to be specified for every variable or slack surplus or artificial variable If the status of a variable is not specified it is made nonbasic at its lower bound if the lower bound is finite otherwise it is made nonbasic at its upper bound if the upper bound is finite otherwise it is made nonbasic at 0 0 zero If the status of a slack surplus or artificial variable is not specified it is made basic Table 1 Values of cstat i CPX AT LOWER 0 variable at lower bound E SUPER CPX FRE variable free and nonbasic Table 2 Status of rows other than ranged rows in rstat i CPX AT LOWER 0 associated slack variable is nonbasic at value 0 0 zero CPX BASIC 1 associated slack surplus or artificial variable is basic Table 3 Status of ranged rows in rstat i associated slack variable nonbasic at its lower bound CPX BASIC 1 associated slack variable b
295. e pointer evaluates to NULL cbhandle A pointer to user private data This pointer is passed to the user written node callback Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle int nodeindex p int useraction p CPLEX calls the node callback after selecting the next node to explore The user can choose another node by setting the argument values of the callback Callback return value The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata 228 A pointer passed from the optimization routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass it to the callback information routines wherefrom An integer value reporting where in the optimization this function was called It has the value CPX CALLBACK MIP NODE cbhandle A pointer to user private data nodeindex p A pointer to an integer that specifies the node number of the user selected node The node selected by CPLEX is node number 0 zero Other nodes are numbered relative to their position in the tree and this number changes with each tree operation The unchanging identifier for a node is its sequence number To access the sequence number of a node use the routine CPXgetcallbacknodeinfo An error results if a user attempts to select
296. e problem name is returned A nonnegative value indicates that buf space was sufficient A negative value indicates that it was insufficient In that case CPXERR NEGATIVE SURPLUS is returned and the negative value of surplus p indicates the amount of insufficient space in the array buf Returns The routine returns zero on success and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS indicates that there was not enough space in the buf array to hold the name 328 Global function CPXdelrows int CPXdelrows CPXCENVptr env CPXLPptr lp int begin int end Definition file cplex h The routine CPXdelrows deletes a range of rows The range is specified using a lower and upper index that represent the first and last row to be deleted respectively The indices of the rows following those deleted are decreased by the number of deleted rows Example Status CPXdelrows env lp 10 20 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob begin An integer that specifies the numeric index of the first row to be deleted end integer that specifies the numeric index of the last row to be deleted Returns The routine returns zero if successful and nonzero if an error occurs 329 Global function CPXgetnumqconstrs int CPXgetnumqconstrs CPXCENVptr env CPXCLPptr lp Defi
297. e routine CPXcopypnorms copies the primal steepest edge norms to the specified LP problem object See Also CPXcopydnorms CPXgetpnorms Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob cnorm An array containing values to be used in a subsequent call to CPXprimopt with a setting of CPX PARAM PPRIIND equal to 2 as the initial values for the primal steepest edge norms of the first Len columns in the LP problem object The array must be of length at least equal to the value of the argument len rnorm An array containing values to be used in a subsequent call to CPXprimopt with a setting of CPX PARAM PPRIIND equal to 2 as the initial values for the primal steepest edge norms of the slacks and ranged variables that are nonbasic The array must be of length at least equal to the number of rows in the LP problem object len An integer that specifies the number of entries in the array cnorm Returns The routine returns zero if successful and nonzero if an error occurs 399 Global function CPXbranchcallbackbranchbds int CPXbranchcallbackbranchbds CPXCENVptr env void cbdata int wherefrom double nodeest int cnt const int indices const char lu const int bd void userhandle int seqnum p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of t
298. e solution pool associated with the LP problem specified by the argument 1p Details about that filter are returned in the arguments of this routine Example status CPXgetsolnpoolrngfilter env lp amp limlo amp limup amp num ind val cols amp surplus i Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob lb p Lower bound on the linear expression of a range filter ub p Upper bound on the linear expression of a range filter nzcnt Number of variables in the linear expression of a range filter ind An array of indices of variables in the linear expression of a range filter May be NULL if space is O val An array of coefficients in the linear expression of a range filter May be NULL if space is O space Integer specifying the length of the arrays ind and val surplus p A pointer to an integer to contain the difference between space and the number of entries in each of the arrays ind and val A nonnegative value of surplus p means that the length of the arrays was sufficient A negative value reports that the length was insufficient and consequently the routine could not complete its task In this case the routine CPXgetsolnpoolrngfilter returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays which The filter Returns
299. e upper bound upper range values are to be returned The length of this array must be at least end begin 1 NULL Returns The routine returns zero if successful and nonzero if an error occurs This routine fails if no basis exists 128 Global function CPXgetsolnpoolx int CPXgetsolnpoolx CPXCENVptr env CPXCLPptr lp int soln double x int begin int end Definition file cplex h The routine CPXgetsolnpoolx accesses the solution values for a range of problem variables for a member of the solution pool The beginning and end of the range must be specified Example status CPXgetsolnpoolx env lp 5 x 0 CPXgetnumcols env 1 See also the example populate c in the standard distribution Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln integer specifying the index of the solution pool member for which to return primal values value of 1 specifies that the incumbent should be used instead of a solution pool member x An array to receive the values of a member of the solution pool for the problem This array must be of length at least end begin 1 If successful x 0 through x end begin contains the solution values begin An integer specifying the beginning of the range of variable values to be returned end An integer specifying the end of the range of variable val
300. earch when solving mixed integer programming MIP models The branch and cut procedure manages a search tree consisting of nodes Every node represents an LP or QP subproblem to be processed that is to be solved to be checked for integrality and perhaps to be analyzed further Nodes are called active if they have not yet been processed After a node has been processed it is no longer active Cplex processes active nodes in the tree until either no more active nodes are available or some limit has been reached A branch is the creation of two new nodes from a parent node Typically a branch occurs when the bounds on a single variable are modified with the new bounds remaining in effect for that new node and for any of its descendants For example if a branch occurs on a binary variable that is one with a lower bound of 0 zero and an upper bound of 1 one then the result will be two new nodes one node with a modified upper bound of 0 the downward branch in effect requiring this variable to take only the value 0 and the other node with a modified lower bound of 1 the upward branch placing the variable at 1 The two new nodes will thus have completely distinct solution domains A cutis a constraint added to the model The purpose of adding any cut is to limit the size of the solution domain for the continuous LP or QP problems represented at the nodes while not eliminating legal integer solutions The outcome is thus to reduce the number
301. ecify a list of changes to make to the bounds of variables when child nodes are created One two or zero child nodes can be created so one two or zero lists of changes are specified in the arguments The first branch specified is considered first The callback is called with zero lists of bound changes 420 when the solution at the node is integer feasible CPLEX occasionally elects to branch by changing a number of bounds on variables or by adding constraints to the node subproblem the branch type is then TYPE ANY The details of the constraints added for a CPX ANY branch are not available to the user You can implement custom branching strategies by calling the CPLEX routine CPXbranchcallbackbranchbds CPXbranchcallbackbranchconstraints or CPXbranchcallbackbranchgeneral and setting the useraction argument to CALLBACK SET Then CPLEX will carry out these branches instead of the CPLEX selected branches Branch variables are expressed in terms of the original problem if the parameter PARAM MIPCBREDLP is set to CPX OFF before the call to CPXmipopt that calls the callback Otherwise branch variables in terms of the presolved problem If you set the parameter PARAM MIPCBREDLP to CPX OFF you must also disable dual and nonlinear presolve reductions To do so set the parameter PARAM REDUCE to 1 and set the parameter CPX PARAM PRELINEAR to O zero
302. ecognized bound type s unrecognized bounds sense specifier appears in the MPS file Acceptable bound senses are BV LI UI UP LO FX FR MI PL and SC 640 Macro CPXERR BAD CHAR Definition file cplex h CPXERR BAD CHAR 1537 Illegal character That character is not allowed See specifications of the NET or MIN format 641 Macro CPXERR BAD CTYPE Definition file cplex h CPXERR BAD CTYPE 3021 Illegal ctype entry d An illegal ct ype character has been passed to CPXchgct ype Use one of these C S or 642 Macro CPXERR BAD DIRECTION Definition file cplex h CPXERR BAD DIRECTION 3012 Line d Unrecognized direction c c Only UP and DN are accepted as branching directions beginning in column 2 of an ORD file 643 Macro CPXERR BAD EXPO RANGE Definition file cplex h CPXERR BAD EXPO RANGE 1435 Line 96d Exponent s out of range An exponent on the specified line is greater than the largest permitted for your computer system 644 Macro CPXERR BAD EXPONENT Definition file cplex h CPXERR BAD EXPONENT 1618 Line 96d Exponent s not s with number The characters following an exponent on the specified line are not numbers 645 Macro CPXERR BAD FILETYPE Definition file cplex h CPXERR BAD FILETYPE 1424 Invalid filetype An invalid file type has been passed to a routine requiring a file type 646 Macro CPXERR BAD ID Definition file cplex h CPXERR BAD ID 1617
303. ect the search when you are solving a MIP For example control callbacks enable you to select the next node to process or to control the creation of subnodes among other possibilities Control callbacks are an advanced feature of CPLEX and as such they require a greater degree of familiarity with CPLEX algorithms Because control callbacks can alter the search path in this way control callbacks are not compatible with dynamic search In other words CPLEX normally turns off dynamic search in the presence of control callbacks in an application If you want to take advantage of dynamic search in your application you should restrict your use of callbacks to the informational callbacks If you see a need for query diagnostic or control callbacks in your application you can override the normal behavior CPLEX by nondefault settings of the parameters PARAM MIPSEARCH CPX PARAM PARALLELMODE and CPX PARAM THREADS For more details about these parameters and their settings see the CPLEX Parameters Reference Manual Callbacks may be called repeatedly at various points during optimization for each place a callback is called CPLEX provides a separate callback routine for that particular point See also the group opt im cplex callable callbacks for a list of query and control callbacks Infeasibility Tools When you problem is infeasible CPLEX offers tools to help you diagnose the cause or causes of infeasibility in
304. ed CPXchgprobt ype could not change the problem type since an unknown type was specified 659 Macro CPXERR BAD ROW ID Definition file cplex h CPXERR BAD ROW ID 1532 Incorrect row identifier Selected row does not exist 660 Macro CPXERR BAD SECTION BOUNDS Definition file cplex h CPXERR BAD SECTION BOUNDS 1473 Line 96d Unrecognized section marker Expecting RANGES BOUNDS QMATRIX or ENDATA An unrecognized MPS file section marker occurred after the COLUMNS section of the MPS file 661 Macro CPXERR BAD SECTION Definition file cplex h CPXERR BAD SECTION ENDATA 1462 Line 96d Unrecognized section marker Expecting ENDATA An unrecognized MPS file section marker occurred after the COLUMNS section of the MPS file 662 Macro CPXERR BAD SECTION Definition file cplex h CPXERR BAD SECTION 1475 Line d Unrecognized section marker Expecting or ENDATA An unrecognized MPS file section marker occurred after the RHS or BOUNDS section of the MPS file 663 Macro BAD SENSE Definition file cplex h CPXERR BAD SENSE 1215 Illegal sense entry d Legal sense symbols are L G E and R 664 Macro CPXERR BAD SOS TYPE Definition file cplex h CPXERR BAD SOS TYPE 1442 Line 96d Unrecognized SOS type c c Only SOS Types S1 or S2 can be specified within an SOS or MPS file 665 Macro CPXERR BAD STATUS Definition file cplex h CPXERR
305. ed The routine returns a pointer to a CPLEX environment This pointer is used as an argument to every other nonadvanced CPLEX routine except CPXmsg Example env CPXopenCPLEX amp status See CPLEX User s Manual Parameters status p A pointer to an integer where an error code is placed by this routine Returns A pointer to the CPLEX environment If an error occurs including licensing problems the value NULL is returned The reason for the error is returned in the variable status p If the routine is successful then status pis 0 zero 338 Global function CPXsetbranchnosolncallbackfunc int CPXsetbranchnosolncallbackfunc CPXENVptr env int CPXPUBLIC branchnosolncallback CALLBACK BRANCH ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetbranchnosolncallbackfunc sets the callback function that will be called instead of the branch callback when there is a failure due to such situations as an iteration limit being reached unboundedness being detected numeric difficulties being
306. ed only when the value of the wherefrom argument is one of the following CALLBACK CPX CALLBACK MIP BRANCH CALLBACK INCUMBENT CALLBACK NODE CALLBACK HEURISTIC CALLBACK CUT Example Status CPXgetcallbacknodex env cbdata wherefrom nodex 0 cols 1 See also admipexl c admipex3 c and admipex5 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback x An array to receive the values of the primal variables for the node subproblem This array must be of length at least end begin 1 If successful x 0 through end begin contain the primal values begin An integer specifying the beginning of the range of primal variable values for the node subproblem to be returned end An integer specifying the end of the range of primal variable values for the node subproblem to be returned Returns The routine returns zero if successful and nonzero if an error occurs 349 Global function CPXsetmipcallbackfunc int CPXsetmipcallbackfunc CPXENVptr
307. eded for the array str Example status CPXgetqconstrname env lp qname 1 amp surplus 5 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob buf str A pointer to a buffer of size bufspace May be NULL if bu space is 0 bufspace An integer indicating the length of the array buf str May be 0 surplus A pointer to an integer to contain the difference between bufspace and the amount of memory required to store the quadratic constraint name A nonnegative value of surplus p indicates that the length of the array buf str was sufficient A negative value indicates that the length of the array was insufficient and that the routine could not complete its task In this case CPXgetqconstrname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus indicates the amount of insufficient space in the array str which An integer indicating the index of the quadratic constraint for which the name is to be returned Returns The routine returns zero on success and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS indicates that insufficient space was available in the buf_str array to hold the quadratic constraint name 368 Global function CPXcopystart int CPXcopystart CPXCENVptr env CPXLPptr lp const int cstat const in
308. efined here is similar to finding an irreducibly inconsistent set IIS an established technique in the published literature long available within CPLEX Both tools conflict refiner and IIS finder attempt to identify an infeasible subproblem in an infeasible model However the conflict refiner is more general than the IIS finder The IIS finder is applicable only in continuous that is LP models whereas the conflict refiner can work on any type of problem even mixed integer programs MIP and those containing quadratic elements QP or QCP Also the conflict refiner differs from the IIS finder in that a user may organize constraints into one or more groups for a conflict When a user specifies a group the conflict refiner will make sure that either the group as a whole will be present in a conflict that is all its members will participate in the conflict and removal of one will result in a feasible subproblem or that the group will not participate in the conflict at all See the Callable Library routine CPXre ineconflictext for more about groups A user may also assign a numeric preference to constraints or to groups of constraints In the case of an infeasible model having more than one possible conflict preferences guide the conflict refiner toward identifying constraints in a conflict as the user prefers In these respects the conflict refiner represents an extension and generalization of the IIS finder FeasOpt Alternatively a
309. eginning of the range of lower bounds to be returned end An integer specifying the end of the range of lower bounds to be returned Returns The routine returns zero if successful and nonzero if an error occurs 308 Global function CPXgetsolnpoolmeanobjval int CPXgetsolnpoolmeanobjval CPXCENVptr env CPXCLPptr lp double meanobjval p Definition file cplex h The routine CPXgetsolnpoolmeanob jval accesses the the mean objective value for solutions in the pool Example status CPXgetsolnpoolmeanobjval env lp amp meanobjval See also the example populate c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if the solution pool does not exist 309 Global function CPXpivot int CPXpivot CPXCENVptr env CPXLPptr lp int jenter int jleave int leavestat Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXpivot per
310. ehavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXt ightenbds changes the upper or lower bounds on a set of variables in a problem Several bounds can be changed at once Each bound is specified by the index of the variable associated with it The value of a variable can be fixed at one value by setting both the upper and lower bounds to the same value In contrast to the Callable Library routine CPXchgbds also used to change bounds CPXtightenbdspreserves more of the internal CPLEX data structures so it is more efficient for re optimization particularly when changes are made to bounds on basic variables Bound Indicators in the argument lu of CPXtightenbds Value of lu j Meaning for bd j is an upper bound bd j is a lower bound bd j is the lower and upper bound Example Status CPXtightenbds env lp cnt indices lu Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob cnt An integer specifying the total number of bounds to change That is cnt specifies the length of the arrays indices lu and indices An array containing the numeric indices of the columns corresponding to the variables for which bounds will be changed T
311. em object as returned by CPXNETcreateprob filename str Name of the basis file to write Returns The routine returns zero on success and nonzero if an error occurs 336 Global function CPXgetsolnpoolobjval int CPXgetsolnpoolobjval CPXCENVptr env CPXCLPptr lp int soln double objval p Definition file cplex h The routine CPXgetsolnpoolobjval accesses the objective value for a solution in the solution pool Example status CPXgetsolnpoolobjval env lp 0 amp objval See also the example populate c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool member for which to return the objective value A value of 1 specifies that the incumbent should be used instead of a solution pool member p A pointer to a variable of type double where the objective value is stored Returns The routine returns zero if successful and nonzero if the specified solution does not exist 337 Global function CPXopenCPLEX CPXENVptr CPXopenCPLEX int status p Definition file cplex h The routine CPXopenCPLEx initializes CPLEX environment when accessing a license for CPLEX and works only if the computer is licensed for Callable Library use The routine CPXopenCPLEX must be the first CPLEX routine call
312. enCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the solution should be written Returns The routine returns zero if successful and nonzero if an error occurs 439 Global function CPXcheckcopyctype int CPXcheckcopyctype CPXCENVptr env CPXCLPptr lp const char xctype Definition file cplex h The routine CPXcheckcopyct ype validates the arguments of the corresponding CPXcopyct ype routine This data checking routine is found in source format in the file check which is provided with the standard CPLEX distribution To call this routine you must compile and link check c with your program as well as the CPLEX Callable Library The CPXcheckcopyct ype routine has the same argument list as the CPXcopyct ype routine The second argument 1p is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the problem For most user applications this distinction is unimportant Example Status CPXcheckcopyctype env lp ctype Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 440 Global function CPXgetstat int CPXgetstat CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetstat accesses the solution status of the problem after an LP QP QCP or MIP optim
313. enCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob Returns The routine returns the Phase l iteration count if a solution exists It returns zero if no solution exists or any other type of error occurs 299 Global function CPXgetcoef int CPXgetcoef CPXCENVptr env CPXCLPptr lp int i int j double coef Definition file cplex h The routine CPXget coef accesses a single constraint matrix coefficient of a CPLEX problem object The row and column indices must be specified Example status CPXgetcoef env lp 10 20 amp coef Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob An integer specifying the numeric index of the row j An integer specifying the numeric index of the column coef p A pointer to a double to contain the specified matrix coefficient Returns The routine returns zero if successful and nonzero if an error occurs 300 Global function CPXgetgrad int CPXgetgrad CPXCENVptr env CPXCLPptr lp int j int head double y Definition file cplex h The routine CPXgetgrad can be used after an LP has been solved and a basis is available to access information useful for different types of post solution analysis CPXget grad provides two arrays that be used to project the impact of making changes to optimal variable values or objective function coeffic
314. encountered while the node LP is being solved In consequence of the failure whether the node is feasible or infeasible cannot be known and thus CPLEX routines such as CPXsolution may fail In this situation CPLEX will attempt to fix some variables and continue These conditions are rare except when the user has set a very low iteration limit so it is acceptable to let CPLEX follow its default action in these cases 339 Global function CPXaddmipstarts int CPXaddmipstarts CPXCENVptr env CPXLPptr lp int mcnt int nzcnt const int beg const int varindices const double values const int effortlevel char mipstartname Definition file cplex h The routine CPXaddmipstarts adds multiple starts to a CPLEX problem object of type CPXPROB MILP CPXPROB CPXPROB MIQCP It does not replace the existing MIP starts MIP start values may be specified for any subset of the integer or continuous variables in the problem When optimization begins or resumes CPLEX processes each MIP start to attempt to find a feasible MIP solution that is compatible with the set of values specified in the MIP start The processing of each MIP start depends on the corresponding effort level e Level 0 zero CPX AUTO Automatic CPLEX decides e Level 1 one CPX MIPSTART CHECKFEAS CPLEX checks the feasibility of the MIP start e Level 2 MIPSTART SOLVEFIXED CPLEX solves the fixed problem specified by the MI
315. encountering invalid data in the CPLEX problem object CPXERR PROBLEM Another possible error is the inability to solve a subproblem satisfactorily as reported by CPXERR_SUBPROB_SOLVE The solution status of the subproblem optimization can be obtained with the routine CPXgetsubstat Exceeding a user specified CPLEX limit is not considered an error Proving the problem infeasible or unbounded is not considered an error Note that a zero return value does not necessarily mean that a solution exists Use the query routines CPXsolninfo CPXgetstat CPXsolution and the special mixed integer solution routines to obtain further information about the status of the optimization See Also CPXgetstat CPXsolninfo CPXsolution CPXgetobjval Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Examples of errors include exhausting available memory CPXERR MEMORY or encountering invalid data in the CPLEX problem object CPXERR PROBLEM Another possible error is the inability to solve a subproblem satisfactorily as reported by CPXERR SUBPROB SOLVE The solution status of the subproblem optimization can be obtained with the routine CPXgetsubstat Exceeding a user specified CPLEX limit is not considered an error Proving the problem infeasible or unbounded is not considered an error Note that a z
316. end An integer specifying the end of the range of slack values to be returned Returns The routine returns zero on success and nonzero if an error occurs 519 Global function CPXmsg int CPXPUBVARARGS CPXmsg CPXCHANNELptr channel const char format Definition file cplex h The routine CPXmsg writes a message to a specified channel Like the C function printf it takes a variable number of arguments comprising the message to be written The list of variables specified after the format string should be at least as long as the number of format codes in the format The format string and variables are processed by the C library function vsprintf or a substitute on systems that do not have the vsprintf function The formatted string is limited to 1024 characters and is usually output with the C function fputs to each output destination in the output destination list for a channel except when a function has been specified by the routine CPXaddfuncdest as a destination The CPLEX Callable Library uses CPXmsg for all message output The CPXmsg routine may also be used in applications to send messages to either CPLEX defined or user defined channels Note CPXmsg is the only nonadvanced CPLEX routine not requiring the CPLEX environment as an argument Example CPXmsg mychannel The objective value was f n objval See 1pex5 c in the CPLEX User s Manual Parameters channel The pointer to the channel receiving the messa
317. end begin 1 begin Index of the first arc to get nodes for end Index of the last arc to get nodes for Returns The routine returns zero on success and nonzero if an error occurs 144 Global function CPXobjsa int CPXobjsa CPXCENVptr env CPXCLPptr lp int begin int end double lower double upper Definition file cplex h The routine CPXobjsa accesses upper and lower sensitivity ranges for objective function coefficients for a specified range of variable indices The beginning and end of the range of variable indices must be specified Note Information for variable j where begin lt j lt end is returned in position j begin of the arrays lower and upper The items 1ower j begin and upper j begin contain the lowest and highest value the objective function coefficient for variable 5 can assume without affecting the optimality of the solution Example Status CPXobjsa env lp 0 CPXgetnumcols env lp 1 lower upper Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob begin An integer specifying the beginning of the range of ranges to be returned end An integer specifying the end of the range of ranges to be returned lower An array where the objective function lower range values are to be returned This array must be of length atleast end begin 1 upper An array where the objective function
318. ened bound is a value strictly greater than zero then this routine has concluded that zero can be eliminated from the domain of the variable It is thus possible to change the type of a semicontinuous variable to continous or to change the type of a semi integer variable to integer without affecting the feasible region of the model Example status CPXbasicpresolve env lp reducelb reduceub rowstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob redib array to receive the strengthened lower bounds The array must be of length at least the number of columns in the LP problem object May be NULL redub An array to receive the strengthened upper bounds The array must be of length at least the number of columns in the LP problem object May be NULL rstat An array to receive the status of the row The array must be of length at least the number of rows in the LP problem object May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 503 Global function CPXchgname int CPXchgname CPXCENVptr env CPXLPptr lp int key int ij const char newname str Definition file cplex h The routine CPXchgname changes the name of a constraint or the name of a variable in a CPLEX problem object If this routine is performed on a problem object with no row or column names default names
319. enetworkfiles ees eene eene eene eene nennen nnne nnne nnn annt nnn nnn 50 Group optim cplex errorcodes esses esee esee eene eene nenne nnns nnn na anna ntnn natn n situs s tns s sns sensns snas stans snas anms atn anna 51 Group 5 58 Group 5 5 60 Global function 62 Global function 5 63 Global function 64 Global function 65 Global function GPXdu alwirite 2 1 inet 66 Global function 67 Global function CPXgetslack 2 3 ee centered tenter Deco erase oleo 68 Global function 69 Global function 5 5 70 Global function CPXgetnumsemiint eee eee 71 Global function CPXcheckcopysoOs e eee sc rie 72 Global function 73 Global function GPXcopyquad ben i Irae 74 Global function
320. ent memory exists to complete the uncrushing of the presolved problem 802 Macro CPXERR PRESLV START LP Definition file cplex h CPXERR PRESLV START LP 1112 Not enough memory to build start for original LP Most likely insufficient memory exists to complete the uncrushing of the presolved problem 803 Macro CPXERR PRESLV TIME Definition file cplex h CPXERR PRESLV TIME LIM 1123 Time limit exceeded during presolve Time limit exceeded during preprocessing 804 Macro CPXERR PRESLV UNBD Definition file cplex h CPXERR PRESLV UNBD 1118 Presolve determines problem is unbounded The loaded problem contains blatant unboundedness 805 Macro CPXERR PRESLV UNCRUSHFORM Definition file cplex h CPXERR PRESLV UNCRUSHFORM 1120 Can t uncrush solution form Presolve could not create a full solution 806 Macro CPXERR PRIIND Definition file cplex h CPXERR PRIIND 1257 Incorrect usage of pricing indicator The value of the pricing indicator is out of range 807 Macro CPXERR DATA Definition file cplex h CPXERR PRM DATA 1660 Line 96d Not enough entries There were illegal or missing values in a parameter file prm 808 Macro PRM HEADER Definition file cplex h CPXERR PRM HEADER 1661 Line 96d Missing or invalid header Illegal or missing version number in the header of a parameter prm 809 Macro CPXERR PTHREAD CREATE Definition file cplex h CPXER
321. equal to equal to In the original problem you may have indicator constraints in which the implied constraint has two or more variables In contrast in the canonical form the implied constraint can have only one variable moreover its coefficient in the constraint must be 1 one For example CPLEX transforms the indicator constraint x 0 gt 2 lt 0 into canonical form by introducing an implied variable w like this w 2 0 gt w lt 0 x The argument which_info can assume one of the following values in a call to CPXgetcallbackindicatorinfo CALLBACK INFO IC NUM returns the number of indicator constraints CPX CALLBACK INFO IC IMPLYING VAR returns the index of the implying variable of the i index th indicator constraint If the MIP callback parameter for the reduced LP CPX PARAM MIPCBREDLP is off that is set to CPX OFF the index is in terms of the original problem and if the index 1 then the variable has been created by presolve Otherwise the index is in terms of the presolved problem CPX CALLBACK INFO IC IMPLIED VAR returns the index of the implied variable of the iindex th indicator constraint If CPX PARAM is set to CPX OFF the index is in terms of the original problem and if the index 1 then the variable has been created by presolve Otherwise the index is in terms of the presolved problem CALLBACK INFO IC SENSE returns the sense of the iind
322. eration count If no solution exists CPXgetitcnt returns the value 0 See 1pex6 c in the CPLEX User s Manual 313 Global function CPXgetbaritcnt int CPXgetbaritcnt CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetbaritcnt accesses the total number of Barrier iterations to solve an LP problem Example itcnt CPXgetbaritcnt env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns the total iteration count if a solution exists It returns zero if no solution exists or any other type of error occurs 314 Global function CPXgetcutoff int CPXgetcutoff CPXCENVptr env CPXCLPptr lp double cutoff Definition file cplex h The routine CPXgetcutoff accesses the MIP cutoff value being used during mixed integer optimization The cutoff is updated with the objective function value each time an integer solution is found during branch and cut Example Status CPXgetcutoff env lp amp cutoff Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cutoff p A pointer to a location where the value of the cutoff is returned Example status CPXgetcutoff env lp amp cutoff Returns The routine returns zero if successful and nonzero if an error occu
323. erminate and terminate when this value is set A few of the parameter settings in the environment control the tuning process They are specified in the table below other parameter settings in the environment are ignored CPX PARA UNI F Controls the tuning evaluation measure CPX PARAM TUNINGDISPLAY Controls the level of the tuning display Controls screen output The value tunestat is 0 zero when tuning has completed and nonzero when it has not The two nonzero statuses are CPX TUNE ABORT Which will be set when the terminate value passed to CPXsetterminate is set and CPX TUNE TILIM which will be set when the time limit specified by CPX PARAM TILIMis reached Tuning will set any parameters which have been chosen even when tuning is not completed status CPXtuneparamprobset env filecnt filenames filetypes icnt inum ival dcnt dnum dval 0 NULL NULL amp tunestat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX filecnt An integer that specifies the number of problem files filename An array of length ilecnt containing problem file names filetype An array of length ilecnt containing problem file types as documented in CPXreadcopyprob May be NULL then CPLEX discerns file types from the file extensions of the file names intcnt An integer that specifies the number of integer parameters to be fixed during tuning This argument speci
324. erms of the constraint evaluated with the values of the structural variables in the problem Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob An array to receive the values of the quadratic constraint activity levels for each of the constraints in the specified range The array must be of length at least end begin 1 If successful x 0 through x end begin contain the quadratic constraint activities begin An integer indicating the beginning of the range of quadratic constraint activities to be returned end Aninteger indicating the end of the range of quadratic constraint activities to be returned Returns The routine returns zero on success and nonzero if an error occurs 131 Global function CPXdelindconstrs int CPXdelindconstrs CPXCENVptr env CPXLPptr lp int begin int end Definition file cplex h The routine CPXdelindconstrs deletes a range of indicator constraints The range is specified by a lower index that represent the first indicator constraint to be deleted and an upper index that represents the last indicator constraint to be deleted The indices of the constraints following those deleted constraints are automatically decreased by the number of deleted constraints Example Status CPXdelindconstrs env lp 10 20 Parameters env A pointer to the CPLEX environment as returned by CPXope
325. ero return value does not necessarily mean that a solution exists Use the query routines CPXsolninfo CPXgetstat CPXsolution and the special mixed integer solution routines to obtain further information about the status of the optimization Returns The routine returns zero if successful and nonzero if an error occurs 273 Global function CPXpivotin int CPXpivotin CPXCENVptr env CPXLPptr lp const int rlist int rlen Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXpivotin forcibly pivots slacks that appear on a list of inequality rows into the basis If equality rows appear among those specified on the list they are ignored Motivation In the implementation of cutting plane algorithms for integer programming it is occasionally desirable to delete some of the added constraints that is cutting planes when they no longer appear to be useful If the slack on some such constraint that is row is not in the resident basis the deletion of that row may destroy the quality of the basis Pivoting the slack in before the deletion avoids that diffic
326. error occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in the arrays indices and values to hold the MIP start information 88 Global function CPXdualfarkas int CPXdualfarkas CPXCENVptr env CPXCLPptr lp double y double proof p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXdualfarkas assumes that there is a resident solution as produced by a call to CPXdualopt and that the status of this solution as returned by CPXgetstat is CPX STAT INFEASIBLE The values returned in the array y have the following interpretation For the ith constraint if that constraint is a less than or equal to constraint y i 0 holds if that constraint is a greater than or equal to constraint y i gt 0 holds Thus where b is the righthand side vector for the given linear program A is the constraint matrix and x denotes the vector of variables y may be used to derive the following valid inequality x gt yTb Here y is being interpreted as a column vector and yT denotes the transpose of y
327. ers env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter for which the value is to be obtained value p A pointer to a variable of type double to hold the current value of the CPLEX parameter Returns The routine returns zero if successful and nonzero if an error occurs 401 Global function CPXIpopt int CPXlpopt CPXCENVptr env CPXLPptr lp Definition file cplex h The routine CPX1popt may be used at any time after a linear program has been created via a call to CPXcreateprob to find a solution to that problem using one of the CPLEX linear optimizers The parameter CPX PARAM LPMETHOD controls the choice of optimizer dual simplex primal simplex barrier network simplex sifting or concurrent optimization Currently with the default parameter setting of Automatic CPLEX invokes the dual simplex method when no advanced basis or starting vector is loaded or when the advanced indicator is zero The behavior of the Automatic setting may change in the future Example status CPXlpopt env lp See also the example 1pex1 c in Getting Started in the standard distribution See Also CPXgetstat CPXsolninfo CPXsolution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to the CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero unless an error
328. ers The length of the input line was beyond the size CPLEX can process 707 Macro CPXERR LO BOUND REPEATS Definition file cplex h CPXERR LO BOUND REPEATS 1459 Line d Repeated lower bound The lower bound for a column is repeated within the problem file on the specified line Two individual lower bounds could exist Alternatively an MI bound and individual lower bound could be in conflict Check the MPS file 708 Macro CPXERR LP NOT IN ENVIRONMENT Definition file cplex h CPXERR LP NOT IN ENVIRONMENT 1806 Problem is not member of this environment CPLEX encountered an error caused by an LP pointer attempting to access an environment other than the environment where the problem problem was created 709 Macro CPXERR MIPSEARCH WITH CALLBACKS Definition file cplex h CPXERR MIPSEARCH WITH CALLBACKS 1805 MIP dynamic search incompatible with control callbacks CPLEX encountered an error caused by a control callback invoked during dynamic search in MIP optimization 710 55 505 Definition file cplex h CPXERR MISS SOS TYPE 3301 Line d Missing SOS type An SOS type has not been specified 711 Macro CPXERR MSG NO CHANNEL Definition file cplex h CPXERR MSG NO CHANNEL 1051 No channel pointer supplied to message routine The message routine needs a pointer to a channel 712 Macro CPXERR MSG NO FILEPTR Definition file cplex h CPXERR MSG NO FILEPTR 1052 No file
329. es instead The routine CPXcopydnorms copies the dual steepest edge norms to the specified LP problem object The argument head is an array of column or row indices corresponding to the array of norms Column indices are indexed with nonnegative values Row indices are indexed with negative values offset by 1 one For example if head 0 5 then norm 0 is associated with 4 See Also CPXcopypnorms CPXgetdnorms Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX LP problem object as returned by CPXcreateprob norm An array containing values to be used in a subsequent call to CPXdualopt with a setting of CPX PARAM DPRIIND equal to 2 as the initial values for the dual steepest edge norms of the corresponding basic variables specified in head The array must be of length at least equal to the value of the argument len If any indices in head are not basic the corresponding values in norm are ignored head An array containing the indices of the basic variables for which norms have been specified in norm The array must be of length at least equal to the value of the argument 1en len An integer that specifies the number of entries in norm and head Returns The routine returns zero if successful and nonzero if an error occurs 414 Global function CPXcheckcopylp int CPXcheckcopylp CPXCENVptr env CPXCLPptr lp int numcols int numrows int objse
330. es that netstat_p can take and their meanings are the same as the return values documented for CPXNETgetstat objval p Pointer to which the objective value is to be written If NULL is passed no objective value is returned If the solution status is one of the CPX STAT ABORT codes the value returned depends on the setting of parameter CPX_PARAM_NETDISPLAY If this parameter is set to 2 objective function values that are penalized for infeasible flows are used to compute the objective value of the solution Otherwise the true objective function values are used X Array to which the solution flow vector is to be written If NULL is passed no solution vector is returned Otherwise x must point to an array of size at least that returned by CPXNETgetnumarcs pi Array to which the dual values are to be written If NULL is passed no dual values are returned Otherwise pi must point to an array of size at least that returned by CPXNETgetnumnodes slack Array to which the slack values violations of supplies demands are to be written If NULL is passed no slack values are returned Otherwise s1ack must point to an array of size at least that returned by CPXNETgetnumnodes dj Array to which the reduced cost values are to be written If NULL is passed no reduced cost values are returned Otherwise dj must point to an array of size at least that returned by CPXNETgetnumarcs Returns If a solution exists it
331. es you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXaddlazyconstraints adds constraints to the list of constraints that should be added to the LP subproblem of a MIP optimization if they are violated CPLEX handles addition of the constraints and makes sure that all integer solutions satisfy all the constraints The constraints are added to those specified in prior calls to CPXaddlazyconstraints Lazy constraints are constraints not specified in the constraint matrix of the MIP problem but that must be not be violated in a solution Using lazy constraints makes sense when there are a large number of constraints that must be satisfied at a solution but are unlikely to be violated if they are left out The CPLEX parameter CPX PARAM REDUCE should be set to PREREDUCE NOPRIMALORDUAL 0 orto CPX PREREDUCE PRIMALONLY 1 order to turn off dual reductions Use CPXfreelazyconstraints to clear the list of lazy constraints The arguments of CPXaddlazyconstraints are the same as those of CPXaddrows with the exception that new columns may be specified so there are no ccnt and arguments Furthermore unlike CPXaddrows CPXaddlazyconstraints does not accept a NULL pointer for the array of righthand side values or senses Example status CPXaddlazyconstraints env lp cnt nzcnt rhs sense
332. esolution The routines in the CPLEX Callable Library to analyze solutions optim cplex callable callbacks The CPLEX Callable Library routines for managing callbacks optim cplex callable advanced callbacks The routines in the CPLEX Callable Library to create and delete problems and to copy data optim cplex callable debug The CPLEX Callable Library routines for debugging data The routines in the CPLEX Callable Library to manage parameters optim cplex callable manageparameters that is set parameters get current values of parameters and get information about parameters optim cplex callable message The CPLEX Callable Library routines for managing messages optim cplex callable modifynetwork The routines in the CPLEX Callable Library to modify a network The routines in the CPLEX Callable Library to modify a problem created by CPXcreateprob optim cplex callable network The network routines in the CPLEX Callable Library optim cplex callable optimizers The routines in the CPLEX Callable Library to launch an optimizer optim cplex callable createdeletecopy optim cplex callable modifyproblem optim cplex callable portability The portability routines in the CPLEX Callable Library The routines in the CPLEX Callable Library to query general optim cplex callable querygeneralproblem problem data The routines in the CPLEX Callable Library to query MIP problem optim cplex callable querymip data The routines in the CPLEX Calla
333. eter CPX PARAM MIPORDIND must be set to ON its default value for the priority order to be used in a subsequent optimization Table 1 Settings for direction CPX BRANCH GLOBAL use global branching direction when setting the parameter CPX PARAM BRDIR CPX BRANCH DOWN branch down first on variable indices i CPX BRANCH UP branch up first on variable indices i Example Status CPXcopyorder env lp cnt indices priority direction See Also CPXreadcopyorder Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer giving the number of entries in the list indices array of length cnt containing the numeric indices of the columns corresponding to the integer variables that are assigned priorities priority array of length cnt containing the priorities assigned to the integer variables The entry priority j is the priority assigned to variable indices j May be NULL direction An array of type int containing the branching direction assigned to the integer variables The entry direction j is the direction assigned to variable indices j May be NULL Possible settings for direction j appear Table 1 Returns The routine returns zero if successful and nonzero if an error occurs 103 Global function CPXNETsolninfo int CPXNETsolninfo CPXCENVptr env CPXCNETptr net int pfeasind p int
334. etinfocallbackfunc See Also CPXgetcallbackinfo CPXsetmipcallbackfunc Returns The routine returns zero if successful and nonzero if an error occurs 172 Global function CPXgetincumbentcallbackfunc void CPXgetincumbentcallbackfunc CPXCENVptr env int CPXPUBLIC incumbentcallback p CALLBACK INCUMBENT ARGS void cbhandle p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetincumbentcallbackfunc accesses the user written callback to be called by CPLEX during MIP optimization after an integer solution has been found but before this solution replaces the incumbent This callback can be used to discard solutions that do not meet criteria beyond that of the mixed integer programming formulation Example CPXgetincumbentcallbackfunc env amp current incumbentcallback amp current handle See also Advanced MIP Control Interface in the CPLEX User s Manual For documentation of callback arguments see the routine CPXsetincumbentcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX incumbentcall
335. eturned by CPXgetnumrows Whereas CPXaddrows can add coefficients in columns with index greater than the value returned by CPXgetnumcols by the use of the ccnt argument See the discussion of the cent argument for CPXaddrows Thus CPXaddcols has no variable rcnt and no array rowname The routine CPXnewrows can be used to add empty rows before adding new columns via CPXaddcols The nonzero elements of every column must be stored in sequential locations in the array cmatva1 from position cmatbeg i to cmatbeg i 1 orfrom cmatbeg i to nzcnt 1 if i ccnt 1 Each entry cmatind i specifies the row number of the corresponding coefficient cmatval i Unlike CPXcopylp all columns must be contiguous and cmatbeg 0 must be 0 When you build or modify your problem with this routine you can verify that the results are as you intended by calling CPXcheckaddcols during application development Example status CPXaddcols env lp ccnt nzcnt obj cmatbeg cmatind cmatval lb ub newcolname Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob ccnt An integer that specifies the number of new columns being added to the constraint matrix nzcnt An integer that specifies the number of nonzero constraint coefficients to be added to the constraint matrix obj An array of length ccnt containing the objective function coefficients of t
336. eturned specifies the length needed for the arrays indices and values Example Status CPXgetmipstart env lp amp listsize indices values numcols amp surplus See Also CPXgetmipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt p A pointer to an integer to contain the number of MIP start entries returned that is the true length of the arrays indices and values indices An array to contain the indices of the variables in the incumbent MIP start indices k is the index of the variable which is entry k in the MIP start information Must be of length no less than mipstartspace value An array to contain the incumbent MIP start values The start value corresponding to indices is returned in values k Must be of length at least nipstartspace mipstartspace An integer stating the length of the non NULL array indices and values mipstartspace may be 0 zero surplus p A pointer to an integer to contain the difference between mipstartspace and the number of entries in each of the arrays indices and values A nonnegative value of surplus p specifies that the length of the arrays was sufficient A negative value specifies that the length was insufficient and that the routine could not complete its task In this case the routine CPXgetmipstart returns the value CPXERR NEGATIVE SURPLUS and the negative value of
337. ex th indicator constraint CPX CALLBACK INFO IC COMPL returns 0 zero if the iindex th indicator constraint is not complemented and 1 one otherwise CPX CALLBACK INFO RHS returns the righthand side of the 1 index th indicator constraint CPX CALLBACK INFO IC IS FEASIBLE returns 1 one if the implying variable is not O zero or 1 or if the iindex th indicator constraint is satisfied at the current node otherwise it returns 0 zero Parameters 463 env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value that reports where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback iindex An integer the index of the indicator constraint result generic pointer to a variable of type double or int representing the value returned by whichinfo Returns The routine returns zero if successful and nonzero if an error occurs 464 Global function CPXgetprobname int CPXgetprobname CPXCENVptr env CPXCLPptr lp char buf str int bufspace int surplus p Definition file cplex h The routine CPXgetprobname accesses the name of the problem set via the call to CPXcreateprob Note If the value of
338. f a variable to hold the private pointer of the user Example Status CPXgetnetcallbackfunc env mycallback NULL See Also CPXgetcallbackinfo Returns A nonzero terminates the optimization 508 Global function CPXfeasopt int CPXfeasopt CPXCENVptr env CPXLPptr lp const double rhs const double rng const double 1 const double ub Definition file cplex h The routine CPX easopt computes a minimum cost relaxation of the righthand side values of constraints or bounds on variables in order to make an infeasible problem feasible The routine also computes a relaxed solution vector that can be queried with CPXsolution CPXgetcolinfeas for columns CPXgetrowinfeas for rows CPXget sosinfeas for special ordered sets If CPX easopt finds a feasible solution it returns the solution and the corresponding objective in terms of the original model This routine supports several options for the metric used to determine what constitutes a minimum cost relaxation These options are controlled by the parameter PARAM FEASOPTMODE Which can take the following values FEASOPT MIN SUM 0 CPX FEASOPT SUM 1 CPX FEASOPT MIN INF 2 FEASOPT INF 3 CPX FEASOPT MIN QUAD 4 e CPX FEASOPT QUAD 5 t can minimize the weighted sum of the penalties for relaxations denoted by SUM It can minimize the weighted number of relaxed bounds and constraints denoted by
339. f deleted constraints Example status CPXdelqconstrs env lp 10 20 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX A pointer to CPLEX problem object as returned by CPXcreateprob begin An integer that indicates the numeric index of the first quadratic constraint to be deleted end integer that indicates the numeric index of the last quadratic constraint to be deleted Returns The routine returns zero on success and nonzero if an error occurs 206 Global function CPXdelsetsolnpoolfilters int CPXdelsetsolnpoolfilters CPXCENVptr env CPXLPptr lp int delstat Definition file cplex h The routine CPXdelsetsolnpoolfilters deletes filters from the problem object specified by the argument 1p Unlike the routine CPXdelsolnpoolfilters CPXdelsetsolnpoolfilters does require the filters to be in a contiguous range After the deletion occurs the remaining filters are indexed consecutively starting at 0 and in the same order as before the deletion Note The delstat array must have at least CPXgetsolnpoolnumfilters env lp elements Example Status CPXdelsetsolnpoolfilters env lp delstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob delstat An array specifying the filters to be deleted The routine CPXdelsetfilters deletes each filter i for which
340. f matbeg must be in ascending order For each k matind k specifies the row number of the corresponding coefficient matval k These arrays are accessed as follows Suppose that CPLEX wants to access the entries in some column 3 These are assumed to be given by the array entries matval matbeg j matval matbeg j matcnt j 1 The corresponding row indices are matind matbeg j matind matbeg j matcnt j 1 Entries mat ind are not required to be in row order Duplicate entries in nat ind and matval within a single column are not allowed The length of the arrays matbeg and mat ind should be at least The length of arrays mat ind and matval should be at least matbeg numcols 1 matcnt numcols 1 When you build or modify your problem with this routine you can verify that the results are as you intended by calling CPXcheckcopylpwnames during application development Example status CPXcopylpwnames env lp numcols 381 numrows objsen rhs sense matbeg matcnt matind matval lb ub rngval colname rowname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob numcols An integer that specifies the number of columns in the constraint matrix or equivalently the number of variables in the problem object numrows An integer that specifies the number of rows in the constrai
341. f the arrays 1 and linval rhs The righthand side value for the linear portion of the indicator constraint sense The sense of the linear portion of the indicator constraint Specify L for lt or G for gt or E for linind An array that with 1inval defines the linear portion of the indicator constraint linval An array that with 1ininda defines the linear portion of the indicator constraint The nonzero coefficients of the linear terms must be stored in sequential locations in the arrays 1inind and linval from positions 0 to nzcnt 1 Each entry 1inind i indicates the variable index of the corresponding coefficient 1 1 i indname str name of the constraint to be added May be NULL in which case the new constraint is assigned a default name if the indicator constraints already resident in the CPLEX problem object have names otherwise no name is associated with the constraint Returns The routine returns zero if successful and nonzero if an error occurs 500 Global function CPXdualopt int CPXdualopt CPXCENVptr env CPXLPptr lp Definition file cplex h The routine CPXdualopt may be used at any time after a linear program has been created via a call to CPXcreateprob to find a solution to that problem using the dual simplex algorithm When this function is called the CPLEX dual simplex optimization routines attempt to optimize the specified problem The results of the optimization are recorded i
342. facilitate the development of applications to solve modify and interpret the results of linear mixed integer continuous convex quadratic quadratically constrained and mixed integer quadratic or quadratically constrained programming The CPLEX Component Libraries consist of the CPLEX Callable Library C application programming interface and Concert Technology an object oriented for C Java and C NET users Concert Technology is also part of CP Optimizer enabling cooperative strategies using CPLEX and CP Optimizer together for solving difficult optimization problems What You Need to Know This manual assumes that you are familiar with the operating system on which you are using CPLEX The CPLEX Callable Library is written in the C programming language If you use this product this manual assumes you can write code in the appropriate language and that you have a working knowledge of a supported integrated development environment IDE for that language Notation and Naming Conventions Throughout this manual names of routines and parameters defined in the CPLEX Callable Library begin with This convention helps prevent name space conflicts with user written routines and other code libraries names of Component Library routines and arguments of routines appear in this typeface examples CPXprimopt numcols Related Documentation In addition to this Reference Manual document
343. ffect before you invoke this routine Example Status CPXrefineconflictext env lp ngrp ngrp pri beg ind type See Also CPXgetconflictext CPXrefineconflict CPXclpwrite Parameters env A pointer to the CPLEX environment as returned by the routine CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob grpcnt The number of constraint groups to be considered concnt An integer specifying the total number of elements passed in the arrays grpind and grptype equivalently the end of the last group in grpind grppref An array of preferences for the groups The value grppref i specifies the preference for the group designated by the index i A negative value specifies that the corresponding group should not be 125 considered in the computation of conflict In other words such groups are considered part of the problem Groups with a preference 0 zero are always considered to be part of the conflict No further checking is performed on such groups grpbeg An array of integers specifying where the constraint indices for each group begin in the array grpind Its length must be at least grpcnt grpind array of integers containing the indices for the constraints in each group For each of the various types of constraints listed in the table the constraint indices range from 0 zero to the number of constraints of that type minus one Group i contains the constraints with the
344. ficients to be changed and thus specifies the length of the arrays indices and values indices An array of length cnt containing the numeric indices of the rows corresponding to the linear constraints for which righthand side coefficients are to be changed values An array of length cnt containing the new values of the righthand side coefficients of the linear constraints present in indices Returns The routine returns zero if successful and nonzero if an error occurs 154 Global function CPXdelsolnpoolsolns int CPXdelsolnpoolsolns CPXCENVptr env CPXLPptr lp int begin int end Definition file cplex h The routine CPXdelsolnpoolsolns deletes a range of solutions from the solution pool The range is specified using a lower and upper index that represent the first and last solution to be deleted respectively The indices of the solutions following those deleted are decreased by the number of deleted solutions Example Status CPXdelsolnpoolsolns env lp 10 20 See Also CPXdelsetsolnpoolsolns Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob begin An integer that specifies the numeric index of the first solution to be deleted end integer that specifies the numeric index of the last solution to be deleted Returns The routine returns zero if successful and nonzero if an error occurs 155 Global functio
345. fies the length of the arrays intnum and intval intval An array containing the values for the parameters listed in intnum May be NULL if intcnt is 0 zero dblcnt An integer that specifies the number of double parameters to be fixed during tuning This specifies the length of the arrays dblnum and dblval 428 dblval An array containing the values for the parameters listed in May be NULL if dblocnt is 0 zero strcnt An integer that specifies the number of string parameters to be fixed during tuning This specifies the length of the arrays strnum and strval strval An array containing the values for the parameters listed in st rnum May be NULL if stront is 0 zero tunestat p A pointer to an integer to receive the tuning status Returns The routine returns zero if successful and nonzero if an error occurs 429 Global function CPXreadcopyparam int CPXreadcopyparam CPXENVptr env const char filename str Definition file cplex h The routine CPXreadcopyparam reads parameter names and settings from the file specified by ilename str and copies them into CPLEX This routine reads and copies files in the PRM format as created by CPXwriteparam The PRM format is documented in the CPLEX File Formats Reference Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX filename str Name of the file to read and copy into CPLEX 430 Global function CPXgetnumsemicont
346. filter to the solution pool A diversity filter drives the search for multiple solutions toward new solutions that satisfy a measure of diversity specified in the filter This diversity measure applies only to binary variables Potential new solutions are compared to a reference set You must specify which variables are to be compared You do so with the argument ind designating the indices of variables to include in the diversity measure A reference setis the set of values specified by the argument refval You may optionally specify weights that is coefficients to form a linear expression in terms of the variables in the diversity measure if you do not specify weights all differences between the reference set and potential new solutions will be weighted by the value 1 0 one CPLEX computes the diversity measure by summing the pair wise weighted absolute differences from the reference values like this differences x sum weight i times x ind i refval ill A diversity filter makes sure that the solutions satisfy the constraint lower bound lt differences x upper bound You may specify both a lower and upper bound on diversity In order to say Give me solutions that are close to this one within this specified set of variables specify a lower bound of 0 0 zero and a finite upper bound CPLEX then looks for solutions that differ from the reference values by at most the value of upper bound within the specified
347. filters from the the problem object specified by the argument 1p The range of filters to delete is specified by the argument begin the lower index that represents the first filter to be deleted and the argument end representing the last filter to be deleted The indices of the filters following those deleted are decreased by the number of deleted filters Example status CPXdelsolnpoolfilters env lp 10 20 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob begin An integer that specifies the numeric index of the first filter to be deleted end integer that specifies the numeric index of the last filter to be deleted Returns The routine returns zero if successful and nonzero if an error occurs 272 Global function CPXmipopt int CPXmipopt CPXCENVptr env CPXLPptr 1 Definition file cplex h At any time after a mixed integer program has been created by a call to CPXcreateprob the routine CPXmipopt may be used to find a solution to that problem An LP solution does not exist at the end of CPXmipopt To obtain post solution information for the LP subproblem associated with the integer solution use the routine CPXchgprobtype Example Status CPXmipopt env lp See also the example mipex1 c the standard distribution Examples of errors include exhausting available memory CPXERR NO MEMORY or
348. forms a basis change where variable jenter replaces variable j1eave in the basis Use the constant NO VARIABLE for jenter or for 31eave if you want CPLEX to determine one of the two variables involved in the basis change It is invalid to pass a basic variable for jenter Also no nonbasic variable may be specified for 31eave except jenter jleave when the variable has both finite upper and lower bounds In that case the variable is moved from the current to the other bound No shifting or perturbation is performed Example status CPXpivot env lp jenter jleave CPX LOWER Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob jenter An index specifying the variable to enter the basis The slack or artificial variable for row i is denoted by jenter i 1 The argument jenter must either identify a nonbasic variable or take the value CPX NO VARIABLE When jenter is set to CPX VARIABLE CPLEX will use the leaving variable jleave to perform a dual simplex method ratio test that determines the entering variable jeave index specifying the variable to leave the basis The slack or artificial variable for row i is denoted by jleave i 1 The argument 31 typically identifies a basic variable However if jenter denotes a variable with finite upper and lower bounds j1eave may be set t
349. from the file name The string is not case sensitive Returns The routine returns zero if successful and nonzero if an error occurs 416 Global function CPXmstwritesolnpoolall int CPXmstwritesolnpoolall CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h The routine CPXnstwritesolnpoolall writes MIP starts for all of the members of the solution pool to a file in MST format The MST format is an XML format and is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly This routine is deprecated Use CPXwritemipstarts instead See Also CPXmstwrite CPXwritemipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the MIP start information should be written Returns The routine returns zero if successful and nonzero if an error occurs 417 Global function CPXmstwritesolnpool int CPXmstwritesolnpool CPXCENVptr env CPXCLPptr lp int soln const char filename str Definition file cplex h The routine CPXnstwritesolnpool Writes a MIP start using either the current MIP start or a MIP start from the solution pool to a file in MST format The MST format is an XML format an
350. fter a model have been proven infeasible CPX easopt performs an additional optimization that computes a minimal relaxation of the constraints over variables of the bounds on variables and of the righthand sides of constraints to make the model feasible The parameter CPX PARAM FEASOPTMODE lets you guide CPXfeasopt in its computation of this relaxation CPXfeasopt Works in two phases In its first phase it attempts to minimize its relaxation of the infeasible model That is it attempts to find a feasible solution that requires minimal change In its second phase it finds an optimal solution among those that require only as much relaxation as it found necessary in the first phase Your choice of values for the parameter PARAM FEASOPTMODE indicates two aspects to CPLEX whether to stop in phase one or continue to phase two Min means stop in phase one with a minimal relaxation Opt means continue to phase two for optimum among those minimal relaxations how to measure the minimality of the relaxation Sum means CPLEX should minimize the sum of all relaxations Inf means that CPLEX should minimize the number of constraints and bounds relaxed The possible values of CPX PARAM FEASOPTMODE are documented in the routine See the group optim cplex solutionstatus for documentation of the status of a relaxation returned by a call of CPXfeasopt Unboundedness The treatment of models that are unboun
351. g the basis file default names are assumed Any basis that may have been created or saved in the problem object is replaced Example Status CPXNETreadcopybase env net netbasis bas Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob filename str Name of the basis file to read Returns The routine returns zero on success and nonzero if an error occurs 194 Global function CPXgetbranchcallbackfunc void CPXgetbranchcallbackfunc CPXCENVptr env int CPXPUBLIC branchcallback p CALLBACK BRANCH ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetbranchcallbackfunc accesses the user written callback routine to be called during MIP optimization after a branch has been selected but before the branch is carried out CPLEX uses the callback routine to change its branch selection Example CPXgetbranchcallbackfunc env amp current callback amp current handle See also Advanced MIP Control I
352. ge format The format string controlling the message output This string is used in a way identical to the format string in a printf statement Returns At completion CPXmsg returns the number of characters in the formatted result string 520 Global function CPXdelfuncdest int CPXdelfuncdest CPXCENVptr env CPXCHANNELptr channel void handle void CPXPUBLIC msgfunction void const char Definition file cplex h The routine CPXdelfuncdest removes the function msgfunction from the list of message destinations associated with a channel Use CPXdelfuncdest to remove functions that were added to the list using CPXaddfuncdest To illustrate consider an application in which a developer wishes to trap CPLEX error messages and display them a dialog box that prompts the user for an action Use CPXaddfuncdest to add the address of a function to the list of message destinations associated with the cpxerror channel Then write the msgfunction routine It must contain the code that controls the dialog box When CPXmsg is called with cpxerror as its first argument it calls the msgfunction routine which then displays the error message Note The handle argument is a generic pointer that can be used to hold information needed by the msgfunction routine to avoid making such information global to all routines Example void msgfunction void handle char msg string FILE fp fp FILE handle fprintf fp s
353. getsolnpoolslack accesses the slack values for a range of linear constraints for a member of the solution pool The beginning and end of the range must be specified Except for ranged rows the slack values returned consist of the righthand side minus the row activity level For ranged rows the value returned is the row activity level minus the righthand side or equivalently the value of the internal structural variable that CPLEX creates to represent ranged rows Example Status CPXgetsolnpoolslack env lp 3 slack 0 CPXgetnumrows env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool member for which to return slack values A value of 1 specifies that the incumbent should be used instead of a solution pool member slack An array to receive the values of the slack or surplus variables for each of the constraints This array must be of length at least end begin 1 If successful s1ack 0 through slack end begin contain the values of the slacks begin An integer specifying the beginning of the range of slack values to be returned end An integer specifying the end of the range of slack values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 534 Global function CPXgettuningcallbackfunc int CPXgettuningcall
354. ginning of the range of slack values to be returned end An integer indicating the end of the range of slack values to be returned Returns The routine returns zero on success and nonzero if an error occurs 542 Global function CPXunscaleprob int CPXunscaleprob CPXCENVptr env CPXLPptr lp Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXunscaleprob removes any scaling that CPLEX has applied to the resident problem and its associated data A side effect is that if there is a resident solution any associated factorization is discarded and the solution itself is deactivated meaning that it can no longer be accessed with a call to CPXsolution nor by any other query routine However any starting point information for the current solution such as an associated basis is retained Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 543 Global function CPXget
355. gned starting values values An array of length cnt containing the values to use for the starting integer solution The entry values j is the value assigned to the variable indices j An entry values j greater than or equal to INFBOUND specifies that no value is set for the variable indices j Returns The routine returns zero if successful and nonzero if an error occurs 457 Global function CPXdelsetsos int CPXdelsetsos CPXCENVptr env CPXLPptr lp int delset Definition file cplex h The routine CPXdelsetsos deletes a group of special ordered sets SOSs from a CPLEX problem object Note The delstat array must have at least CPXgetnumsos env lp elements Example Status CPXdelsetsos env lp delstat Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob delset An array specifying the 5055 to be deleted The routine CPXdelsetsos deletes each SOS j for which de1stat j 1 The deletion of 5055 results in a renumbering of the remaining 5055 After termination delstat j is either 1 for 5055 that have been deleted or the new index number that has been assigned to the remaining SOSs Note The delstat array must have at least CPXgetnumsos env elements Example Status CPXdelsetsos env lp delstat Returns The routine returns zero if successful and nonzero if an error occurs
356. grngval CPXchgrowname CPXchgsense CPXcleanup CPXcloneprob CPXcloseCPLEX CPXclpwrite CPXcompletelp CPXcopybase CPXcopyctype CPXcopylp CPXcopylpwnames CPXcopymipstart CPXcopynettolp CPXcopyobjname CPXcopyorder CPXcopypartialbase CPXcopystart CPXcreateprob CPXdelchannel CPXdelcols CPXdelfpdest CPXdelfuncdest CPXdelindconstrs CPXdelmipstarts CPXdelnames CPXdelqconstrs CPXdelrows CPXdelsetcols CPXdelsetmipstarts CPXdelsetrows CPXdelsetsolnpoolfilters CPXdelsetsolnpoolsolns CPXdelsetsos CPXdelsolnpoolfilters CPXdelsolnpoolsolns CPXdisconnectchannel CPXdperwrite CPXdualopt CPXdualwrite CPXembwrite CPXfclose CPXfeasopt CPXfeasoptext CPXfltwrite CPXflushchannel CPXflushstdchannels CPXfopen CPXfputs CPXfreeprob CPXgetax CPXgetbaritcnt CPXgetbase CPXgetbestobjval CPXgetcallbackinfo CPXgetchannels CPXgetchgparam CPXgetcoef CPXgetcolindex CPXgetcolinfeas CPXgetcolname CPXgetcols CPXgetconflict CPXgetconflictext CPXgetcrossdexchcnt CPXgetcrossdpushcnt CPXgetcrosspexchcnt CPXgetcrossppushcnt CPXgetctype CPXgetcutoff CPXgetdblparam 10 CPXgetdbliquality CPXgetdj CPXgetdsbont CPXgeterrorstring CPXgetgrad CPXgetindconstr CPXgetindconstrindex CPXgetindconstrinfeas CPXgetindconstrname CPXgetindconstrslack CPXgetinfocallbackfunc CPXgetintparam CPXgetintquality CPXgetitcnt CP
357. gsupply env net cnt indices supply Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob cnt An integer indicating the number of nodes for which the supply values are to be changed indices An array of indices that indicate the nodes for which the supply values are to be changed This array must have a length of at least cnt The indices must be in the range O nnodes 1 supply An array that contains the new supply values This array must have a length of at least Returns The routine returns zero on success and nonzero if an error occurs 220 Global function CPXsetdeletenodecallbackfunc int CPXsetdeletenodecallbackfunc CPXENVptr env void CPXPUBLIC deletecallback CALLBACK DELETENODE ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetdeletenodecallbackfunc sets and modifies the user written callback to be called during MIP optimization when a node is to be deleted Nodes are
358. gument is 0 the node will be fathomed unless user specified branches are made that is no child nodes are created and the node itself is discarded bdent An integer that specifies the number of bound changes defined in the arrays indices lu and bd that define the CPLEX selected branch nodeest An array with nodecnt entries that contains estimates of the integer objective function value that will be attained from the created node nodebeg An array with nodecnt entries The i th entry is the index into the arrays indices lu and bd of the first bound changed for the ith node indices Together with 1u and bd this array defines the bound changes for each of the created nodes The entry indices i is the index for the variable lu Together with indices and bd this array defines the bound changes for each of the created nodes The entry lu i is one of the three possible values specifying which bound to change for lower bound or U for upper bound or B for both bounds bd Together with indices and 1u this array defines the bound changes for each of the created nodes The entry bd i specifies the new value of the bound useraction p A pointer to an integer specifying the action for CPLEX to take at the completion of the user callback The table summarizes the possible actions Actions to be Taken After a User Written Branch Callback 2 Use user selected branch as defined by ca
359. h The routine CPXhybnetopt given a linear program that has been created via a call to CPXcreateprob extracts an embedded network uses the CPLEX Network Optimizer to attempt to obtain an optimal basis to the network and optimizes the entire linear program using one of the CPLEX simplex methods CPLEX takes the network basis as input for the optimization of the whole linear program Example status CPXhybnetopt env lp DUAL See also the example 1pex3 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob method The type of simplex method to follow the network optimization Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object CPXERR NO PROBLEM Exceeding a user specified CPLEX limit is not considered an error Proving the problem infeasible or unbounded is not considered an error A zero return value does not necessarily mean that a solution exists Use query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 366 Global function CPXrefinemipstartconflict int CPXrefinemipstartconflict CPXCENVptr env CPXL
360. h or without cdual arrays not being provided must be passed as NULL pointers Note The starting information is ignored by the optimizers if the parameter PARAM ADVIND is set to zero Table 1 Values for cstat j 0 variable at lower bound 1 variable is basic 2 variable at upper bound variable free and nonbasic Table 2 Values of rstat elements other than ranged rows 0 associated slack variable nonbasic at value 0 0 associated slack artificial variable basic Table 3 Values of rstat elements that are ranged rows Example status CPXcopystart env lp cstat 369 rstat cprim rprim cdual rdual Parameters env Ip cstat rstat A pointer to the CPLEX environment as returned by CPXopenCPLEX A pointer to a CPLEX problem object as returned by CPXcreateprob An array containing the basis status of the columns in the constraint matrix The length of the array is equal to the number of columns in the CPLEX problem object If this array is NULL xscat must be NULL Table 1 shows the possible values An array containing the basis status of the slack surplus or artificial variable associated with each row in the constraint matrix The length of the array is equal to the number of rows in the LP problem For rows other than ranged rows the array element rst at i be set according to Table
361. h the original LP problem object and the associated presolved LP problem object Example status CPXprechgobj env lp objcnt objind objval See also the example in the standard distribution Returns The routine returns zero if successful and nonzero if an error occurs 99 Global function CPXgettime int CPXgettime CPXCENVptr env double timestamp Definition file cplex h This routine returns a time stamp To measure time spent between a starting point and ending point of an operation take the result of this routine at the starting point take the result of this routine at the end point subtract the starting time stamp from the ending time stamp the subtraction yields elapsed time in seconds Whether the elapsed time measures wall clock time also known as real time or CPU time depends on the setting of the clock type parameter CPX PARAM CLOCKTYPE The absolute value of the time stamp is not meaningful 100 Global function CPXNETgetnumarcs int CPXNETgetnumarcs CPXCENVptr env CPXCNETptr net Definition file cplex h The routine CPXNETgetnumarcs is used to access the number of arcs in a network stored in a network problem object Example cur narcs CPXNETgetnumarcs env net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns The r
362. h the solutions should be written Returns The routine returns zero if successful and nonzero if an error occurs 137 Global function CPXgetnumqpnz int CPXgetnumqpnz CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumqpnz returns the number nonzeros in the matrix of a problem object Example numqpnz CPXgetnumqpnz env 1p Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If successful the routine returns the number of nonzeros in the Q matrix If an error occurs zero is returned 138 Global function CPXgetub int CPXgetub CPXCENVptr env CPXCLPptr lp double ub int begin int end Definition file cplex h The routine CPXgetub accesses a range of upper bounds on the variables of a CPLEX problem object The beginning and end of the range must be specified Unbounded Variables If a variable lacks an upper bound then CPXgetub returns a value greater than or equal to INFBOUND Example Status CPXgetub env lp ub 0 cur numcols 1 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob ub An array where the specified upper bounds on the variables are to be returned This array must be of length atleast end begin 1 The upper bound of var
363. hat the routine could not complete its task In that case the routine CPXgetprotected returns the value CPXERR_NEGATIVE_SURPLUS and the value of surplus p specifies the amount of insufficient space in the arrays Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the array indices to hold the protected variable indices 433 Global function CPXgetrowname int CPXgetrowname CPXCENVptr env CPXCLPptr lp char name char namestore int storespace int surplus p int begin int end Definition file cplex h The routine CPXget rowname accesses a range of row names or equivalently the constraint names of CPLEX problem object The beginning and end of the range along with the length of the array in which the row names are to be returned must be specified Note If the value of storespace is 0 then the negative of the value of surplus p returned specifies the total number of characters needed for the array namestore Example Status CPXgetrowname env lp cur rowname cur rownamestore cur storespace amp surplus 0 cur numrows 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob name An array of pointers to the row names stored in the array namestore This array must be
364. havior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetbranchcallbackfunc sets and modifies the user written callback routine to be called after a branch has been selected but before the branch is carried out during MIP optimization In the callback routine the CPLEX selected branch can be changed to a user selected branch Example Status CPXsetbranchcallbackfunc env mybranchfunc mydata See also the example admipex1 c the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX branchcallback A pointer to a user written branch callback If the callback is set to NULL no callback can be called during optimization cbhandle A pointer to user private data This pointer is passed to the callback Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle int type int SOS int nodecnt int double nodeest int nodebeg int indices char int bd int useraction p The call to the branch callback occurs after a branch has been selected but before the branch is carried out This function is written by the user On entry to the callback the CPLEX selected branch is defined in the arguments The arguments to the callback sp
365. he array must be at least nnodes nnames Pointer to an array of names for the nodes If NULL is passed no names are assigned to the nodes Otherwise the size of the array must be at least nnodes and every name in the array must be a string terminating in 0 zero narcs 181 Number arcs to be copied to the network object fromnode The array of indices in each arc s from node The indices must be in the range 0 nnodes 1 The size of the array must be at least narcs tonode The array of indices in each arc s to node The indices must be in the range 0 nnodes 1 The size of the array must be at least narcs low Pointer to an array of lower bounds on the flow through arcs If NULL is passed all lower bounds default to 0 zero Otherwise the size of the array must be at least narcs Values less than or equal to CPX INFBOUND are considered infinity up Pointer to an array of upper bounds on the flow through arcs If NULL is passed all lower bounds default to CPX INFBOUND Otherwise the size of the array must be at least narcs Values greater than or equal to CPX INFBOUND are considered infinity obj Pointer to an array of objective values for flow through arcs If NULL is passed all objective values default to 0 zero Otherwise the size of the array must be at least narcs anames Pointer to an array of names for the arcs If NULL is passed no names are assigned to the nodes Otherwise the size of the a
366. he algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbranchcallbackbranchbds specifies the branches to be taken from the current node It may be called only from within a user written branch callback function Branch variables in terms of the original problem if the parameter PARAM MIPCBREDIP is set to CPX OFF before the call to CPXmipopt that calls the callback Otherwise branch variables are in terms of the presolved problem Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value that reports where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback nodeest A double that specifies the value of the node estimate for the node to be created with this branch The node estimate is used to select nodes from the branch and cut tree with certain values of the node selection parameter PARAM NODESEL cnt An integer The integer specifies the number of bound changes that are specified in the arrays indices
367. he allocated length of the array is cnt Column j of the constraint matrix has the internal index j 1 lu An array This array contains characters specifying whether the corresponding entry the bd specifies the lower or upper bound on column indices j The allocated length of the array is cnt The table summarizes the values that entries in this array may assume bd An array This array contains the new values of the upper or lower bounds of the variables present in the array indices The allocated length of the array is cnt Returns The routine returns zero if successful and nonzero if an error occurs 442 Global function CPXembwrite int CPXembwrite CPXCENVptr env CPXLPptr lp const char filename str Definition file cplex h The routine CPXembwrite writes out the network embedded in the selected problem object MPS format is used The specific network extracted depends on the current setting of the parameter CPX PARAM NETFIND Example status CPXembwrite env lp myfile emb Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the embedded network should be written Example Status CPXembwrite env lp myfile emb Returns The routine returns zero if successful and nonzero if an error occurs 443 Global functio
368. he array namestore Example Status CPXgetsosname env lp cur sosname cur sosnamestore cur storespace amp surplus 0 cur numsos 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob name An array of pointers to the SOS names stored in the array namestore This array must be of length at least end begin 1 The pointer to the name of SOS i is returned name i begin namestore An array of characters where the requested SOS names are to be returned May be NULL if storespace is 0 zero storespace An integer specifying the length of the array namestore May be 0 zero surplus p A pointer to an integer to contain the difference between storespace and the total amount of memory required to store the requested names A nonnegative value of surplus_p specifies that storespace was sufficient A negative value reports that it was insufficient and that the routine could not complete its task In that case CPXgetsosname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array namestore begin An integer specifying the beginning of the range of sos names to be returned end An integer specifying the end of the range of sos names to be returned Returns The routine returns zero if successful and nonzero if an erro
369. he branch An array of length rcnt containing the sense of each constraint to be added for the branch Possible values appear in Table 2 An array that with rmatbeg and rmatind defines the constraints for the branch An array that with rmatbeg and rmatind defines the constraints for the branch An array that with rmatbeg and rmatind defines the constraints for the branch The format is similar to the format used to describe the constraint matrix in the routine CPXaddrows Every row must be stored in sequential locations in this array from position rmatbeg i to rmatbeg i 1 1 or from rmatbeg 1 tonzcnt 1 if i rcnt 1 Each entry rmatind i specifies the column index of the corresponding coefficient rmatval i All rows must be contiguous and rmatbeg 0 must be 0 A pointer to user private data that should be associated with the node created by this branch May be NULL A pointer to an integer that on return will contain the sequence number that CPLEX has assigned to the node created from this branch The sequence number may be used to select this node in later calls to the node callback The routine returns zero if successful and nonzero if an error occurs 297 Global function CPXNETchgarcnodes int CPXNETchgarcnodes CPXCENVptr env CPXNETptr net int cnt const int indices const int fromnode const int tonode Definition file cplex h The routine CPXNETchgarcnodes changes the nodes associated with a set of arc
370. he new variables May be NULL in which case the objective coefficients of the new columns are set to 0 0 cmatbeg Array that specifies the nonzero elements of the columns being added cmatind Array that specifies the nonzero elements of the columns being added cmatval Array that specifies the nonzero elements of the columns being added The format is similar to the format used to specify the constraint matrix in the routine CPXcopylp See description of matbeg matcnt matind and matval in that routine Ib An array of length ccnt containing the lower bound on each of the new variables Any lower bound that is set to a value less than or equal to that of the constant CPX INFBOUND is treated as negative infinity CPX INFBOUND is defined in the header file cplex h May be NULL in which case the lower bounds of the new columns are set to 0 0 ub An array of length ccnt containing the upper bound on each of the new variables Any upper bound that is set to a value greater than or equal to that of the constant INFBOUND is treated as infinity INFBOUND is defined in the header file cplex h May be NULL which case the upper bounds of the new columns are set to INFBOUND positive infinity colname An array of length ccnt containing pointers to character strings that specify the names of the new variables added to the problem object May be NULL in which case the new columns are assigned default names if the columns alre
371. he number of columns in the matrix The array element cstat i has the meaning specified in Table 1 rstat An array to receive the basis status of the artificial slack or surplus variable associated with each row in the constraint matrix The length of the array must be no less than the number of rows in the CPLEX problem object For rows other than ranged rows the array element rstat i has the meaning specified in Table 2 For ranged rows the array element rstat i has the meaning specified in Table 3 Returns The routine returns zero if a basis exists It returns nonzero if no solution exists or any other type of error occurs 407 Global function CPXmsgstr int CPXmsgstr CPXCHANNELptr channel const char msg str Definition file cplex h The routine CPXmsgstr sends a character string to a CPLEX message channel It is provided as an alternative to CPXmsg which due to its variable length argument list cannot be used in some environments such as Visual Basic Example CPXmsgstr p q Parameters channel The pointer to the channel receiving the message msg str A pointer to a string that should be sent to the message channel Returns The routine returns the number of characters in the string msg 408 Global function CPXgetdeletenodecallbackfunc void CPXgetdeletenodecallbackfunc CPXCENVptr env void CPXPUBLIC deletecallback p CALLBACK DELETENODE ARGS void cbhandle Definit
372. he range of MIP start names to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the store array to hold the names 192 Global function CPXNETgetnodeindex int CPXNETgetnodeindex CPXCENVptr env CPXCNETptr net const char lname str int index p Definition file cplex h The routine CPXNETgetnodeindex returns the index of the specified node in the network stored in a network problem object in the integer pointed to by index p Example Status CPXNETgetnodeindex env net root amp index Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Iname str Name of the node to look for index p A pointer to an integer to hold the node index If the routine is successful index p contains the index number otherwise p is undefined Returns The routine returns zero on success and nonzero if an error occurs 193 Global function CPXNETreadcopybase int CPXNETreadcopybase CPXCENVptr env CPXNETptr net const char filename str Definition file cplex h The routine CPXNETreadcopybase reads a basis file in BAS format and copies the basis to a network problem object If no arc or node names are available for the problem object when readin
373. he results of the optimization are recorded in the CPLEX problem object Example status CPXprimopt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object CPXERR NO PROBLEM Exceeding a user specified CPLEX limit is not considered an error Proving the problem infeasible or unbounded is not considered an error A zero return value does not necessarily mean that a solution exists Use the query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 378 Global function CPXgetsubmethod int CPXgetsubmethod CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXget submet hod accesses the solution method of the last subproblem optimization in the case of an error termination during mixed integer optimization Example submethod CPXgetsubmethod env 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example submethod CPXgetsubmethod env 1 Returns The possible return values are summari
374. he routine CPXgetqconstrindex searches for the index number of the specified quadratic constraint in a CPLEX problem object Example Status CPXgetqconstrindex env lp resource89 amp qconstrindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str A quadratic constraint name to search for index p A pointer to an integer to hold the index number of the quadratic constraint with name 1name str If the routine is successful index p contains the index number otherwise index p is undefined Returns The routine returns zero on success and nonzero if an error occurs 327 Global function CPXNETgetprobname int CPXNETgetprobname CPXCENVptr env CPXCNETptr net char buf str int bufspace int surplus p Definition file cplex h The routine CPXNETgetprobname is used to access the name of the problem stored in a network problem object Example Status CPXNETgetprobname env net name namesize amp surplus Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob buf str Buffer into which the problem name is copied bufspace Size of the array buf_str in bytes surplus p Pointer to an integer in which the difference between bu space and the number of characters required to store th
375. he rows of the presolved problem are to be returned The array must be of length at least the number of rows in the presolved problem object May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 294 Global function CPXreadcopymipstart int CPXreadcopymipstart CPXCENVptr env CPXLPptr lp const char filename_str Definition file cplex h This routine is deprecated Use CPXreadcopymipstarts instead The routine CPXreadcopymipstart reads a MST file and copies the information of the first MIP start contained in this file into a CPLEX problem object The parameter PARAM ADVIND must be set to 1 one its default value or 2 two in order for the MIP start to be used Example Status CPXreadcopymipstart env lp myprob mst See Also CPXmstwrite CPXreadcopymipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A string containing the name of the MST file Returns The routine returns zero if successful and nonzero if an error occurs 295 Global function CPXbranchcallbackbranchgeneral int CPXbranchcallbackbranchgeneral CPXCENVptr env void cbdata int wherefrom double nodeest int varcnt const int varind const char varlu const int varbd int rcnt int nzcnt const double rhs const char sense const int rmatbeg const int rmatind const
376. he value of its wherefrom argument is one of these values CALLBACK HEURISTIC CPX CALLBACK MIP BRANCH CALLBACK INCUMBENT CALLBACK CUT The information returned is for the original problem if the parameter PARAM MIPCBREDIP is set to CPX OFF before the call to CPXmipopt that calls the callback Otherwise it is for the presolved problem Example Status CPXgetcallbacksosinfo env curlp wherefrom 6 4 CPX CALLBACK INFO SOS IS FEASIBLE amp isfeasible See also the example admipex3 c in the standard distribution Table 1 Information Requested for a User Written SOS Callback I INFO SOS TYPE char one of the values in Table 4 LBACK INFO SOS SIZI size of SOS I E int CPX CALLBACK INFO SOS MEMBER INDEX reference value weight of this member Table 2 SOS Types Returned when whichinfo CALLBACK INFO SOS TYPE Symbolic Constant SOS Type Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX 282 cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback
377. hes for the index number of the specified MIP start in a CPLEX problem object Example Status CPXgetmipstartindex env lp mipstart6 amp rowindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob Iname str A MIP start name to search for index p A pointer to an integer to hold the index number of the MIP start with name 1name str If the routine is successful index p contains the index number otherwise index p is undefined Returns The routine returns zero if successful and nonzero if an error occurs 162 Global function CPXfreelazyconstraints int CPXfreelazyconstraints CPXCENVptr env CPXLPptr lp Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPX reelazyconstraints clears the list of lazy constraints that have been previously specified through calls to CPXaddlazyconstraints Example status CPXfreelazyconstraints env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp
378. his algorithm Check the options field of the license key to see the CPLEX features that are enabled 633 Macro CPXERR INDEX RANGE Definition file cplex h CPXERR ARC INDEX RANGE 1231 Arc index 96d out of range The specified arc index is negative or greater than or equal to the number of arcs in the network 634 Macro CPXERR ARRAY BAD SOS TYPE Definition file cplex h CPXERR ARRAY BAD SOS TYPE 3009 Illegal sostype entry d Only sostype values of 1 or 2 are legal 635 Macro CPXERR ARRAY NOT ASCENDING Definition file cplex h CPXERR ARRAY NOT ASCENDING 1226 Array entry d not ascending Entries in matbeg or sosbeg arrays must be ascending 636 Macro CPXERR ARRAY TOO LONG Definition file cplex h CPXERR ARRAY TOO LONG 1208 Array length too long The number of norm values passed to CPXcopypnorms exceeds the number of columns or the number of norm values passed to CPXcopydnorms exceeds the number of rows 637 Macro CPXERR BAD ARGUMENT Definition file cplex h CPXERR BAD ARGUMENT 1003 Bad argument to Callable Library routine An invalid argument was passed 638 Macro CPXERR BAD BOUND SENSE Definition file cplex h CPXERR BAD BOUND SENSE 1622 Line 96d Invalid bound sense An invalid bounds sense marker appears in the LP file Acceptable bound senses lt gt or free 639 Macro CPXERR BAD BOUND TYPE Definition file cplex h CPXERR BAD BOUND TYPE 1457 Line 96d Unr
379. hus a file name ending in sav is read as a SAV format file while a file name ending in sav gz is read as a compressed SAV format file Microsoft Windows does not support reading compressed files with this Values of filetype str SAV Use SAV format MPS Use MPS format LP Use LP format Example status CPXreadcopyprob env lp myprob mps NULL See also the example 1pex2 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str The name of the file from which the problem should be read filetype str case insensitive string containing the type of the file one of the strings the table May be NULL in which case the file type is inferred from the last characters of the file name Returns The routine returns zero if successful and nonzero if an error occurs 191 Global function CPXgetmipstartname int CPXgetmipstartname CPXCENVptr env CPXCLPptr lp char name char store int storesz int surplus p int begin int end Definition file cplex h The routine CPXgetmipstartname accesses a range of names of MIP starts in a CPLEX problem object The beginning and end of the range along with the length of the array in which the names of the MIP starts are to be returned must be specified Note If the value of s
380. iable 5 is returned in ub j begin begin An integer specifying the beginning of the range of upper bounds to be returned end integer specifying the end of the range of upper bounds to be returned Returns The routine returns zero if successful and nonzero if an error occurs 139 Global function CPXsiftopt int CPXsiftopt CPXCENVptr env CPXLPptr lp Definition file cplex h This routine looks at a subset of the columns of a problem and uses either the barrier or simplex optimizer to solve this reduced model That is it solves a model consisting of a selected subset of columns After solving this reduced model it performs a pricing step The pricing step serves two purposes to select additional columns to enter the reduced model to select existing columns to discard from the reduced model The routine repeats this procedure iteratively until it finds an optimal solution of the original problem This routine is useful for linear programming models LPs with a great many variables columns and relatively few constraints rows In colloquial terms these problems are known as long skinny models This routine is not applicable to a model with quadratic terms in the objective function QP nor to models with quadratic terms among the constraints QCP Example status CPXsiftopt env 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem o
381. ict is returned colind colbdstat An array to receive the list of the indices of the variables that participate in the conflict The length of the array must not be less than the number of columns in the conflict If that number is not known use the number of columns in the problem object instead An array to receive the conflict status of the columns Entry colbdstat i gives the status of column colind i The length of the array must not be less than the number of columns in the conflict If that number is not known use the number of columns in the problem object instead confnumcols p pointer to an integer where the number of columns in the conflict is returned Returns The routine returns zero if successful and nonzero if an error occurs 405 Global function CPXgetmethod int CPXgetmethod CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetmethod returns an integer specifying the solution algorithm used to solve the resident LP QP or QCP problem The possible return values are summarized in the table b DUAL Dual simplex ARRIER Barrier optimizer no crossover 2 LG 4 LG B Example method CPXgetmethod env 1p Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns one of the possible values s
382. ient and that the routine could not complete its task In this case CPXget cols returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays begin An integer specifying the beginning of the range of columns to be returned end An integer specifying the end of the range of columns to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the arrays cmat ind and cmatval to hold the nonzero coefficients 261 Global function CPXgetparamnum int CPXgetparamnum CPXCENVptr env const char name str int whichparam p Definition file cplex h The routine CPXgetparamnum returns the reference number of a CPLEX parameter given a character string containing the name for it The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example Status CPXgetparamnum env CPX PARAM ADVIND param number Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX name str A character array containing the name of the target parameter whichparam p A pointer to an integer to receive the reference number Returns The routine returns zero if successful and nonzero if an error occurs 262 Global function CPXgetbasednorms
383. ients For a unit change in the value of the 5th variable the value of the ith basic variable sometimes referred to as the variable basic in the ith row changes by the amount y i Also for a unit change of the objective function coefficient of the ith basic variable the reduced cost of the jth variable changes by the amount y i The vector is equal to the product of the inverse of the basis matrix and the column 3 of the constraint matrix Thus y can be thought of as the representation of the 5th column in terms of the basis Example Status CPXgetgrad env lp 13 head y Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob j An integer specifying the index of the column of interest A negative value for 5 specifies a column representing the slack or artificial variable for row 5 1 head An array to contain a listing of the indices of the basic variables in the order in which they appear in the basis This listing is sometimes called the basis header The ith entry in this list is also sometimes viewed as the variable in the ith row of the basis If the ith basic variable is a structural variable head i simply contains the column index of that variable If it is a slack variable head contains one less than the negative of the row index of that slack variable This array should be of length at least CPXgetnumrows env lp
384. ieved The possible quality values which can be evaluated for a solution pool member are listed in the group optim cplex solutionquality in the Callable Library Reference Manual Returns The routine returns zero if successful and nonzero if an error occurs If an error occurs the quality value remains unchanged 237 Global function CPXgetsolnpooldblquality int CPXgetsolnpooldblquality CPXCENVptr env CPXCLPptr lp int soln double quality p int what Definition file cplex h The routine CPXgetsolnpooldblquality accesses double valued information about the quality of a solution in the solution pool The quality values are returned the double variable pointed to by the argument quality p Example status CPXgetsolnpooldblquality env lp soln CPX MAX X amp max x Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln An integer giving the index of the solution pool member for which the quality measure is to be computed A value of 1 specifies that the incumbent should be used instead of a member of the solution pool quality p A pointer to a double variable in which the requested quality value is to be stored If an error occurs the quality value remains unchanged what A symbolic constant specifying the quality value to be retrieved The possible quality values for a solution are listed in the gr
385. if the original problem is a QP Example Status CPXqpuncrushpi env lp pi prepi x Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob pi An array to receive dual solution pi values for the original problem as computed from the dual values of the presolved problem object The length of the array must at least equal the number of rows in the LP problem object prepi An array that contains dual solution pi values for the presolved problem as returned by such routines as CPXgetpi and CPXsolution when applied to the presolved problem object The length of the array must at least equal the number of rows in the presolved problem object x An array that contains primal solution x values for a problem as returned by such routines as CPXuncrushx and CPXcrushx The length of the array must at least equal the number of columns in the LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 396 Global function CPXgetinfocallbackfunc int CPXgetinfocallbackfunc CPXCENVptr env int CPXPUBLIC callback p CPXCENVptr void int void void cbhandle p Definition file cplex h The routine CPXget infocallbackfunc accesses the user written callback routine to be called regularly during the optimization of a mixed integer program MIP This routine enables the user to acces
386. igned no names Otherwise the size of the array must be at least nnodes and every name in the array must be a string terminating in O If the existing nodes have no names and nnames is not NULL default names are assigned to the existing nodes Returns The routine returns zero on success and nonzero if an error occurs 246 Global function CPXNETgetobj int CPXNETgetobj CPXCENVptr env CPXCNETptr net double obj int begin int end Definition file cplex h The routine CPXNETget ob j is used to access the objective function values for a range of arcs in the network stored in a network problem object Example Status CPXNETgetobj env net obj 0 cur narcs 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob obj Array in which to write the objective values for the requested range of arcs If NULL is passed no objective values are retrieved Otherwise obj must point to an array of size at least end begin 1 begin Index of the first arc for which the objective value is to be obtained end Index of the last arc for which the objective value is to be obtained Returns The routine returns zero on success and nonzero if an error occurs 247 Global function CPXgetcrossdpushcnt int CPXgetcrossdpushcnt CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetcros
387. ince they are never used for branching This routine may be called only when the value of the wherefrom argument is one of the following CALLBACK CPX CALLBACK MIP BRANCH CPX CALLBACK MIP INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT Example Status CPXgetcallbackpseudocosts env cbdata wherefrom upcost downcost j k Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback uppc An array to receive the values of up pseudo costs This array must be of length at least end begin 1 If successful uppc 0 through uppc end begin will contain the up pseudo costs May be NULL downpc array to receive the values of the down pseudo costs This array must be of length at least end begin 1 If successful 0 through downpc end begin will contain the down pseudo costs May be NULL begin An integer specifying the beginning of the range of pseudo costs to be returned end An integer specifying the end of the range of pseudo co
388. indices grpind grpbeg i grpind grpbeg i 1 1 for i less than 1 grpind grpbeg i grpind concnt 1 fori grpcnt 1 Its length must be at least concnt constraint must not be referenced more than once in this array For any constraint the problem that is not a member of a group and thus does not appear in this array the constraint is assigned a default preference of 0 zero Thus such constraints are included in the conflict without any analysis grptype An array of characters containing the constraint types for the constraints as they appear in groups The types of the constraints in group i are specified in grptype grpbeg i grptype grpbeg i 1 1 fori less than grpcnt 1 and grptype grpbeg i grptype concnt 1 fori grpcnt 1 Its length must be at least concnt and every constraint must appear at most once in this array Possible values appear in Table 1 Returns The routine returns zero if successful and nonzero if an error occurs 126 Global function CPXgetbhead int CPXgetbhead CPXCENVptr env CPXCLPptr lp int head double x Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can
389. ine CPXsetterminate to set a signal to terminate optimization in which case informational callbacks will terminate optimization for you Query callbacks also known as diagnostic callbacks make it possible for your application to access information about the progress of optimization whether continuous or discrete while optimization is in process The information available depends on the algorithm primal simplex dual simplex barrier mixed integer or network that you are using For example a query callback can return the current objective value the number of simplex iterations that have been completed and other details Query callbacks can also be called from presolve probing fractional cuts and disjunctive cuts Query callbacks may impede performance because the internal data structures that support query callbacks must be updated frequently Furthermore they make assumptions about the path of the search assumptions that are correct with respect to conventional branch and cut but that may be false with respect to dynamic search For this reason query or diagnostic callbacks are not compatible with dynamic search In other words CPLEX normally turns off dynamic search in the presence of query or diagnostic callbacks in an application Control callbacks make it possible for you to define your own user written routines and for your application to call those routines to interrupt and resume optimization Control callbacks enable you to dir
390. inear expression The nonzero coefficients of the linear terms must be stored sequential locations in the arrays ind and val from positions 0 to num 1 Each entry ind i specifies the variable index of the corresponding coefficient val i Iname str The name of the filter May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 478 Global function CPXqpdjfrompi int CPXqpdjfrompi CPXCENVptr env CPXCLPptr lp const double pi const double x double dj Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXqpdjfrompi computes an array of reduced costs from an array of dual values and an array of primal values for a QP Example Status CPXqpdjfrompi env lp origpi reducepi Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob pi array that contains dual solution pi values for a problem as returned by such routines as CPXqpuncrushpi and CPXcrushpi The length of the array must at lea
391. ing the Callable Library C API CPLEX also comes with these resources Getting Started with CPLEX introduces you to ways of specifying models and solving problems with CPLEX CPLEX User s Manual explores programming with CPLEX in greater depth It provides practical ideas about how to use CPLEX in your own applications and shows how and why design and implementation decisions in the examples were made The CPLEX Release Notes highlight the new features and important changes in this version CPLEX C Reference Manual documents the classes and member functions of the Concert Technology and CPLEX C The CPLEX Java Reference Manual supplies detailed definitions of the Concert Technology Java interfaces and CPLEX Java classes CPLEX C NET Reference Manual documents the Concert Technology C NET interfaces and CPLEX C NET classes CPLEX Python Reference Manual supplies detailed definitions of the Python classes interfaces modules and methods Source code for examples is delivered in the standard distribution A file named readme html is delivered in the standard distribution This file contains the most current information about platform prerequisites for CPLEX All of the manuals and Release Notes are available in online versions The online documentation in HTML format can be accessed through standard HTML browsers Concepts Branch and cut CPLEX uses branch and cut s
392. ining the name of the file to which the basis should be written Returns The routine returns zero if successful and nonzero if an error occurs 477 Global function CPXaddsolnpoolrngfilter int CPXaddsolnpoolrngfilter CPXCENVptr env CPXLPptr lp double lb double ub int nzcnt const int ind const double val const char lname str Definition file cplex h Adds a new range filter to the solution pool A range filter drives the search for multiple solutions toward new solutions that satisfy criteria specified as a ranged linear expression in the filter A range filter sets a lower and an upper bound on a linear expression consisting of nzcnt variables designated by their indices in the argument ina and coefficient values designated in the argument val lower bound lt sum val i times x ind i lt upper bound A range filter applies to variables of any type that is binary general integer continuous Example Status CPXaddsolnpoolrngfilter env lp loval hival cnt ind val NULL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Ib The lower bound on the linear expression ub The upper bound on the linear expression nzcnt The number of variables in the linear expression ind An array of variable indices that with va1 defines the linear expression val An array of values that with ind defines the l
393. inition file cplex h CPXERR NO RHS COEFF 1610 Line 96d Expected RHS coefficient No RHS coefficient is present after the sense marker on the specified line 755 Macro CPXERR RHS Definition file cplex h CPXERR NO RHS IN OBJ 1211 rhs has no coefficient in obj You cannot make changes to the righthand side of an objective row because no coefficients exist 756 Macro CPXERR NO RNGVAL Definition file cplex h CPXERR NO RNGVAL 1216 No range values No ranges exist for this problem 757 Macro CPXERR NO ROW NAME Definition file cplex h CPXERR NO ROW NAME 1486 Line 96d No row name A row name is missing within the ROWS section 758 Macro CPXERR NO ROW SENSE Definition file cplex h CPXERR NO ROW SENSE 1453 Line 96d No row sense No sense for the row was found on the specified line 759 Macro CPXERR NO ROWS SECTION Definition file cplex h CPXERR NO ROWS SECTION 1471 Line 96d No ROWS section No ROW section was found in the MPS file 760 Macro CPXERR NO SENSIT Definition file cplex h CPXERR NO SENSIT 1260 Sensitivity analysis not available for current status Sensitivity information is not available because an optimal basic solution does not exist for the currently loaded problem Optimize the problem and check to make sure that it is not infeasible or unbounded 761 Macro CPXERR SOLN Definition file cplex h CPXERR NO SOLN 1217 No solution exists The reques
394. int CPXgetnumsemicont CPXCENVptr env CPXCLPptr 1 Definition file cplex h The routine CPXgetnumsemicont accesses the number of semi continuous variables in a CPLEX problem object Example numsc CPXgetnumsemicont env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the problem object or environment does not exist CPXgetnumsemicont returns the value 0 zero otherwise it returns the number of semi continuous variables in the problem object 431 Global function CPXNETcheckcopynet int CPXNETcheckcopynet CPXCENVptr env CPXNETptr net int objsen int nnodes const double supply char nnames int narcs const int fromnode const int tonode const double low const double up const double obj char aname Definition file cplex h The routine CPXNETcheckcopynet performs a consistency check on the arguments passed to the routine CPXNETcopynet The CPXNETcheckcopynet routine has the same argument list as the CPXNETcopynet routine Example status CPXNETcheckcopynet env net CPX_MAX nnodes supply nnames narcs fromnode tonode lb ub obj anames Returns The routine returns zero on success and nonzero if an error occurs 432 Global function CPXgetprotected int CPXgetprotected CPXCENVptr env CPXCLPptr lp int cnt p int indices int
395. integer specifying the end of the range of column names to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the namestore array to hold the names 528 Global function CPXgetrowindex int CPXgetrowindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXget rowindex searches for the index number of the specified row in a CPLEX problem object Example Status CPXgetrowindex env lp resource89 amp rowindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str A row name to search for index p pointer to an integer to hold the index number of the row with name 1name str If the routine is successful index p contains the index number otherwise index p is undefined Returns The routine returns zero if successful and nonzero if an error occurs 529 Global function CPXdelsetrows int CPXdelsetrows CPXCENVptr env CPXLPptr lp int delstat Definition file cplex h The routine CPXdelsetrows deletes a set of rows Unlike the routine CPXdelrows CPXdelsetrows does not require the rows to be in a contiguous range After the deletion occurs the remaining rows are indexed consecutively starting at 0 and
396. integers specifying where the constraint indices for each group begin in the array grpind Its length must be at least grpcnt grpind array of integers containing the indices for the constraints in each group For each of the various types of constraints listed in the table the constraint indices range from 0 zero to the number of constraints of that type minus one Group i contains the constraints with the indices grpind grpbeg i grpind grpbeg i 1 1 for i less than 1 and grpind grpbeg i grpind concnt 1 fori grpcnt 1 Its length must be at least concnt constraint must be referenced more than once in this array For any constraint in the problem that is not a member of a group and thus does not appear in this array the constraint is assigned a default preference of 0 zero Thus such constraints are included in the conflict without any analysis grptype An array of characters containing the constraint types for the constraints as they appear in groups The types of the constraints in group i are specified in grptype grpbeg i grptype grpbeg it 1 1 fori less than grpcnt 1 and grptype grpbeg i grptype concnt 1 fori grpcnt 1 Its length must be at least concnt and every constraint must appear at most once in this array Possible values appear in the table Returns The routine returns zero if successful and nonzero if an error occurs 159 Global function CPXgetbestobj
397. inter to an integer to hold the index number of the filter with name 1name str If the routine is successful index p contains the index number otherwise index p is undefined Returns The routine returns zero on success and nonzero if an error occurs 317 Global function CPXdelfpdest int CPXdelfpdest CPXCENVptr env CPXCHANNELptr channel CPXFILEptr fileptr Definition file cplex h The routine CPXdelfpdest removes a file from the list of message destinations for a channel Failure occurs when the channel does not exist or the file pointer is not in the message destination list Example CPXdelfpdest env mychannel fileptr See 1pex5 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel The pointer to the channel for which destinations are to be deleted CPXFILEptr for the file to be removed from the destination list Returns The routines return zero if successful and nonzero if an error occurs 318 Global function CPXgetorder int CPXgetorder CPXCENVptr env CPXCLPptr lp int cnt p int indices int priority int direction int ordspace int surplus p Definition file cplex h The routine CPXgetorder accesses all the MIP priority order information stored in a CPLEX problem object A priority order is generated if there is no order and parameter CPX PARAM MIPORDTYPE is nonzero Note If the value of or
398. inters to the four default channels created when CPXopenCPLEX is called To manipulate the messages for any of these channels this routine must be called Example Status CPXgetchannels env amp cpxresults amp cpxwarning amp cpxerror amp cpxlog See also 1pex5 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cpxresults A pointer to a variable of type CPXCHANNELptr to hold the address of the channel corresponding to cpxresults May be NULL cpxwarning p A pointer to a variable of type CPXCHANNELptr to hold the address of the channel corresponding to cpxwarning May be NULL cpxerror pointer to a variable of type CPXCHANNELptr to hold the address of the channel corresponding to cpxerror May be NULL cpxlog p A pointer to a variable of type CPXCHANNELpt to hold the address of the channel corresponding to cpxlog May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 279 Global function CPXgetsolnpoolfiltername int CPXgetsolnpoolfiltername CPXCENVptr env CPXCLPptr lp char buf str int bufspace int surplus p int which Definition file cplex h Accesses the name a filter of the solution pool This routine accesses the name of a filter specified by the argument which of the problem object specified by the argument 1p Note If the value of bufspac
399. into the associated optimization routine cbdata A pointer passed from the optimization routine to the user written callback function that identifies the problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value specifying from which optimization algorithm the user written callback function was called Possible values and their meaning appear in the table Value Symbolic Constant Meaning CPX CALLBACK NETWORK From network simplex cbhandle Pointer to user private data as passed to CPXsetnetcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX callback 495 pointer to a user written callback function Setting callback to NULL prevents any callback function from being called during optimization The call to callback occurs after every log message is issued during optimization and periodically during the CPLEX presolve algorithms This function is written by the user cbhandle A pointer to user private data This pointer is passed to the callback function Example Status CPXsetnetcallbackfunc env myfunc NULL See Also CPXgetcallbackinfo CPXsetlpcallbackfunc CPXsetmipcallbackfunc Returns If the operation is successful the routine returns zero if not it returns nonzero to report an error 496 Global function CPXgetquad int CPXgetquad CPXCENVptr env CPXCLPptr lp int
400. ints in QCPs Example status CPXaddqconstr env lp linnzcnt quadnzcnt rhsval sense linind linval quadrow quadcol quadval NULL See also the example qcpex1 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob linnzcnt integer that indicates the number of nonzero constraint coefficients in the linear part of the constraint This specifies the length of the arrays 1inind and linval quadnzcnt An integer that indicates the number of nonzero constraint coefficients in the quadratic part of the constraint This specifies the length of the arrays quadrow quadcol and quadval rhs The righthand side term for the constraint to be added sense The sense of the constraint to be added Note that quadratic constraints may only be less than or equal to or greater than or equal to constraints See the discussion of QCP in the CPLEX User s Manual linind An array that with 1inval defines the linear part of the quadratic constraint to be added linval An array that with 1inind defines the linear part of the constraint to be added The nonzero coefficients of the linear terms must be stored in sequential locations in the arrays 1inind and linval from positions 0 to 1innzcnt 1 Each entry 1inind i indicates the variable index of the corresponding coefficient 1inval i May
401. ion file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetdeletenodecallbackfunc accesses the user written callback to be called during MIP optimization when a node is to be deleted Nodes are deleted when a branch is carried out from that node when the node relaxation is infeasible or when the node relaxation objective value is worse than the cutoff This callback can be used to delete user data associated with a node Example CPXgetdeletenodecallbackfunc env amp current callback amp current cbdata See also Advanced MIP Control Interface in the CPLEX User s Manual For documentation of callback arguments see the routine CPXsetdeletenodecallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX deletenodecallback p The address of the pointer to the current user written delete node callback If no callback has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer See Also CPXsetdeletenodecallbackfunc CPXbranchcallbackbranchbds CPXbranchcallbackbranchcons
402. ironment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob rcnt An integer that specifies the number of new rows to be added to the problem object rhs An array of length rcnt containing the righthand side term for each constraint to be added to the problem object May be NULL in which case the righthand side terms are set to 0 0 for the new constraints sense An array of length rcnt containing the sense of each constraint to be added to the problem object This array may be NULL in which case the sense of each constraint is set to E The values of the elements of this array appear in Table 1 rngval of length rcnt containing the range values for the new constraints If a new constraint has sense i R the value of constraint i be between rhs i and rhsi i rngval i be NULL in which case the range values are all set to zero rowname An array of length rcnt containing pointers to character strings that represent the names of the new rows or equivalently the constraint names May be NULL in which case the new rows are assigned default names if the rows already resident in the problem object have names otherwise no names are associated with the constraints If row names are passed to CPXnewrows but existing constraints have no names assigned default names are created for the existing constraints Returns The routine returns zero if successful and nonzer
403. ironment as returned by CPXopenCPLEX whichparam An integer specifying the symbolic constant or reference number of the desired parameter name str character array that is a pointer to a buffer of length at least CPX STR PARAM to hold the name of the selected parameter Returns The routine returns zero if successful and nonzero if an error occurs 149 Global function CPXcopymipstart int CPXcopymipstart CPXCENVptr env CPXLPptr lp int cnt const int indices const double values Definition file cplex h This routine is deprecated See CPXaddmipstarts instead to add multiple MIP starts to CPLEX problem object The routine CPXcopymipstart copies start values to a CPLEX problem object of type MILP MIQP CPXPROB MIQCP MIP start values may be specified for any subset of the integer or continuous variables in the problem When optimization begins or resumes CPLEX attempts to find a feasible MIP solution that is compatible with the set of values specified in the MIP start When a partial MIP start is provided CPLEX tries to extend it to a complete solution by solving a MIP over the variables whose values are not specified in the MIP start The parameter CPX PARAM SUBMIPNODELIM controls the amount of effort CPLEX expends in trying to solve this secondary If CPLEX is able to find a complete feasible solution that solution becomes the incumbent If the specified MI
404. itly with default supply values 0 The size of the tonode array must be at least narcs low Pointer to an array of lower bounds on the flow through added arcs If NULL is passed all lower bounds default to O zero Otherwise the size of the array must be at least narcs Values less than or equal to INFBOUND are considered as negative infinity up Pointer to an array of upper bounds on the flow of added arcs If NULL is passed all upper bounds default to CPX_INFBOUND Otherwise the size of the array must be at least narcs Values greater than or equal to INFBOUND are considered as infinity obj Pointer to an array of objective values for the added arcs If NULL is passed all objective values default to 0 Otherwise the size of the array must be at least narcs anames Pointer to an array of names for added arcs If NULL is passed and the existing arcs have names default names are assigned to the added arcs If NULL is passed and the existing arcs have no names the new arcs are assigned no names Otherwise the size of the array must be at least narcs and every name in the array must be a string terminating in 0 If the existing arcs have no names and anames is not NULL default names are assigned to the existing arcs Returns The routine returns zero on success and nonzero if an error occurs 365 Global function CPXhybnetopt int CPXhybnetopt CPXCENVptr env CPXLPptr lp int method Definition file cplex
405. ization after CPXfeasopt and its extensions after CPXrefineconflict its extensions Example lpstat CPXgetstat env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns the solution status of the most recent optimization performed on the CPLEX problem object Nonzero return values are shown in the group optim cplex solutionstatus A return value of 0 zero specifies either an error condition or that a change to the most recently optimized problem may have invalidated the solution status For status code CPX STAT NUM BEST the algorithm could not converge to the requested tolerances due to numeric difficulties The best solution found can be retrieved by the routine CPXsolution Similarly when an abort status is returned the last solution computed before the algorithm aborted can be retrieved by CPXsolution Use the query routines CPXsolninfo and CPXsolution to obtain further information about the current solution of an LP QP or QCP 441 Global function CPXtightenbds int CPXtightenbds CPXCENVptr env CPXLPptr lp int cnt const int indices const char lu const double Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect b
406. l function 360 Global function 361 Global function 362 Global function CPXsetdefaullts 4 onsin sapan oranes annaa Kanonak re aooaa ea eerie nu Canned ee sra nen pieds 363 Global function 364 Global function CPXNETaddarcs 2 erre Leer terrere recoge rea 365 Global function 366 Global function 367 Global function 5 368 Global 2 2223 Dile ee eec lites 369 Global function 371 Global function 372 Global function CPX A e 373 Global function 374 Global function 376 Global function 377 Global function 378
407. le CPXgetcallbacknodeinfo returns the value CPXERR NODE DISK Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback seqid The sequence number of the node for which information is requested whichinfo An integer specifying which information is requested For a summary of possible values refer to the table titled Information Requested for a User Written Node Callback in the description of CPXgetcallbacknodeinfo result p generic pointer to a variable of type double or int The variable represents the value returned by whichinfo The column C in the table titled Information Requested for a User Written Node Callback shows the type of various values returned by whichinfo Returns The routine returns zero if successful and nonzero if an error occurs The return value CPXERR DISK reports an attempt to access a node currently located in a node file on disk 473 Global function CPXsetincumbentcallbackfunc int CPXsetincumbentcallbackfunc CPXENVptr env int CPXPUBLIC incumbentcallback CALLBACK INCUMBENT ARGS void cbhandle Definition file cplex h N
408. le cplex h The routine CPXcopynettolp copies a network problem stored in a network problem object to a CPLEX problem object as an LP Any problem data previously stored in the CPLEX problem object is overridden Example Status CPXcopynettolp env lp net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob net A pointer to a CPLEX network problem object containing the network problem to be copied Returns The routine returns zero if successful and nonzero if an error occurs 332 Global function CPXgetindconstrname int CPXgetindconstrname CPXCENVptr env CPXCLPptr lp char buf str int bufspace int surplus p int which Definition file cplex h The routine CPXgetindconstrname accesses the name of a specified indicator constraint of a CPLEX problem object Note If the value of bufspace is 0 then the negative of the value of surplus p returned specifies the total number of characters needed for the array str Example Status CPXgetindconstrname env lp indname lenindname amp surplus 5 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob buf str A pointer to a buffer of size bufspace May be NULL if bufspace is 0 bufspace An integer specifying the length of the array str M
409. le Library Function Summary CPXcloseCPLEX CPXopenCPLEX CPXsetterminate These utilities initialize and close the CPLEX environment 48 Group optim cplex callable writefiles The routines in the CPLEX Callable Library to write files Function Summary CPXdperwrite CPXdualwrite CPXembwrite CPXfltwrite CPXmbasewrite CPXmstwrite CPXmstwritesolnpool CPXmstwritesolnpoolall CPXNETbasewrite CPXNETwriteprob CPXordwrite CPXpperwrite CPXpreslvwrite CPXsolwrite CPXsolwritesolnpool CPXsolwritesolnpoolall CPXwritemipstarts CPXwriteprob These routines write a problem object or after the problem has been optimized they write the optimal basis or solution report to a file 49 Group optim cplex callable writenetworkfiles The routines in the CPLEX Callable Library to write network files Function Summary CPXNETbasewrite CPXNETwriteprob These routines write a network problem object or after the network problem has been optimized they write the optimal basis or solution report to a file 50 Group optim cplex errorcodes The Callable Library macros that define error codes their symbolic constants their short message strings and their explanations There is a key to the symbols in the short message strings after the table 1606 Lines d d Adjacent sign and quadratic character 1604 Lines d d Adjacent sign and sense 1602 Lines 0 Adjacent signs CPXERR_ALGNOTLICENSED 22050 problem Optimi
410. le Library routines instead The routine CPXdjfrompi computes an array of reduced costs from an array of dual values This routine is for linear programs Use CPXqpdj rompi for quadratic programs Example status CPXdjfrompi env lp pi dj Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob pi array that contains dual solution pi values for the problem as returned by routines such as CPXuncrushpi and CPXcrushpi The array must be of length at least the number of rows in the problem object dj Anarray to receive the reduced cost values computed from the values for the problem object The array must be of length at least the number of columns in the problem object Returns The routine returns zero if successful and nonzero if an error occurs 153 Global function CPXchgrhs int CPXchgrhs CPXCENVptr env CPXLPptr lp int cnt const int indices const double values Definition file cplex h The routine CPXchgrhs changes the righthand side coefficients of a set of linear constraints in the CPLEX problem object Example Status CPXchgrhs env lp cnt indices values Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer that specifies the total number of righthand side coef
411. le Library to manage parameters that is set parameters get current values of parameters and get information about parameters Function Summary CPXgetchgparam CPXgetdblparam CPXgetintparam CPXgetparamname CPXgetparamnum CPXgetparamtype CPXgetstrparam CPXinfodblparam CPXinfointparam CPXinfostrparam CPXreadcopyparam CPXsetdblparam CPXsetdefaults CPXsetintparam CPXsetstrparam CPXwriteparam These routines are used to set parameters that control various aspects of CPLEX behavior and to find out current default and allowed values for parameters For more information about parameters see the CPLEX Parameters Reference Manual 30 Group optim cplex callable message The CPLEX Callable Library routines for managing messages CPXaddchannel CPXaddfpdest CPXaddfuncdest CPXdelchannel CPXdelfpdest Function Summary CPXdelfuncdest CPXdisconnectchannel CPXflushchannel CPXflushstdchannels CPXgetchannels CPXgeterrorstring CPXgetlogfile CPXmsg CPXsetlogfile These routines make it possible for your application to control which messages from CPLEX appear on screen which are sent to files They also provide support for you to create your own messages 31 Group optim cplex callable modifynetwork The routines in the CPLEX Callable Library to modify a network CPXNETchgarcname CPXNETchgarcnodes CPXNETchgbds CPXNETchgname CPXNETchgnodename Function Summary CPXNETchgobj CPXNETchgobjsen CPXNETchgsup
412. le takes a value within its bounds but it does not check for integer feasibility in the case of integer variables For each variable the infeasibility value returned is O zero if the variable bounds are satisfied Otherwise if the infeasibility value is negative it specifies the amount by which the lower bound or semi continuous lower bound in case of a semi continuous or semi integer variable of the variable must be changed to make the queried solution valid If the infeasibility value is positive it specifies the amount by which the upper bound of the variable must be changed Example status CPXgetcolinfeas env lp NULL infeasout 0 CPXgetnumcols env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob x The solution whose infeasibility is to be computed May be NULL in which case the resident solution is used infeasout An array to receive the infeasibility value for each of the variables This array must be of length at least end begin 1 begin An integer specifying the beginning of the range of variables whose infeasibility is to be returned end An integer specifying the end of the range of variables whose infeasibility is to be returned Returns The routine returns zero if successful and nonzero if an error occurs 90 Global function CPXdelcols int CPXdelcols CPXCENVptr env CPXLPptr lp int begi
413. least concnt and a constraint must not be referenced more than once in this array If a constraint does not appear in this array the constraint will not be relaxed An array of characters containing the constraint types for the constraints as they appear in groups The types of the constraints in group i are specified in grptype grpbeg i grptype grpbeg it 1 1 fori less than grpcnt 1 and grptype grpbeg i grptype concnt 1 fori grpcnt 1 lts length must be at least concnt and every constraint must appear at most once in this array Possible values appear in Table 1 Returns The routine returns zero if successful and nonzero if an error occurs 357 Global function CPXgetnumbin int CPXgetnumbin CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumbin accesses the number of binary variables in a CPLEX problem object Example numbin CPXgetnumbin env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example numbin CPXgetnumbin env lp Returns If the problem object or environment does not exist CPXgetnumbin returns zero Otherwise it returns the number of binary variables in the problem object 358 Global function CPXhybbaropt int CPXhybbaropt CPXCENVptr env CPXLPptr lp int method Definition file cplex h The routine CPXhybbaropt may be use
414. lem object An argument to CPXcopyob jname defines the objective name Example status CPXcopyobjname env lp Cost Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob objname str A pointer to a character string containing the objective name Returns The routine returns zero if successful and nonzero if an error occurs 87 Global function CPXgetsolnpoolmipstart int CPXgetsolnpoolmipstart CPXCENVptr env CPXCLPptr lp int soln int cnt p int indices double value int mipstartspace int surplus Definition file cplex h This routine is deprecated Use CPXgetmipstarts instead The routine CPXgetsolnpoolmipstart accesses MIP start information stored in the solution pool of a CPLEX problem object Values are returned for all integer binary semi continuous and nonzero SOS variables Note If the value of mipstartspace is 0 zero then the negative of the value of surplus p returned specifies the length needed for the arrays indices and values Example Status CPXgetsolnpoolmipstart env lp 5 amp listsize indices values numcols amp surplus See Also CPXgetmipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool member
415. lex h The routine CPXgetqconstrinfeas computes the infeasibility of a given solution for a range of quadratic constraints The beginning and end of the range must be specified For each constraint the infeasibility value returned is 0 zero if the constraint is satisfied Otherwise the infeasibility value returned is the amount by which the righthand side of the constraint must be changed to make the queried solution valid It is positive for a less than or equal to constraint and negative for a greater than or equal to constraint Example status CPXgetqconstrinfeas env lp NULL infeasout 0 CPXgetnumqconstrs env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob X The solution whose infeasibility is to be computed May be NULL in which case the resident solution is used infeasout An array to receive the infeasibility value for each of the quadratic constraints This array must be of length atleast end begin 1 begin An integer indicating the beginning of the range of quadratic constraints whose infeasibility is to be returned Returns The routine returns zero if successful and nonzero if an error occurs 161 Global function CPXgetmipstartindex int CPXgetmipstartindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXgetmipstartindex searc
416. lex h The routine CPXgetsolnpoolnumreplaced accesses the number of solutions replaced in the solution pool Example numrep CPXgetsolnpoolnumreplaced env 1p See also the example populate c in the the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the CPLEX problem object or environment does not exist CPXgetsolnpoolnumreplaced returns the value 0 zero otherwise it returns the number of solutions which were replaced 466 Global function CPXgetcallbacknodestat int CPXgetcallbacknodestat CPXCENVptr env void cbdata int wherefrom int nodestat p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacknodestat retrieves the optimization status of the subproblem at the current node from within a user written callback during MIP optimization The optimization status will be either optimal or unbounded An unbounded status can occur when some of the constraints are being treated as lazy cons
417. lex solutionquality The Callable Library macros that indicate the qualities of a solution their symbolic constants and their meaning Methods for accessing solution quality are mentioned after the table Macro Summary CPX DUAL OBJ CPX KAPPA CPX MAX INDSLACK INFEAS CPX MAX PI CPX MAX PRIMAL INFEAS CPX MAX PRIMAL RESIDUAL CPX MAX QCPRIMAL RESIDUAL CPX MAX QCSLACK INFEAS CPX MAX SCALED DUAL INFEAS CPX MAX SCALED DUAL RESIDUAL CPX MAX SCALED PRIMAL INFEAS CPX MAX SCALED PRIMAL RESIDUAL CPX MAX SCALED X CPX MAX X CPX OBJ GAP CPX SUM DUAL INFEAS CPX SUM DUAL RESIDUAL CPX SUM INDSLACK INFEAS Concert Technology enum MaxX CPX SUM PI CPX SUM PRIMAL INFEAS CPX SUM PRIMAL RESIDUAL CPX SUM QCPRIMAL RESIDUAL Concert Technology enum not applicable 58 SUM QCSLACK SUM QCSLACK INFEAS CPX SUM RED COST CPX SUM SCALED DUAL INFEAS CPX SUM SCALED DUAL RESIDUAL Concert Technology enum SumSlack Concert Technology enum not applicable Concert Technology enum SumRedCost Concert Technology enum SumScaledDuallnfeas CPX SUM SCALED PI CPX SUM SCALED PRIMAL INFEAS CPX SUM SCALED PRIMAL RESIDUAL CPX SUM SCALED RED COST CPX SUM SCALED SLACK CPX SUM SCALED X CPX SUM SLACK Concert Technology enum SumScaledPrimallnfeas Concert Technology enum SumScaledPrimalResidual Concert Technology enum SumScaledRedCost Concert Technology enum SumScaledDualResidual Concert Technolog
418. ling CPXcheckcopylp during application development Example Status CPXcopylp env lp numcols numrows objsen obj rhs sense matbeg matcnt matind matval lb ub rngval See also the example 1pex1 c in the CPLEX User s Manual and in the standard distribution 523 Parameters env numcols numrows objsense objective rhs sense matbeg matind matval ub rngval Returns A pointer to the CPLEX environment as returned by CPXopenCPLEX A pointer to a CPLEX problem object as returned by CPXcreateprob An integer that specifies the number of columns in the constraint matrix or equivalently the number of variables in the problem object An integer that specifies the number of rows in the constraint matrix not including the objective function or bounds on the variables An integer that specifies whether the problem is a minimization or maximization problem An array of length at least numcols containing the objective function coefficients An array of length at least numrows containing the righthand side value for each constraint in the constraint matrix An array of length at least numrows containing the sense of each constraint in the constraint matrix An array that with matval matcnt and mat ind defines the constraint matrix An array that with matbeg matval and matind defines the constraint matrix An array that with matbeg matcnt and matval defines the constraint matrix
419. ll called This routine works in the same way as the routine CPXget 1pcallbackfunc It enables the user to create separate callback function to be called during the solution of a network problem The prototype for the callback function is identical to that of CPXgetlpcallbackfunc Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the optimization Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata A pointer passed from the optimization routine to the user written callback function that identifies the problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value specifying which optimization algorithm the user written callback function was called from Possible values and their meaning appear in the table Value Symbolic Constant Meaning CPX CALLBACK NETWORK From network simplex cbhandle Pointer to user private data as passed to CPXsetl1pcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX callback 507 The address of the pointer to the current user written callback function If no callback function has been set the pointer evaluates to NULL cbhandle p The address o
420. lled This value will always be CPX CALLBACK TUNING for this callback cbhandle Pointer to user private data as passed to CPXsettuningcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX myfunc A pointer to a user written callback function Setting callback to NULL prevents any callback function from being called during tuning The call to callback occurs before each trial run of the tuning This function is written by the user its prototype is documented here cbhandle A pointer to user private data This pointer is passed to the callback function Example Status CPXsettuningcallbackfunc env myfunc NULL 257 See Also CPXgetcallbackinfo Returns The routine returns zero if successful and nonzero if an error occurs 258 Global function CPXNETgetarcname int CPXNETgetarcname CPXCENVptr env CPXCNETptr net char nnames char namestore int namespc int surplus p int begin int end Definition file cplex h The routine CPXNETgetarcname is used to access the names of a range of arcs in a network stored in a network problem object The beginning and end of the range along with the length of the array in which the arc names are to be returned must be specified Example status CPXNETgetarcname env net nnames namestore namespc amp surplus 0 narcs 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX
421. lls to CPXbranchcallbackbranchbds 3 CPX CALLBACK NO SPACE Allocate more space and call callback again See Also CPXsetbranchcallbackfunc Returns This routine does not return a result 197 Global function CPXaddfpdest int CPXaddfpdest CPXCENVptr env CPXCHANNELptr channel CPXFILEptr fileptr Definition file cplex h The routine CPXaddfpdest adds a file to the list of message destinations for a channel The destination list for all CPLEX defined channels is initially empty Example CPXaddfpdest env mychannel fileptr See 1pex5 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel A pointer to the channel for which destinations are to be added fileptr A pointer to the file to be added to the destination list Before calling this routine obtain this pointer with a call to CPXfopen Returns The routine returns zero if successful and nonzero if an error occurs 198 Global function CPXgetnodeleftcnt int CPXgetnodeleftcnt CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnodeleftcnt accesses the number of unexplored nodes left in the branch and cut tree Example nodes left CPXgetnodeleftcnt env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If
422. lp double z Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXget ray finds an unbounded direction also known as a ray for a linear program where the CPLEX simplex optimizer concludes that the LP is unbounded solution status CPX STAT UNBOUNDED An error is returned CPXERR UNBOUNDED if this case does not hold As an illustration consider a linear program of the form Minimize cx Subject to Ax b x gt 0 where specifies the transpose If the CPLEX simplex algorithm completes optimization with a solution status of CPX_STAT_UNBOUNDED the vector z returned by CPXget ray would satisfy the following ez x Az gt 0 0 if computations could be carried out in exact arithmetic Example Status CPXgetray env lp z Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to the CPLEX LP problem object as returned by CPXcreateprob 2 array where the unbounded direction is returned This array must be at least as large as the number of columns in the problem o
423. lue is computed by bestinteger bestobjective 1 10 bestobjective where best integer is the value returned by CPXgetob jval and bestobjective is the value returned by CPXgetbestobjval For a maximization problem the value is computed by bestobjective bestinteger 1 10 bestobjective Example Status CPXgetmiprelgap env lp amp gap Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob gap p A pointer to the location where the relative mip gap is returned Returns The routine returns zero if successful and nonzero if an error occurs 64 Global function CPXkillpnorms void CPXkillpnorms CPXLPptr lp Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXkillpnorms deletes any primal steepest edge norms that have been retained relative to an active basis If the user believes that the values of these norms may be significantly in error and the setting of the parameter PARAM PPRIIND S CPX PPRIIND STEEP calling CPXkill
424. m This routine may be called only when the value of the wherefrom argument is one of the following CPX CALLBACK MIP CPX CALLBACK MIP BRANCH CPX CALLBACK MIP INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT Example Status CPXgetcallbackgloballb env cbdata wherefrom glb 0 cols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback Ib An array to receive the values of the global lower bound values This array must be of length at least end begin 1 If successful 15 0 through 1 end begin contain the global lower bound values begin An integer specifying the beginning of the range of lower bound values to be returned end An integer specifying the end of the range of lower bound values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 326 Global function CPXgetqconstrindex int CPXgetqconstrindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h T
425. m OptimalRelaxedinf This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to CPX FEASOPT or Opt Inf on continuous problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is optimal 603 Macro CPX STAT OPTIMAL RELAXED QUAD Definition file cplex h CPX STAT OPTIMAL RELAXED QUAD 19 Simplex or Barrier enum OptimalRelaxedQuad This status occurs only after call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter CPX FEASOPTMODE or FeasOptMode set to CPX FEASOPT OPT QUAD Or OptQuad on a continuous problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is optimal 604 Macro CPX STAT OPTIMAL RELAXED SUM Definition file cplex h CPX STAT OPTIMAL RELAXED SUM 15 Simplex or Barrier enum OptimalRelaxedSum This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method feasOpt with the parameter PARAM FEASOPTMODE or FeasOptMode set to CPX FEASOPT SUM or Opt Sum a continuous problem A relaxation was successfully found and
426. m modification routines The arguments to CPXsolninfo are pointers to locations where data are to be written Such data can include the optimization method used to produce the current solution the type of solution available and what is known about the primal and dual feasibility of the current solution If any piece of information represented by an argument to CPXsolninfo is not required a NULL pointer can be passed for that argument Example Status CPXsolninfo env lp amp solnmethod amp solntype amp pfeasind amp dfeasind See also the topic nterpreting Solution Quality in the CPLEX User s Manual for information about how CPLEX determines primal or dual infeasibility Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob solnmethod p A pointer to an integer specifying the method used to produce the current solution The specific values which so1nmethod p can take and their meanings are the same as the return values documented for CPXgetmethod solntype p A pointer to an integer variable specifying the type of solution currently available Possible return values are CPX BASIC SOLN SOLN CPX PRIMAL SOLN and CPX NO SOLN meaning the problem either has a simplex basis has a primal and dual solution but no basis has a primal solution but no corresponding dual solution or has no solution respectively
427. make the problem unsolvable Further changes to the quadratic coefficients may then be required to restore the convexity concavity of a minimization maximization problem Values of maxormin CPX MIN 1 new sense is minimize CPX MAX 1 new sense is maximize Example CPXchgobjsen env lp CPX MAX Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob maxormin An integer that specifies the new sense of the problem Returns This routine does not return a result 469 Global function CPXchgprobtype int CPXchgprobtype CPXCENVptr env CPXLPptr lp int type Definition file cplex h The routine CPXchgprobt ype changes the current problem to a related problem The problem types that can be used appear in the table Table 1 Problem Types Linear program no ctype or quadratic data stored ROB_MILP Problem with ct ype information ROB_FIXEDMILP Problem with ctype information integer variables fixed Ri O s ion vi eos a tain rera e B Problem with quadratic data stored Problem with quadratic constraints Problem with quadratic constraints and ctype information A mixed integer problem MILP CPXPROB MIQP CPXPROB be changed to a fixed problem CPXPROB FIXEDMILP FIXEDMIQP Or CP
428. mber of trial runs with a variety parameter settings Parameters and associated values which should not be changed by the tuning process known as the fixed parameters can be specified as arguments This routine does not apply to network models nor to quadratically constrained programming problems QCP After CPXtuneparam has finished the environment will contain the combined fixed and tuned parameter settings which the user can query or write to a file The problem object will not have a solution The parameter PARAM TUNINGREPEAT specifies how many problem variations for CPLEX to try while tuning Using a number of variations can give more robust results when tuning is applied to a single problem The tuning evaluation measure is meaningful only when CPX PARAM TUNINGREPEAT is larger than one All callbacks except the tuning informational callback will be ignored Tuning will monitor the value set by CPXsetterminate and terminate when this value is set A few of the parameter settings in the environment control the tuning process They are specified in the table other parameter settings in the environment are ignored CPX PARAM TUNI NGMEASURE Controls the tuning evaluation measure PARAM TUNINGREPEAT Sets the number of repeated problem variations PX PARAM TUNI Controls the level of the tuning display The value tunestat is 0 zero when tuning has completed and
429. mbination of some variables in the original problem 293 For row i in the original problem values for orstat i appear Table 5 Table 5 Values for orstat if row i the presolved problem corresponds to row orstat i in the original problem if row i is created by for example merging two rows in the original problem Example status CPXgetprestat env lp amp presolvestat precstat prerstat origcstat origrstat See also admipex6 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX pointer to the original CPLEX LP problem object as returned by CPXcreateprob prestat p A pointer to an integer that will receive the status of the presolved problem associated with LP problem object May be NULL pcstat The array where the presolve status values of the columns are to be returned The array must be of length at least the number of columns in the original problem object May be NULL prstat The array where the presolve status values of the rows are to be returned The array must be of length at least the number of rows in the original problem object May be NULL ocstat The array where the presolve status values of the columns of the presolved problem are to be returned The array must be of length at least the number of columns in the presolved problem object May be NULL orstat The array where the presolve status values of t
430. mount of insufficient space in the array buf_str Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the buf_str array to hold the objective name 120 Global function CPXpopulate int CPXpopulate CPXCENVptr env CPXLPptr lp Definition file cplex h The routine CPXpopulate generates multiple solutions to a mixed integer programming MIP problem The algorithm that populates the solution pool works in two phases In the first phase it solves the problem to optimality or some stopping criterion set by the user while it sets up a branch and cut tree for the second phase In the second phase it generates multiple solutions by using the information computed and stored in the first phase and by continuing to explore the tree The amount of preparation in the first phase and the intensity of exploration in the second phase are controlled by the solution pool intensity parameter PARAM SOLNPOOLINTENSITY Optimality is not a stopping criterion for the populate procedure Even if the optimality gap is zero this routine will still try to find alternative solutions The stopping criteria for CPXpopulate are these e Populate limit POPULATELIM This parameter controls how many solutions are generated before stopping Its default value is 20 Time limit PA
431. ms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXget callbacknodeinfo is called from within user written callbacks during a MIP optimization and accesses information about nodes The node information is from the original problem if the parameter CPX PARAM is turned off set to CPX OFF Otherwise the information is from the presolved problem The primary purpose of this routine is to examine nodes in order to select one from which to proceed In this case the wherefrom argument is CALLBACK NODE and a node with any nodeindex value can be queried A secondary purpose of this routine is to obtain information about the current node When the wherefrom argument is any one of the following values only the current node can be queried CALLBACK CUT CALLBACK INCUMBENT CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CPX CALLBACK MIP BRANCH To query the current node specify a nodeindex value of 0 Other values of the wherefrom argument are invalid for this routine An invalid nodeindex value or wherefrom argument value will result in an error return value Note The values returne
432. msgfunction A pointer to the function to be called when a message is sent to a channel See Also CPXdelfuncdest Returns The routine returns zero if successful and nonzero if an error occurs Failure occurs when msgfunction is not in the message destination list or the channel does not exist 62 Global function CPXmstwrite int CPXmstwrite CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h This routine is deprecated Use CPXwritemipstarts instead The routine CPXmstwrite writes the incumbent MIP start to a file in MST format The MST format is an XML format and is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly See Also CPXwritemipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the incumbent MIP start information should be written Returns The routine returns zero if successful and nonzero if an error occurs 63 Global function CPXgetmiprelgap int CPXgetmiprelgap CPXCENVptr env CPXCLPptr lp double gap Definition file cplex h The routine CPXgetmiprelgap accesses the relative objective gap for a MIP optimization For a minimization problem this va
433. mychannel Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel A pointer to the channel containing the message destinations to be flushed Returns This routine does not return a value 355 Global function CPXfeasoptext int CPXfeasoptext CPXCENVptr env CPXLPptr lp int grpcnt int concnt const double grppref const int grpbeg const int grpind const char grptype Definition file cplex h The routine CPX easoptext extends CPXfeasopt in several ways Unlike CPX easopt CPXfeasoptext enables the user to relax quadratic constraints and indicator constraints In addition it allows the user to treat a group of constraints as a single constraint for the purposes of determining the penalty for relaxation Thus according to the various INF relaxation penalty metrics see CPXfeasopt for a list of the available metrics all constraints in a group can be relaxed for a penalty of one unit Similarly according to the various QUAD metrics the penalty of relaxing a group grows as the square of the sum of the individual member relaxations rather than as the sum of the squares of the individual relaxations If you use INF mode the resulting feasopt problems will be MIPs even if your problem is continuous Similarly if you use QUAD mode the feasopt problems will become quadratic even if your original problem is linear This difference can result in greater than expected solve times The
434. n const double obj const double rhs const char sense const int matbeg const int matcnt const int matind const double matval const double lb const double ub const double rngval Definition file cplex h The routine CPXcheckcopylp validates the arguments of the corresponding CPXcopylp routine This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To call this routine you must compile and link check with your program as well as the CPLEX Callable Library The CPXcheckcopylp routine has the same argument list as the routine The second argument lp is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the problem For most user applications this distinction is unimportant Example Status CPXcheckcopylp env lp numcols numrows objsen obj rhs sense matbeg matcnt matind matval lb ub rngval Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 415 Global function CPXwriteprob int CPXwriteprob CPXCENVptr env CPXCLPptr lp const char filename str const char filetype str Definition file cplex h The routine CPXwriteprob writes a CPLEX problem object to a file in one of the formats in the table These formats are documented in the CPLEX File F
435. n int end Definition file cplex h The routine CPXdelcols deletes all the columns in a specified range The range is specified using a lower and an upper index that represent the first and last column to be deleted respectively The indices of the columns following those deleted are decreased by the number of columns deleted Example status CPXdelcols env lp 10 20 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob begin An integer that specifies the numeric index of the first column to be deleted end integer that specifies the numeric index of the last column to be deleted Returns The routine returns zero if successful and nonzero if an error occurs 91 Global function CPXslackfromx int CPXslackfromx CPXCENVptr env CPXCLPptr lp const double x double slack Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXslackfromx computes an array of slack values from primal solution values Example Status CPXslackfromx e
436. n CPXbranchcallbackbranchconstraints int CPXbranchcallbackbranchconstraints CPXCENVptr env void cbdata int wherefrom double nodeest int rcnt int nzcnt const double rhs const char sense const int rmatbeg const int rmatind const double rmatval void userhandle int seqnum p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbranchcallbackbranchconstraints specifies the branches to be taken from the current node when the branch is specified by adding one or more constraints to the node problem It may be called only from within a user written branch callback function Constraints are in terms of the original problem if the parameter PARAM MIPCBREDLP is set to OFF before the call to CPXmipopt that calls the callback Otherwise constraints are in terms of the presolved problem Table 1 Values of sense i less than or equal to constraint equal to constraint G greater than or equal to constraint Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed t
437. n CPXgetdsbcnt int CPXgetdsbent CPXCENVptr env CPXCLPptr 1 Definition file cplex h The routine CPXgetdsbcnt accesses the number of dual super basic variables in the current solution Example dsbcnt CPXgetdsbcnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example dsbcnt CPXgetdsbcnt env lp Returns If a solution exists CPXgetdsbcnt returns the number of dual super basic variables If no solution exists CPXgetdsbont returns the value 0 zero 444 Global function CPXchgprobtypesolnpool int CPXchgprobtypesolnpool CPXCENVptr env CPXLPptr lp int type int soln Definition file cplex h The routine CPXchgprobtypesolnpool changes the current problem if it is a mixed integer problem to a related fixed problem using a solution from the solution pool The problem types that can be used appear in the table Table 1 Problem Types Problem with ctype information integer variables fixed a cexeRoB FIXEDMIQP Problem with quadratic data and ct ype information integer variables fixed A mixed integer problem MILP CPXPROB can be changed to a fixed problem CPXPROB FIXEDMILP CPXPROB FIXEDMIQP where bounds on integer variables are fixed to the values attained in the integer solution Example status CPXchgprobtypesolnpool env lp 1 CPXPROB
438. n file cplex h CPXERR NOT MILPCLASS 1024 Not a MILP or fixed MILP Function requires that problem type must be CPXPROB MILP or CPXPROB FIXEDMILP 775 Macro MIN COST FLOW Definition file cplex h CPXERR NOT MIN COST FLOW 1531 Not a min cost flow problem Check the MIN format file for errors 776 Definition file cplex h CPXERR NOT MIP 3003 Not a mixed integer problem The requested operation can be performed only on a mixed integer problem 777 Macro CPXERR NOT MIQPCLASS Definition file cplex h CPXERR NOT MIQPCLASS 1029 Not a or fixed MIQP Function requires that problem type be CPXPROB MIQP CPXPROB_FIXEDMIQP that is it has a quadratic objective 778 Macro CPXERR NOT ONE PROBLEM Definition file cplex h CPXERR NOT ONE PROBLEM 1023 Not a single problem No problem available or problem is fixed and the operation is inappropriate for this types of problem 779 Definition file cplex h CPXERR NOT 5004 Not a quadratic program The requested operation can be performed only on a quadratic problem 780 Macro NOT SAV FILE Definition file cplex h CPXERR NOT SAV FILE 1560 File 968 is not SAV file The selected file does not match the type specified 781 Macro CPXERR UNBOUNDED Definition file cplex h CPXERR NOT UNBOUNDED 1254 Unbounded
439. n routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass it to the callback information routines wherefrom An integer value reporting where in the optimization this function was called It has the value CPX CALLBACK MIP CUT cbhandle A pointer to user private data useraction p A pointer to an integer specifying the action for CPLEX to take at the completion of the user callback The table summarizes possible actions Actions to be Taken After a User Written Cut Callback Value Symbolic Constant 0 CPX CALLBACK DEFAULT Use cuts as added 1 CPX CALLBACK FAIL Exit optimization 2 CPX CALLBACK SET Use cuts as added Returns The routine returns zero if successful and nonzero if an error occurs 343 Global function CPXsetstrparam int CPXsetstrparam CPXENVptr env int whichparam const char newvalue str Definition file cplex h The routine CPXsetstrparam sets the value of a CPLEX string parameter Example Status CPXsetstrparam env CPX PARAM WORKDIR mydir Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter to change newvalue str The new value of the parameter The maximum length of newvalue str including the NULL terminator the character 0 or char 0 is CPX STR PARAM MAX defined in cplex h Setting newvalue str
440. n routines The arguments to CPXsolution are pointers to locations where data are to be written Such data can include the status of the optimization the value of the objective function the values of the primal variables the dual variables the slacks and the reduced costs All of that data exists after a successful call to one of the LP or QP optimizers However dual variables and reduced costs are not available after a successful call of the QCP or MIP optimizers If any part of the solution represented by an argument to CPXsolution is not required that argument be passed with the value NULL in a call to CPXsolution If only one part is required it may be more convenient to use the CPLEX routine that accesses that part of the solution individually CPXget stat CPXgetobjval CPXgetx CPXgetpi CPXgetslack Or CPXgetdj For barrier the solution values for x pi slack and dj correspond to the last iterate of the primal dual algorithm independent of solution status If optimization stopped with an infeasible solution take care to interpret the meaning of the values in the returned arrays as described in the Parameters section Example Status CPXsolution env lp amp lpstat amp objval x slack dj See also the example 1pex1 c in the CPLEX User s Manual and in the standard distribution See Also CPXsolninfo Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a C
441. n the CPLEX problem object Example status CPXdualopt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object CPXERR NO PROBLEM Exceeding a user specified CPLEX limit is not considered an error Proving the problem infeasible or unbounded is not considered an error A zero return value does not necessarily mean that a solution exists Use query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 501 Global function CPXNETgetsupply int CPXNETgetsupply CPXCENVptr env CPXCNETptr net double supply int begin int end Definition file cplex h The routine CPXNETget supply is used to obtain supply values for a range of nodes in the network stored CPLEX network problem object Example status CPXNETgetsupply env net supply 0 CPXNETgetnumnodes env net 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob supply Place where requested supply values are copied If NULL is passed no su
442. nCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob begin An integer that specifies the numeric index of the first indicator constraint to be deleted end integer that specifies the numeric index of the last indicator constraint to be deleted Returns The routine returns zero if successful and nonzero if an error occurs 132 Global function CPXgetnumrows int CPXgetnumrows CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumrows accesses the number of rows in the constraint matrix not including the objective function quadratic constraints or the bounds constraints on the variables Example cur numrows CPXgetnumrows env lp See also the example 1pex1 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the CPLEX problem object or environment does not exist CPXget numrows returns the value 0 zero otherwise it returns the number of rows 133 Global function CPXNETgetstat int CPXNETgetstat CPXCENVptr env CPXCNETptr net Definition file cplex h The routine CPXNETgetstat returns the solution status for a network problem object Example netstatus CPXNETgetstat env net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A
443. nCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The values returned by CPXgetprobtype appear in the table 170 Global function CPXsetinfocallbackfunc int CPXsetinfocallbackfunc CPXENVptr env int CPXPUBLIC callback CPXCENVptr void int void void cbhandle Definition file cplex h The routine CPXsetinfocallbackfunc sets the user written callback routine that CPLEX calls regularly during the optimization of a mixed integer program and during certain cut generation routines This routine enables the user to create a separate callback function to be called during the solution of mixed integer programming problems MIPs Unlike any other callback routines this user written callback function only retrieves information about MIP search It does not control the search though it allows the search to terminate The user written callback function is allowed to call only two other routines CPXgetcallbackinfo and CPXgetcallbackincumbent The prototype for the callback function is identical to that of CPXsetmipcallbackfunc Example status CPXsetinfocallbackfunc env mycallback NULL Parameters env A pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines callback A pointer to a user written callback function Setting callback to NULL will prevent any callback function from being called during optimization The call to callback will occur after every
444. nCPLEX terminate p A pointer to the termination signal Returns The routine returns zero if successful and nonzero if an error occurs 119 Global function CPXgetobjname int CPXgetobjname CPXCENVptr env CPXCLPptr lp char buf str int bufspace int surplus p Definition file cplex h The routine CPXgetob jname accesses the name of the objective row a CPLEX problem object Note If the value of bufspace is 0 then the negative of the value of surplus p returned specifies the total number of characters needed for the array str Example status CPXgetobjname env lp cur objname lenname amp surplus Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob buf str A pointer to a buffer of size bufspace May be NULL if bufspace is 0 bufspace An integer specifying the length of the array str May be 0 surplus p A pointer to an integer to contain the difference between bu space and the amount of memory required to store the objective row name A nonnegative value of surplus p specifies that the length of the array bu str was sufficient A negative value specifies that the length of the array was insufficient and that the routine could not complete its task In this case CPXgetob jname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus specifies the a
445. nd 1 poffset p A pointer to a double to contain the value of the linear formula corresponding to variables that have been removed in the presolved problem pind An array to hold the column indices of coefficients in the presolved problem in the array pval pval The linear formula in terms of the presolved problem Each entry pind i specifies the column index in the presolved problem of the corresponding coefficient pval i arrays pind and must be of length at least the number of columns in the presolved LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 525 Global function CPXwriteparam int CPXwriteparam CPXCENVptr env const char filename str Definition file cplex h The routine CPXwriteparam Writes the name and current setting of CPLEX parameters that are not at their default setting in the environment specified by env This routine writes a file in a format suitable for reading by CPXreadcopyparam so you can save current nondefault parameter settings for re use in a later session The file is written in the PRM format which is documented in the CPLEX File Formats Reference Manual Status CPXwriteparam env myparams prm Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX filename str A character string containing the name of the file to which the current set of modified parameter settings is to be written
446. nd An integer specifying the end of the range of types to be returned Returns The routine returns zero if successful and nonzero if an error occurs 518 Global function CPXgetsolnpoolqconstrslack int CPXgetsolnpoolqconstrslack CPXCENVptr env CPXCLPptr lp int soln double qcslack int begin int end Definition file cplex h The routine CPXgetsolnpoolqconstrslack accesses the slack values for a range of the quadratic constraints for a member of the solution pool of a quadratically constrained program QCP The beginning and end of the range must be specified The slack values returned consist of the righthand side minus the constraint activity level Example Status CPXgetsolnpoolqconstrslack env lp 3 qcslack 0 CPXgetnumqconstrs env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool member for which to return slack values A value of 1 specifies that the incumbent should be used instead of a solution pool member qcslack An array to receive the values of the slack or surplus variables for each of the constraints This array must be of length at least end begin 1 If successful 1 0 through qcslack end begin contain the values of the slacks begin integer specifying the beginning of the range of slack values to be returned
447. nd cmatval Example Status CPXgetcols env lp amp nzcnt cmatbeg cmatind cmatval cmatspace amp surplus 0 cur numcols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob nzcnt A pointer to an integer to contain the number of nonzeros returned that is the true length of the arrays cmatind and cmatval cmatbeg to contain indices specifying where each of the requested columns begins in the arrays cmatval and cmat ind Specifically column j consists of the entries in 1 and cmatind the range from cmatbeg j begin to cmatbeg j 1 begin 1 Column consists of the entries from cmatbeg end begin to nzcnt_p 1 This array must of length atleast end begin 1 cmatind array to contain the row indices associated with the elements of cmatval May be NULL if cmatspace is zero cmatval An array to contain the nonzero coefficients of the specified columns May be NULL if cmat space is zero cmatspace An integer specifying the length of the arrays cmat ind and cmatval May be zero surplus A pointer to an integer to contain the difference between cmat space and the number of entries in each of the arrays cmatind and cmat val A nonnegative value of surplus p specifies that the length of the arrays was sufficient A negative value specifies that the length was insuffic
448. nflict status of the groups are returned This array must have a length of at least 1 beg The index of the first group defined at the most recent call to CPXrefineconflictext for which the conflict status will be returned The index of the last group defined at the most recent call to CPXrefineconflictext for which the conflict status will be returned Returns The routine returns zero if successful and nonzero if an error occurs 256 Global function CPXsettuningcallbackfunc int CPXsettuningcallbackfunc CPXENVptr env int CPXPUBLIC callback CPXCENVptr int void void cbhandle Definition file cplex h The routine CPXsettuningcallbackfunc modifies the user written callback routine to be called before each trial run during the tuning process Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the tuning Callback arguments env A pointer to the CPLEX environment that was passed into the associated tuning routine cbdata A pointer passed from the tuning routine to the user written callback function that contains information about the tuning process The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value specifying from which procedure the user written callback function was ca
449. ng and end of the range must be specified Example Status CPXgetsense env lp sense 0 cur numrows 1 Values of sense sense i lt constraint ranged constraint Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob sense An array where the specified constraint senses are to be returned This array must be of length at least end begin 1 sense of constraint i is returned in sense i begin Possible values appear in the table begin An integer specifying the beginning of the range of constraint senses to be returned end Aninteger specifying the end of the range of constraint senses to be returned Returns The routine returns zero if successful and nonzero if an error occurs 260 Global function CPXgetcols int CPXgetcols CPXCENVptr env CPXCLPptr lp int nzcnt p int cmatbeg int cmatind double cmatval int cmatspace int surplus p int begin int end Definition file cplex h The routine CPXgetcols accesses a range of columns of the constraint matrix of a CPLEX problem object The beginning and end of the range along with the length of the arrays in which the nonzero entries of these columns are to be returned must be specified Note If the value of cmat space is zero the negative of the value of surplus p returned specifies the length needed for the arrays cmatind a
450. nge of MIP starts of a CPLEX problem object The beginning and end of the range along with the length of the arrays in which the entries of these MIP starts are to be returned must be specified Note If the value of start space is 0 zero then the negative of the value of surplus p returned specifies the length needed for the arrays varindices and values Example status CPXgetmipstarts env lp amp nzcnt beg varindices values effortlevel startspace amp surplus 0 cur numstarts 1 Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob nzcnt p pointer to an integer to contain the number of entries returned that is the true length of the arrays varindices and values beg An array of length end beg 1 specifying where each of the requested MIP starts begins in the arrays varindices and values The elements specific to each MIP start i are stored in sequential locations in arrays varindices and values from position beg i to 1 1 1 or from beg 1 to nzcnt 1 if i end varindices An array of length nzcnt containing the numeric indices of the columns corresponding to the variables which are assigned starting values values An array of length nzcnt containing the values of the MIP starts The entry values j is the value assigned to the variable indices j effortlevel An array of length end
451. ngth at least the number of columns in the presolved problem object Returns The routine returns zero if successful and nonzero if an error occurs 539 Global function CPXgetijrow int CPXgetijrow CPXCENVptr env CPXCLPptr lp int i int j int row p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXget i jrow returns the index of a specific basic variable as its position in the basis header If the specified row indexes a constraint that is not basic or if the specified column indexes a variable that is not basic CPXgeti jrow returns an error code and sets the value of its argument row to 1 An error is also returned if both row and column indices are specified in the same call Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip The pointer to the CPLEX LP problem object as returned by CPXcreateprob An integer specifying the index of basic row CPXgetijrow must find the position of this basic row the basis header A negative value in this argument specifies to CPXget i jrow not to seek a b
452. nition file cplex h The routine CPXgetnumqconstrs is used to access the number of quadratic constraints in a CPLEX problem object Example cur numqconstrs CPXgetnumqconstrs env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the problem object or environment does not exist CPXgetnumqconstrs returns the value 0 zero otherwise it returns the number of quadratic constraints 330 Global function CPXgetijdiv int CPXgetijdiv CPXCENVptr env CPXCLPptr lp int idiv p int jdiv p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXget i jdiv returns the index of the diverging row that is constraint or column that is variable when one of the CPLEX simplex optimizers terminates due to a diverging vector This function can be called after an unbounded solution status for a primal simplex call or after an infeasible solution status for a dual simplex call If one of the CPLEX simplex optimizers has concluded that the L
453. nly routine that can access optimization status information from within a nonadvanced user written callback function It is also the only Callable Library routine that may be called from within a nonadvanced user written callback function and in fact may only be called from the callback function Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The cbdata pointer passed to the user written callback function The argument cbdata MUST be the value of cbdata passed to the user written callback function wherefrom An integer value specifying the optimization algorithm from which the user written callback function was called The argument wherefrom MUST be the value of wherefrom passed to the user written callback function See CPXgetlpcallbackfunc CPXgetmipcallbackfunc and CPXgetnetcallbackfunc for possible values of wherefrom and their meaning whichinfo An integer value specifying the specific information that should be returned by CPXgetcallbackinfo to the result argument Values for whichinfo the type of the information returned into result p plus a description appear in the table result p A generic pointer to a variable of type double or int dependent on the value of whichinfo as documented in the following tables For LP algorithms type of ee INFO E L double primal objective value K INFO DUAI double dual objective value measure of primal infeasibility
454. nment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the problem object or environment does not exist CPXgetnumnz returns the value 0 zero otherwise it returns the number of nonzero elements 227 Global function CPXsetnodecallbackfunc int CPXsetnodecallbackfunc CPXENVptr env int CPXPUBLIC nodecallback CALLBACK NODE ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetnodecallbackfunc sets and modifies the user written callback to be called during MIP optimization after CPLEX has selected a node to explore but before this exploration is carried out The callback routine can change the node selected by CPLEX to a node selected by the user Example Status CPXgetnodecallbackfunc env mynodefunc mydata See also the example admipex1 c the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX nodecallback A pointer to the current user written node callback If no callback has been set th
455. node during optimization and during certain cut generation routines This function must be written by the user Its prototype is explained in the Callback description cbhandle A pointer to user private data This pointer will be passed to the callback function Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero return value terminates the optimization That is if the user written callback function returns nonzero it signals that CPLEX should terminate optimization Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata 171 A pointer passed from the optimization routine to the user written callback function that identifies the problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value reporting from which optimization algorithm the user written callback function was called Possible values and their meaning appear in the table CPX CALLBACK MIP PROBE From probing or clique merging CPX CALLBACK DISJCUT From disjunctive cuts CPX CALLBACK FLOWMIR From Mixed Integer Rounding MIR cuts cbhandle 108 CALLBACK FRACCUT From Gomory fractional cuts A pointer to user private data as passed to CPXs
456. nonzero when it has not yet completed The two nonzero statuses are CPX TUNE ABORT Which will be set when the terminate value passed to CPXsetterminate is set and CPX TUNE TILIM which will be set when the time limit specified by CPX PARAM TILIMis reached Tuning will set any parameters which have been tuned so far even when tuning has not completed for the problem as a whole Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob intcnt An integer that specifies the number of integer parameters to be fixed during tuning This specifies the length of the arrays intnum and intval intnum An array containing the parameter numbers unique identifiers of the integer parameters which remain fixed May be NULL if intcnt is O zero intval An array containing the values for the parameters listed in intnum May be NULL if intcnt is 0 zero dblcnt An integer that specifies the number of double parameters to be fixed during tuning This specifies the length of the arrays and 275 dblnum dblval strcnt strnum strval An array containing the parameter numbers unique identifiers of the double parameters which remain fixed May be NULL if dbicnt is 0 zero An array containing the values for the parameters listed in May be NULL if dblcnt is 0 zero An integer th
457. npoolsolnname CPXgetsolnpoolx CPXgetsos CPXgetsosindex CPXgetsosinfeas CPXgetsosname CPXgetstat CPXgetstatstring CPXgetstrparam CPXgetsubmethod CPXgetsubstat CPXgettime CPXgettuningcallbackfunc CPXgetub CPXgetx CPXgetxqxax CPXhybbaropt CPXhybnetopt CPXinfodblparam CPXinfointparam CPXinfostrparam CPXmbasewrite CPXmipopt CPXmsg CPXmsgstr CPXmstwrite CPXmstwritesolnpool CPXmstwritesolnpoolall CPXNETaddarcs CPXNETaddnodes CPXNETbasewrite 13 CPXNETcheckcopynet CPXNETchgarcname CPXNETchgarcnodes CPXNETchgbds CPXNETchgname CPXNETchgnodename CPXNETchgobj CPXNETchgobjsen CPXNETchgsupply CPXNETcopybase CPXNETcopynet CPXNETcreateprob CPXNETdelarcs CPXNETdelnodes CPXNETdelset CPXNETextract CPXNETfreeprob CPXNETgetarcindex CPXNETgetarcname CPXNETgetarcnodes CPXNETgetbase CPXNETgetdj CPXNETgetitent CPXNETgetlb CPXNETgetnodearcs CPXNETgetnodeindex CPXNETgetnodename CPXNETgetnumarcs CPXNETgetnumnodes CPXNETgetobj CPXNETgetobjsen CPXNETgetobjval CPXNETgetphaset cnt CPXNETgetprobname CPXNETgetslack CPXNETgetstat CPXNETgetsupply CPXNETgetub CPXNETgetx CPXNETprimopt 14 CPXNETreadcopybase CPXNETreadcopyprob CPXNETsolninfo CPXNETsolution CPXNETwriteprob CPXnewcols CPXnewrows CPXobjsa CPXopenCPLEX CPXordwrite CPXpopulate CPXpperwrite CPXpreslvwrite CPXprimopt CPXputenv CPXgpindefcertificate CPXqpopt CPXre
458. nt sosind const double soswt char sosname Definition file cplex h The routine CPXaddsos adds information about a special ordered set SOS to a problem object of type CPXPROB MILP CPXPROB MIQP Of CPXPROB MIQCP The problem may already contain SOS information Table 1 Values of elements of sostype E 5051 Type 1 E SOS2 Type 2 The arrays sosbeg sosind and soswts follow the same conventions as similar arrays in other routines of the Callable Library For 3 lt numsos 1 the indices of the set 3 must be stored in sosind sosbeg j sosind sosbeg j 1 1 and the weights soswt sosbeg j soswt sosbeg j 1 1 For the last set numsos 1 the indices must be stored in sosind sosbeg numsos 1 sosind numsosnz 1 and the corresponding weights in soswt sosbeg numsos 1 soswt numsosnz 1 Hence the length of sosbeg must be at least numsos while the lengths of sosind and soswt must must be at least numsosnz Example Status CPXaddsos env lp numsos numsosnz sostype sosbeg sosind soswt NULL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob numsos The number of sets to be added to existing SOS sets if any numsosnz The total number of members in all of the sets to be added to existing SOS sets if any sostype An array containing SOS type information for the sets to be a
459. nt matrix not including the objective function or bounds on the variables objsense An integer that specifies whether the problem is a minimization or maximization problem Table 1 shows its possible settings objective An array of length at least numcols containing the objective function coefficients rhs An array of length at least numrows containing the righthand side value for each constraint in the constraint matrix sense An array of length at least numrows containing the sense of each constraint in the constraint matrix Table 2 shows the possible settings matbeg array that defines the constraint matrix matcnt array that defines the constraint matrix array that defines the constraint matrix array that defines the constraint matrix Ib An array of length at least numcols containing the lower bound on each of the variables Any lower bound that is set to a value less than or equal to that of the constant CPX INFBOUND is treated as negative infinity CPX INFBOUND is defined in the header file cplex h ub An array of length at least numcols containing the upper bound on each of the variables Any upper bound that is set to a value greater than or equal to that of the constant INFBOUND is treated as infinity INFBOUND is defined in the header file cplex h rngval An array of length at least numrows containing the range value of each ranged constraint Ranged rows are those designate
460. nterface in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX branchcallback p The address of the pointer to the current user written branch callback If no callback has been set the returned pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle int type int SOS int nodecnt int double nodeest int nodebeg int indices char int bd int useraction p The call to the branch callback occurs after a branch has been selected but before the branch is carried out This function is written by the user On entry to the callback the CPLEX selected branch is defined in the arguments The arguments to the callback specify a list of changes to make to the bounds of variables when child nodes are created One two or zero child nodes can be created so one two or zero lists of changes are specified in the arguments The first branch specified is considered first The callback is called with zero lists of bound changes 195 when the solution at the node is integer feasible Custom branching strategies can be implemented by calling the CPLEX function CPXbranchcallbackbranchbds and setting the useraction variable to CALLBACK SET Then CPLEX will carry out these branches instead of the CPLEX selected br
461. num int colnum double coef p Definition file cplex h The routine CPXgetapcoef accesses the quadratic coefficient in the matrix Q a CPLEX problem object for the variable pair indexed by rownum colnum The result is stored in coe Example Status CPXgetqpcoef env lp 10 20 amp coef Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob rownum The first variable number row number in Q colnum The second variable number column number in Q coef p A pointer to a double where the coefficient should be stored Returns The routine returns zero on success and nonzero if an error occurs 241 Global function CPXgetcallbacknodelp int CPXgetcallbacknodelp CPXCENVptr env void cbdata int wherefrom CPXLPptr nodelp p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacknodelp returns a pointer to the current continuous relaxation at the current branch and cut node from within a user written callback Generally
462. number of coefficients in the cut or equivalently the length of the arrays cutind and cutval rhs A double value that specifies the value of the righthand side of the cut sense An integer value that specifies the sense of the cut cutind An array containing the column indices of cut coefficients cutval An array containing the values of cut coefficients purgeable A Boolean value specifying whether CPLEX is allowed to purge the cut if CPLEX deems the cut ineffective Returns The routine returns zero if successful and nonzero if an error occurs 323 Global function CPXgetdnorms int CPXgetdnorms CPXCENVptr env CPXCLPptr lp double norm int head int len p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetdnorms accesses the norms from the dual steepest edge As in CPXcopydnorms the argument head is an array of column or row indices corresponding to the array of norms Column indices are indexed with nonnegative values Row indices are indexed with negative values offset by 1 one For example if head 0 5 norm 0 is associated
463. nv lp x slack Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob x An array that contains primal solution x values for the problem as returned by routines such as CPXcrushx and CPXuncrushx The array must be of length at least the number of columns in the LP problem object slack An array to receive the slack values computed from the x values for the problem object The array must be of length at least the number of rows in the LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 92 Global function CPXcheckcopyquad int CPXcheckcopyquad CPXCENVptr env CPXCLPptr lp const int qmatbeg const int qmatcnt const int qmatind const double qmatval Definition file cplex h The routine CPXcheckcopyquad validates the arguments of the corresponding routine CPXcopyquad This data checking routine is found in source format in the file check provided with the standard CPLEX distribution To call this routine you must compile and link check c with your program as well as the CPLEX Callable Library The CPXcheckcopyquad routine has the same argument list as the CPXcopyquad routine The second argument 1p is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the model For most user applications this
464. nv A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob filename str Name of the network file to read Returns The routine returns zero on success and nonzero if an error occurs 352 Global function CPXnewrows int CPXnewrows CPXCENVptr env CPXLPptr lp int rcnt const double rhs const char sense const double rngval char rowname Definition file cplex h The routine CPXnewrows adds empty constraints to a specified CPLEX problem object This routine may be called any time after a call to CPXcreateprob For each row the user can specify the sense righthand side value range value and name of the constraint The added rows are indexed to put them at the end of the problem Thus if rcnt rows are added to a problem object already having rows the new rows have indices k k 1 k rcnt 1 The constraint coefficients in the new rows are zero the constraint coefficients can be changed with calls to CPXchgcoef CPXchgcoeflist or CPXaddcols Table 1 Settings for elements of the array sense constraint constraint constraint ranged constraint Status CPXnewrows env lp rcnt rhs sense NULL newrowname See also the example 1pex1 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX env
465. o X 402 Global function CPXNETQgelpi 1 e rentrer eunte etienne 403 Global function 404 Global function 406 Global function 407 Global function CPXmsQgslr 5 a 408 Global function 409 Global function CPXgetcallbackglobalub eeeeeeee eene eene enne nnne nn nennt nnne nnn nnns tnra nnnm ennnen nanna 410 Global function 411 Global function 412 Global function 414 Global function CPXcheckcopylp eeeseeeee eene esee seen ette nennen nnns nnn nane sinn natns ne tn sinn 415 Global function 416 Global function 417 Global function 418 Global function GPXNETextract 5 i nennen 419 Global function 5 420 Global function CPXsolwritesolnpool
466. o be nonbasic and its flow is set to O Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net pointer to a CPLEX network problem object as returned by CPXNETcreateprob astat Array of status values for network arcs Each arc needs to be assigned one of the values in Table 1 nstat Array of status values for artificial arcs from each node to the root node Each artificial arc needs to be assigned one of the values in Table 2 At least one of the artificial arcs must be assigned the status CPX BASIC for a network basis Returns The routine returns zero on success and nonzero if an error occurs 124 Global function CPXrefineconflictext int CPXrefineconflictext CPXCENVptr env CPXLPptr lp int grpcnt int concnt const double grppref const int grpbeg const int grpind const char grptype Definition file cplex h The routine CPXrefineconflictext extends CPXrefineconflict to problems with indicator constraints quadratic constraints or special ordered sets SOSs and to situations where groups of constraints should be considered as a single constraint The routine CPXrefineconflictext identifies a minimal conflict for the infeasibility of the current problem or a subset of constraints of the current problem Since the conflict is minimal removal of any group of constraints that is a member of the conflict will remove that particular source of infeasibility However there may be othe
467. o debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacknodelb retrieves the lower bound values for the subproblem at the current node during MIP optimization from within a user written callback The lower bounds are tightened after a new incumbent is found so the values returned by CPXgetcallbacknodex may violate these bounds at nodes where new incumbents have been found The values are from the original problem if CPX PARAM MIPCBREDLP is set to OFF otherwise they are from the presolved problem This routine may be called only when the value of the wherefrom argument is one of the following CPX CALLBACK MIP CPX CALLBACK MIP BRANCH CPX CALLBACK MIP INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT Example status CPXgetcallbacknodelb env cbdata wherefrom lb 0 cols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback Ib An ar
468. o if an error occurs 353 Global function CPXgetobjoffset int CPXgetobjoffset CPXCENVptr env CPXCLPptr lp double objoffset Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetobjoffset returns the objective offset between the original problem and the presolved problem Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a reduced CPLEX LP problem object as returned by CPXgetredlp objoffset p A pointer to a variable of type double to hold the objective offset value Returns The routine returns zero if successful and nonzero if an error occurs 354 Global function CPXflushchannel void CPXflushchannel CPXCENVptr env CPXCHANNELptr channel Definition file cplex h The routine CPX 1ushchannel flushes outputs and clears the buffers of all message destinations for a channel Use this routine in cases when it is important to have output written to disk immediately after it is generated For most applications this routine need not be used Example CPXflushchannel env
469. o jenter to specify that the variable moves from its current bound to the other The argument j1eave may also be set to CPX NO VARIABLE In that case CPLEX will use the incoming variable jenter to perform a primal simplex method ratio test that determines the leaving variable leavestat An integer specifying the nonbasic status to be assigned to the leaving variable after the basis change This is important for the case where j1eave specifies a variable with finite upper and lower bounds as it may become nonbasic at its lower or upper bound Returns The routine returns zero if successful and nonzero if an error occurs 310 Global function CPXchgcolname int CPXchgcolname CPXCENVptr env CPXLPptr lp int cnt const int indices char newname Definition file cplex h The routine CPXchgcolname changes the names of variables in a CPLEX problem object If this routine is performed on a problem object with no variable names default names are created before the change is made See Also CPXdelnames Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob cnt An integer that specifies the total number of variable names to be changed Thus cnt specifies the length of the arrays indices and newname indices An array of length cnt containing the numeric indices of the variables for which the names are to be changed newname An arr
470. o the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom integer value that reports where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback nodeest A double that specifies the value of the node estimate for the node to be created with this branch The node estimate is used to select nodes from the branch and cut tree with certain values of the node selection parameter PARAM NODESEL rcnt An integer that specifies the number of constraints for the branch nzcnt An integer that specifies the number of nonzero constraint coefficients for the branch This specifies the length of the arrays rmatind and rmatval rhs An array of length rcnt containing the righthand side term for each constraint for the branch sense An array of length rcnt containing the sense of each constraint to be added for the branch Values of the sense appear in Table 1 rmatbeg array that with rmatind and rmatval defines the constraints for the branch rmatind An array that with rmatbeg and rmatval defines the constraints for the branch rmatval An array that with rmatbeg and rmatind defines the constraints for the branch The format is similar to the format used to describe the constraint matrix in the routine CPXaddrows Every row must be stored in sequential locations in this array from position rmatbeg i to rm
471. ocate the memory dynamically for the string passed to CPXput env As with the C putenv routine the address of the character string goes directly into the environment Therefore the memory identified by the pointer must remain active throughout the remaining parts of the application where CPLEX runs Since global or static variables are not thread safe the team recommends dynamic memory allocation of the envsetting string Example char envstr NULL envstr char malloc 256 if envstr NULL 1 strcpy envstr ILOG LICENSE FILE c myapplicenseaccess ilm CPXputenv envstr Parameters envsetting str A string containing an environment variable assignment This argument typically sets the ILOG LICENSE FILE environment variable that customizes the location of the license key Returns The routine returns 0 zero when it executes successfully and 1 when it fails 450 Global function CPXaddlazyconstraints int CPXaddlazyconstraints CPXCENVptr env CPXLPptr lp int rcnt int nzcnt const double rhs const char sense const int rmatbeg const int rmatind const double rmatval char rowname Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourag
472. of applying an optimization method to a problem object For MIP problem objects you can access the values of variables and constraint slacks Methods and routines are also available to retrieve other information about the optimization process such as the number of nodes used 17 Group optim cplex callable accessnetworkresults The routines in the CPLEX Callable Library to access network results CPXNETgetbase CPXNETgetdj CPXNETgetitcnt CPXNETgetobjval CPXNETgetphaset cnt Function Summary CPXNETgetslack CPXNETgetstat CPXNETgetx CPXNETsolninfo CPXNETsolution Use these routines to access results after you have used the network optimizer on a problem object created as a network flow structure 18 Group optim cplex callable accessqcpresults The routines in the CPLEX Callable Library to access QCP or SOCP results Function Summary CPXgetqconstrinfeas CPXgetqconstrslack CPXgetxqxax Solution query routines are used to access information about the results of applying an optimization method to a quadratically constrained QCP problem object or to the special case of second order cone programming SOCP problems For QCP problem objects you can access the constraint slacks and constraint activity levels in addition to the information that you can access through routines in the groups optim cplex callable accessmipresults and optim cplex callable accessresults 19 Group optim cplex call
473. of length atleast end begin 1 The pointer to the name of row i is returned in name i begin namestore An array of characters where the specified row names are to be returned May be NULL if storespace is O storespace An integer specifying the length of the array namestore May be O surplus p A pointer to an integer to contain the difference between storespace and the total amount of memory required to store the requested names A nonnegative value of surplus p specifies that storespace Was sufficient A negative value specifies that it was insufficient and that the routine could not complete its task In that case CPXget rowname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array namestore begin An integer specifying the beginning of the range of row names to be returned end An integer specifying the end of the range of row names to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS specifies that insufficient space was available in the namestore array to hold the names 434 Global function CPXNETchgbds int CPXNETchgbds CPXCENVptr env CPXNETptr net int cnt const int indices const char lu const double Definition file cplex h The routine CPXNETchgbds is used to change the upper lower or both bo
474. oid cbdata int wherefrom void cbhandle double objval double int isfeas p int useraction p The incumbent callback is called when CPLEX has found an integer solution but before this solution replaces the incumbent integer solution Variables are in terms of the original problem if the parameter CPX PARAM is set to OFF before the call to CPXmipopt that calls the callback Otherwise variables are in terms of the presolved problem Callback return value 474 The callback returns zero if successful nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed from the optimization routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass it to the callback information routines wherefrom An integer value reporting where in the optimization this function was called It will have the value CPX CALLBACK MIP BRANCH cbhandle A pointer to user private data objval A variable that contains the objective value of the integer solution An array that contains primal solution values for the integer solution isfeas p A pointer to an integer variable that determines whether or not CPLEX should use the integer solution specified in x to replace the current incumbent A nonzero value states that the incumbent should be replace
475. olumns Returns The routine returns zero if successful and nonzero if an error occurs 302 Global function CPXgetcallbackorder int CPXgetcallbackorder CPXCENVptr env void cbdata int wherefrom int priority int direction int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackorder retrieves MIP priority order information during MIP optimization from within a user written callback The values are from the original problem if CPX PARAM MIPCBREDLP is set to CPX OFF Otherwise they are from the presolved problem This routine may be called only when the value of the wheref rom argument is one of the following values CALLBACK CPX CALLBACK MIP BRANCH CALLBACK INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT Example Status CPXgetcallbackorder env cbdata wherefrom priority NULL 0 cols 1 Branching direction CPX BRANCH GLOBAL o use
476. olutions in the pool The routine CPXgetsolnpoolnumsolns accesses the number of solutions in the solution pool in the problem object Example numsolns CPXgetsolnpoolnumsolns env 1 See also the example populate c in the the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX A pointer to CPLEX problem object as returned by CPXcreateprob Returns If the CPLEX problem object or environment does not exist CPXget solnpoolnumsolns returns the value 0 zero otherwise it returns the number of solutions 305 Global function CPXdelchannel void CPXdelchannel CPXENVptr env CPXCHANNELptr channel p Definition file cplex h The routine CPXdelchannel flushes all message destinations for a channel clears the message destination list and frees the memory allocated to the channel On completion the pointer to the channel is set to NULL Example CPXdelchannel env amp mychannel See also 1pex5 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX channel p A pointer to the pointer to the channel containing the message destinations to be flushed cleared and destroyed Returns This routine does not have a return value 306 Global function CPXfputs int CPXfputs const char s str CPXFILEptr stream Definition file cplex h The routine CPX puts can be used to
477. on development Example Status CPXcopyctype env lp ctype See also the example distributed with the product Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob xctype An array of length CPXgetnumcols env 1p containing the type of each column in the constraint matrix Possible values appear in Table 1 Returns The routine returns zero if successful and nonzero if an error occurs 143 Global function CPXNETgetarcnodes int CPXNETgetarcnodes CPXCENVptr env CPXCNETptr net int fromnode int tonode int begin int end Definition file cplex h The routine CPXNETgetarcnodes is used to access the from nodes and to nodes for a range of arcs in the network stored in a network problem object Example status CPXNETgetarcnodes env net fromnode tonode 0 narcs 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob fromnode Array in which to write the from node indices of the requested arcs If NULL is passed no from node indices are retrieved Otherwise the size of the array must be end begin 1 tonode Array in which to write the to node indices of the requested arcs If NULL is passed no to node indices are retrieved Otherwise the size of the array must be
478. or FeasOptMode set to FEASOPT MIN INF or MinInf mixed integer problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is minimal 863 Macro FEASIBLE RELAXED QUAD Definition file cplex h CPXMIP FEASIBLE RELAXED QUAD 124 MIP only enum FeasibleRelaxedQuad This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to CPX FEASOPT MIN QUAD MinQuad on a mixed integer problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is minimal 864 Macro CPXMIP FEASIBLE RELAXED SUM Definition file cplex h CPXMIP FEASIBLE RELAXED SUM 120 MIP only enum FeasibleRelaxedSum This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to FEASOPT MIN SUM or MinSum a mixed integer problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is minimal 865 Macro CPXMIP INFEASIBLE Definition file cplex h CPXMIP I
479. ormats Reference Manual and examples of their use appear in the CPLEX User s Manual File formats matrix and basis file MPS format CPLEX LP format with names modified to conform to LP format REW MPS format with all names changed to generic names MPS format with all names changed to generic names LP format with all names changed to generic names When this routine is invoked the current problem is written to a file If the file name ends with one of the following extensions a compressed file is written e bz2 for files compressed with BZip2 gz for files compressed with GNU Zip Microsoft Windows does not support writing compressed files with this Example Status CPXwriteprob env lp myprob sav NULL See also the example 1pex1 c in the CPLEX User s Manual in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the problem is to be written unless otherwise specified with the filetype argument If the file name ends with gz or bz2 a compressed file is written in accordance with the selected file type filetype str character string containing the type of the file which can be of the values in the table be NULL in which case the type is inferred
480. ote This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXset incumbentcallbackfunc sets and modifies the user written callback routine to be called when an integer solution has been found but before this solution replaces the incumbent This callback can be used to discard solutions that do not meet criteria beyond that of the mixed integer programming formulation Variables are in terms of the original problem if the parameter CPX PARAM MIPCBREDLP is set to OFF before the call to CPXmipopt that calls the callback Otherwise variables are in terms of the presolved problem Example Status CPXsetincumbentcallbackfunc env myincumbentcheck mydata See also Advanced MIP Control Interface in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX incumbentcallback A pointer to a user written incumbent callback If the callback is set to NULL no callback can be called during optimization cbhandle A pointer to user private data This pointer is passed to the callback Callback description int callback CPXCENVptr env v
481. oup optim cplex solutionquality in the Callable Library Reference Manual Returns The routine returns zero if successful and nonzero if an error occurs If an error occurs the quality value remains unchanged 238 Global function CPXgetsolnpoolsolnname int CPXgetsolnpoolsolnname CPXCENVptr env CPXCLPptr lp char store int storesz int surplus p int which Definition file cplex h The routine CPXgetsolnpoolsolnname accesses the name of a solution specified by the argument soln of the solution pool associated with the problem object specified by the argument 1p If the value of storesz is 0 zero then the negative of the value of surplus p returned specifies the total number of characters needed for the array store nonnegative value of surplus p specifies that the length of the array store was sufficient A negative value specifies that the length of the array was insufficient and that the routine could not complete its task In this case CPXgetsolnpoolsolnname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array store Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob store A pointer to a buffer of size storesz It may be NULL if storesz is 0 zero storesz integer specifying the length of the
482. ourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXget redlp returns a pointer for the presolved problem It returns NULL if the problem is not presolved or if all the columns and rows are removed by presolve Generally the returned pointer may be used only in CPLEX Callable Library query routines such as CPXsolution Or CPXgetrows The presolved problem must not be modified Any modifications must be done on the original problem If CPX PARAM REDUCE is set appropriately the modifications are automatically carried out on the presolved problem at the same time Optimization and query routines can be used on the presolved problem Example status CPXgetredlp env lp amp reducelp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob redlp p A pointer to receive the problem object pointer that results when presolve has been applied to the LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 371 Global function CPXgetmipstarts int CPXgetmipstarts CPXCENVptr env CPXCLPptr lp int nzcnt p int beg int varindices double values int effortlevel int startspace int surplus p int begin int end Definition file cplex h The routine CPXgetmipstarts accesses a ra
483. outine may be called any time after a call to CPXcreateprob For each column the user can specify the objective coefficient the lower and upper bounds the variable type and name of the variable The added columns are indexed to put them at the end of the problem Thus if ccnt columns are added to a problem object already having k columns the new columns have indices k 1 k ccnt 1 The constraint coefficients in the new columns are zero the constraint coefficients can be changed with calls to CPXchgcoef CPXchgcoeflist Or CPXaddrows The routine CPXnewcols is very similar to the routine CPXnewrows It can be used to add variables to a problem object without specifying the matrix coefficients Types of new variables values of ctype j CPX CONTINUOUS C continuous variable j CPX BINAR binary variable j T 8 CPX SE semi continuous variable j CPX SEMII semi integer variable 5 Example Status CPXnewcols env lp ccnt obj lb ub NULL NULL See also the example 1pex8 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob ccnt An integer that specifies the number of new variables being added to the problem object obj An array of length ccnt containing the objective function coefficients of the new
484. outine returns the number of network arcs stored a network problem object If an error occurs 0 is returned and an error message is issued 101 Global function CPXgetnumindconstrs int CPXgetnumindconstrs CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumindconstrs accesses the number of indicator constraints in a CPLEX problem object Example cur numindconstrs CPXgetnumindconstrs env Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the problem object or environment does not exist CPXgetnumindconstrs returns the value 0 zero otherwise it returns the number of indicator constraints 102 Global function CPXcopyorder int CPXcopyorder CPXCENVptr env CPXLPptr lp int cnt const int indices const int priority const int direction Definition file cplex h The routine CPXcopyorder copies a priority order to a CPLEX problem object of type CPXPROB MILP CPXPROB MIQP CPXPROB MIQCP A call to CPXcopyorder replaces any other information about priority order previously stored in that CPLEX problem object During branching integer variables with higher priorities are given preference over integer variables with lower priorities Priorities must be nonnegative integers A preferred branching direction may also be specified for each variable The CPLEX param
485. outine to the user written callback function that identifies the problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo 397 wherefrom An integer value reporting from which optimization algorithm the user written callback function was called Possible values and their meaning appear in this table Indicators of algorithm that called user written callback From probing or clique merging CALLBACK DISJCUT From disjunctive cuts From Mixed Integer CPX CALLBACK MIP FLOWMIR Rounding cuts From Gomory fractional CPX CALLBACK MIP FRACCUT y fractiona cuts cbhandle Pointer to user private data as passed to CPXsetinfocallbackfunc See Also CPXgetcallbackinfo Returns The routine returns zero if successful and nonzero if an error occurs 398 Global function CPXcopypnorms int CPXcopypnorms CPXCENVptr env CPXLPptr lp const double cnorm const double rnorm int len Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead Th
486. ow to ranged CPXchgsense sets the corresponding range value to 0 zero The routine CPXchgrngval can then be used to change the range value Example status CPXchgsense env lp cnt indices sense Values of sense sense i EA i The constraint is ranged Parameters The new sense is lt env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer that specifies the total number of linear constraints to be changed and thus represents the length of the arrays indices and sense indices An array of length cnt containing the numeric indices of the rows corresponding to the linear constraints which are to have their senses changed sense An array of length cnt containing characters that tell the new sense of the linear constraints specified in indices Possible values appear in the table Returns The routine returns zero if successful and nonzero if an error occurs 436 Global function CPXNETgetx int CPXNETgetx CPXCENVptr env CPXCNETptr net double x int begin int end Definition file cplex h The routine CPXNETgetx is used to access solution values or equivalently flow values for a range of arcs stored in a network problem object For this routine to succeed a solution must exist for the network problem object Example status CPXNETgetx env net x 10 20 Paramete
487. ows int objsense const double objective const double rhs const char sense const int matbeg const int matcnt const int matind const double matval const double lb const double ub const double rngval char colname char rowname Definition file cplex h The routine CPXcopylpwnames copies LP data into a CPLEX problem object in the same way as the routine CPXcopy lp but using some additional arguments to specify the names of constraints and variables in the CPLEX problem object The arguments to CPXcopylpwnames define an objective function constraint matrix variable bounds righthand side constraint senses and range values Unlike the routine CPXcopylp CPXcopylpwnames also copies names This routine is used in the same way as CPXcopylp Table 1 Settings for objsense Table 2 Settings for sense sense i lt constraint sense i 1 constraint sense i constraint ranged constraint With respect to the arguments mat beg beginning of the matrix mat cnt count of the matrix mat ind indices of the matrix and mat val values of the matrix CPLEX needs to know only the nonzero coefficients These are grouped by column in the array matval The nonzero elements of every column must be stored in sequential locations in this array with matbeg j containing the index of the beginning of column j and matcnt j containing the number of entries in column 5 The components o
488. pfeasind p A pointer to an integer variable specifying whether the current solution is known to be primal feasible A false return value does not necessarily mean that the solution is not feasible It simply means that the relevant algorithm was not able to conclude it was feasible when it terminated dfeasind p A pointer to an integer variable specifying whether the current solution is known to be dual feasible A false return value does not necessarily mean that the solution is not feasible It simply means that the relevant algorithm was not able to conclude it was feasible when it terminated Returns The routine returns zero if successful and it returns nonzero if an error occurs 82 83 Global function CPXgetsolvecallbackfunc void CPXgetsolvecallbackfunc CPXCENVptr env int CPXPUBLIC solvecallback p CALLBACK SOLVE ARGS void cbhandle p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXget solvecallbackfunc accesses the user written callback to be called during MIP optimization to optimize the subproblem Example CPXgetsolvecallb
489. plex callable querynetwork The routines in the CPLEX Callable Library to query network problem data Function Summary CPXNETgetarcindex CPXNETgetarcname CPXNETgetarcnodes CPXNETgetlb CPXNETgetnodearcs CPXNETgetnodeindex CPXNETgetnodename CPXNETgetnumarcs CPXNETgetnumnodes CPXNETgetobj CPXNETgetobjsen CPXNETgetprobname CPXNETgetsupply CPXNETgetub These routines to access information about a network problem object after it has been created can be used at any time even after problem modifications 41 Group optim cplex callable queryqcp The routines in the CPLEX Callable Library to query QCP problem data that is problems with one or more quadratic constraints including the special case of second order cone programming SOCP problems Function Summary CPXgetnumqconstrs CPXgetqconstr CPXgetqconstrindex CPXgetqconstrname These routines to access information about a QCP problem object after it has been created can be used at any time even after problem modifications That is these routines access information about a problem object with one or more quadratic constraints 42 Group optim cplex callable queryqp The routines in the CPLEX Callable Library to query QP problem data that is problems with a quadratic objective function Function Summary CPXgetnumqpnz CPXgetnumquad CPXgetqpcoef CPXgetquad These routines to access information about a QP problem object after it has been created can be
490. ply CPXNETdelarcs CPXNETdelnodes CPXNETdelset After you have created a network problem object use these routines to modify it 32 Group optim cplex callable modifyproblem The routines in the CPLEX Callable Library to modify a problem created by CPXcreateprob Function Summary CPXaddcols CPXaddindconstr CPXaddmipstarts CPXaddqconsir CPXaddrows CPXaddsos CPXchgbds CPXchgcoef CPXchgcoeflist CPXchgcolname CPXchgctype CPXchgmipstart CPXchgmipstarts CPXchgname CPXchgobj CPXchgobjsen CPXchgprobname CPXchgprobtype CPXchgprobtypesolnpool CPXchggqpcoef CPXchgrhs CPXchgrngval CPXchgrowname CPXchgsense CPXdelcols CPXdelindconstrs CPXdelmipstarts CPXdelnames CPXdelqconstrs CPXdelrows CPXdelsetcols CPXdelsetmipstarts CPXdelsetrows CPXdelsetsos CPXnewcols CPXnewrows 33 Problem modification routines change a problem object after it has been created make are these adding rows and columns to the constraint matrix deleting rows and columns from the constraint matrix changing the sense of the objective function e changing the value of coefficients in the constraint matrix changing an objective or righthand side coefficient changing the bounds on a variable changing the sense of a constraint changing names of rows or columns The modifications that you can 34 Group optim cplex callable network The network routines in the CPLEX Callable Library Function
491. pnorms means that fresh primal steepest edge norms will be computed on the next call to CPXprimopt Parameters A pointer to a CPLEX LP problem object as returned by CPXcreateprob 65 Global function CPXdualwrite int CPXdualwrite CPXCENVptr env CPXCLPptr lp const char filename str double objshift p Definition file cplex h The routine CPXdualwrite writes dual formulation of the current CPLEX problem object MPS format is used This function can only be applied to a linear program it generates an error for other problem types Note Any fixed variables in the primal are removed before the dual problem is written to a file Each fixed variable with a nonzero objective coefficient causes the objective value to shift As a result if fixed variables are present the optimal objective obtained from solving the dual problem created using CPXdualwrite may not be the same as the optimal objective of the primal problem The argument objshift p can be used to reconcile this difference Example Status CPXdualwrite env lp myfile dua amp objshift Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the dual problem should be written objshift p pointer to a variable of type double to hold the change in the objective fun
492. pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns If no solution is available for the network problem object CPXNETgetstat returns 0 zero When a solution exists the possible return values are OPTIMAL Optimal solution found AT UNBOUNDED Problem has an unbounded ray Problem is infeasible or unbounded _U AT_INFEASI ABORT US 134 Global function CPXdelmipstarts int CPXdelmipstarts CPXCENVptr env CPXLPptr lp int begin int end Definition file cplex h The routine CPXdelmipstarts deletes a range MIP starts The range is specified using a beginning and ending index that represent the first and last MIP start to delete The indices of the MIP starts following those deleted are automatically decreased by the number of deleted MIP starts Example Status CPXdelmipstarts env lp 10 20 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob begin An integer that specifies the numeric index of the first MIP start to be deleted end integer that specifies the numeric index of the last MIP start to be deleted Returns The routine returns zero if successful and nonzero if an error occurs 135 Global function CPXgetmipitcnt int CPXgetmipitcnt CPXCENVptr env CPXCLPpt
493. pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned CPXcreateprob An integer that specifies the index of the row to be computed z Anarray containing the i th row of BinvA The array must be of length at least equal to the number of columns in the problem Returns The routine returns zero if successful and nonzero if an error occurs 77 Global function CPXNETchgobj int CPXNETchgobj CPXCENVptr env CPXNETptr net int cnt const int indices const double obj Definition file cplex h The routine CPXNETchgob j is used to change the objective values for set of arcs in the network stored in network problem object Any solution information stored in the problem object is lost Example Status CPXNETchgobj env net cnt indices newobj Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob cnt Number of arcs for which the objective values are to be changed indices An array of indices that indicate the arcs for which the objective values are to be changed This array must have a length of at least cnt The indices must be in the range 0 narcs 1 obj An array of the new objective values for the arcs This array must have a length of at least cnt Returns The routine returns zero on success and nonzero if an error occ
494. pool CPXCENVptr env CPXCLPptr lp int soln const char filename str Definition file cplex h The routine CPXsolwrite writes a solution file using either the incumbent solution or a solution from the solution pool for the selected CPLEX problem object The routine writes files in SOL format which is an XML format The SOL format is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly Example status CPXsolwritesolnpool env lp 1 myfile sol See Also CPXsolwrite CPXsolwritesolnpoolall Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool member which should be written A value of 1 specifies that the incumbent solution should be used instead of a solution pool member filename str A character string containing the name of the file to which the solution should be written Returns The routine returns zero if successful and nonzero if an error occurs 424 Global function CPXqpopt int CPXqpopt CPXCENVptr env CPXLPptr lp Definition file cplex h The routinecPXqpopt may be used at any time after a continuous quadratic program has been created to find a solution to that problem using of the CPLEX quadratic optimize
495. pplied primal solution 614 Macro CPX SUM QCPRIMAL RESIDUAL Definition file cplex h CPX SUM QCPRIMAL RESIDUAL Concert Technology enum SumPrimalResidual Numeric meaning double To access the sum of the residuals x Ox dx f for the unscaled quadratic constraints Integer meaning not applicable Concert Technology does not distinguish quadratic constraints from linear constraints in this respect 615 Macro SUM QCSLACK Definition file cplex h CPX SUM QCSLACK Concert Technology enum SumSlack Numeric meaning double To access the sum of the absolute quadratic constraint slack values Integer meaning not applicable Can use a supplied primal solution Concert Technology does not distinguish quadratic constraints from linear constraints in this respect 616 Macro CPX SUM QCSLACK INFEAS Definition file cplex h CPX SUM QCSLACK INFEAS Concert Technology enum not applicable Numeric meaning doub1e To access the sum of the infeasibilities of the quadratic constraints Integer meaning not applicable Can use a supplied primal solution Concert Technology does not distinguish quadratic constraints from linear constraints in this respect 617 Macro CPX SUM RED COST Definition file cplex h CPX SUM RED COST Concert Technology enum SumRedCost Numeric meaning double To access the sum of the absolute reduced cost values for the unscaled problem Integer meaning not applicable 618
496. pply values are copied Otherwise the array must be of length at least end begin 1 begin Index of the first node for which a supply value is to be obtained end Index of the last node for which a supply value is to be obtained Returns The routine returns zero on success and nonzero if an error occurs 502 Global function CPXbasicpresolve int CPXbasicpresolve CPXCENVptr env CPXLPptr lp double redlb double redub int rstat Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbasicpresolve performs bound strengthening and detects redundant rows CPXbasicpresolve does not create a presolved problem This routine cannot be used for quadratic programs Values for rstat i if row i is not redundant 1 if row i is redundant In the case of a semicontinous variable or a semi integer variable this routine produces the lower bound not the semicontinous bound not the semi integer lower bound If the strengthened bound is a value less than or equal to zero the semicontinuity or semi integrality persists In contrast if the strength
497. problems Example Status CPXsetsolvecallbackfunc env mysolvefunc mydata See also the example admipex1 c the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX solvecallback A pointer to a user written solve callback If the callback is set to NULL no callback is called during optimization cbhandle A pointer to user private data This pointer is passed to the callback Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle int useraction p CPLEX calls the solve callback before CPLEX solves the subproblem currently associated with the current node The user can choose to solve the subproblem in the solve callback instead by setting the user action argument of the callback The optimization that the user provides to solve the subproblem must provide a CPLEX solution That is the Callable Library routine CPXget stat must return a nonzero value The user may access the pointer of the subproblem with the Callable Library routine CPXgetcallbacknodelp Callback return value The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX 374 cbdata A pointer passed from the optimization routine to the user written callback that identifies the problem being optimized The only purpose of this pointer is to pass
498. pspace int surplus p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetprotected accesses the set of variables that cannot be aggregated out Note If the value of pspace is 0 the negative of the value of surplus p returned specifies the length needed for array indices Example status CPXgetprotected env lp amp protectont protectind 10 amp surplus Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob cnt p A pointer to an integer to contain the number of protected variables returned that is the true length of the array indices indices array to contain the indices of the protected variables pspace An integer specifying the length of the array indices surplus_p A pointer to an integer to contain the difference between pspace and the number of entries in indices A nonnegative value of surplus_p specifies that the length of the arrays was sufficient A negative value specifies that the length was insufficient and t
499. r conflicts in the problem consequently that repair of one conflict does not guarantee feasibility of the solution of the remaining problem Constraints are considered in groups in this routine If any constraint in a group participates in the conflict the entire group is determined to do so No further detail about the constraints within that group is returned A group may consist of a single constraint A group may be assigned a preference that is a value specifying how much the user wants the group to be part of a conflict A group with a higher preference is more likely to be included in the conflict However no guarantee is made when a minimal conflict is returned that other conflicts containing groups with a greater preference do not exist To retrieve information about the conflict computed by CPXrefineconflictext call the routine CPXgetconflictext Table 1 Possible values for elements of grptype CPX CON LOWER BOUND variable lower bound CPX CON UPPER BOUND variable upper bound CPX CON LINEAR linear constraint CPX CON QUADRAT 4 quadratic constraint CPX CON SOS 5 special ordered set CPX CON INDICAT indicator constraint The parameters CUTUP PARAM CUTLO CPX PARAM OBJULIM PX PARAM OBJLLIM do not influence this routine If you want to study infeasibilities introduced by those parameters consider adding an objective function constraint to your model to enforce their e
500. r env CPXCNETptr net Definition file cplex h The routine CPXNI recent call to CPXNI Example ETgetphaselcnt returns the number of phase 1 network simplex iterations for the most ETprimopt phaselcnt CPXNETgetphaselcnt env net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns Returns the total number of phase 1 network simplex iterations for the last call to CPXNETprimopt fora CPXNETptr object If CPXNI ETprimopt has not been called zero is returned If an error occurs 1 is returned and an error message is issued 76 Global function CPXbinvarow int CPXbinvarow CPXCENVptr env CPXCLPptr lp int i double z Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbinvarow computes the i th row of BinvA where Binv represents the inverse of the matrix B and juxtaposition specifies matrix multiplication In other words it computes the i th row of the tableau Parameters env The
501. r feasibility information to be returned Returns 390 The routine returns zero if successful nonzero if an error occurs 391 Global function CPXNETchgarcname int CPXNETchgarcname CPXCENVptr env CPXNETptr net int cnt const int indices char newname Definition file cplex h This routine CPXNETchgarcname changes the names of a set of arcs in the network stored in a network problem object Example Status CPXNETchgarcname env net 10 indices newname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob cnt An integer that indicates the total number of arc names to be changed Thus cnt specifies the length of the arrays indices and newname indices An array of length cnt containing the numeric indices of the arcs for which the names are to be changed newname An array of length cnt containing the new names for the arcs specified in indices Returns The routine returns zero on success and nonzero if an error occurs 392 Global function CPXgetsolnpoolrngfilter int CPXgetsolnpoolrngfilter CPXCENVptr env CPXCLPptr lp double 1 p double ub p int nzcnt p int ind double val int space int surplus p int which Definition file cplex h Accesses a range filter of the solution pool This routine accesses a range filter specified by the argument which of th
502. r if CPX PARAM ADVIND is set to zero Table 1 Values of basis status for columns in cstat j 0 variable at lower bound 2 variable at upper bound variable free and nonbasic Table 2 Values of basis status for rows other than ranged rows in rstat j CPX AT LOWER associated slack surplus or artificial variable is nonbasic at value 0 0 zero CPX BASIC associated slack surplus or artificial variable is basic Table 3 Values of basis status for ranged rows in rstat j Example status CPXcopybase env lp cstat rstat See Also CPXreadcopybase Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to CPLEX problem object as returned CPXcreateprob cstat An array containing the basis status of the columns in the constraint matrix The length of the array is equal to the number of columns in the problem object Possible values of the basis status of columns appear in Table 1 rstat An array containing the basis status of the slack or surplus or artificial variable associated with each row in the constraint matrix The length of the array is equal to the number of rows in the CPLEX problem object For rows other than ranged rows the array element rstat i has the meaning in Table 2 For ranged rows the array element rstat i has the meaning in Table 3 Returns The routine returns zero if succes
503. r lp Definition file cplex h The routine CPXgetmipitcnt accesses the cumulative number of simplex iterations used to solve a mixed integer problem Example itcnt CPXgetmipitcnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example itcnt CPXgetmipitcnt env lp Returns If a solution exists CPXgetmipitocnt returns the total iteration count If no solution problem or environment exists CPXgetmipitcnt returns the value 0 136 Global function CPXsolwritesolnpoolall int CPXsolwritesolnpoolall CPXCENVptr env CPXCLPptr lp const char filename str Definition file cplex h The routine CPXsolwritesolnpoolall writes all the solutions in the solution pool to a file for the selected CPLEX problem object The routine writes files in SOL format which is an XML format The SOL format is documented in the stylesheet solution xsl and schema solution xsdinthe include directory of the CPLEX distribution CPLEX File Formats Reference Manual also documents this format briefly Example status CPXsolwritesolnpoolall env lp myfile sol See Also CPXsolwrite CPXsolwritesolnpool Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to whic
504. r occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in the namestore array to hold the names 483 Global function CPXpresolve int CPXpresolve CPXCENVptr env CPXLPptr lp int method Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXpresolve performs LP or MIP presolve depending whether a problem object is an LP or a MIP If the problem is already presolved the existing presolved problem is freed and a new presolved problem is created Example Status CPXpresolve env lp CPX DUAL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob method An integer specifying the optimization algorithm to be used to solve the problem after the presolve is completed Some presolve reductions are specific to an optimization algorithm so specifying the algorithm makes sure that the problem is presolved for that algorithm and that presolve does not have to be repeated when that optimization routine is c
505. r risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcutcallbackadd adds cuts and lazy constraints to the current node LP subproblem during MIP branch and cut This routine may be called only from within user written cut callbacks thus it may be called only when the value of its wheref rom argument is CALLBACK CUT The cut be for the original problem if the parameter PARAM MIPCBREDLP Was set to OFF before the call to CPXmipopt that calls the callback In this case the parameter PARAM PRELINEAR should also be set to CPX OFF zero Otherwise the cut is used on the presolved problem Example status CPXcutcallbackadd env cbdata wherefrom mynzcnt myrhs LS mycutind mycutval 0 See also the example admipex5 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value that reports where the user written callback was called from This argument must be the value of wherefrom passed to the user written callback nzcnt An integer value that specifies the
506. r that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetprestat accesses presolve status information for the columns and rows of the presolved problem in the original problem and of the original problem in the presolved problem Table 1 Value of prestat p lo Ip is not presolved or there were no reductions has presolved problem 2 lo was reduced to an empty problem For variable i in the original problem values for pcstat i appear in Table 2 Table 2 Values for pcstat i gt 0 variable i corresponds to variable pcstat i in the presolved problem CPX PRECOL AGG j PX_PRECOL_OTHER variable i is aggregated out variable i is deleted or merged for some other reason For row i in the original problem values for prstat i appear in Table 3 Table 3 Values for prstatti CPX PREROW AGG 2 if row i is used for aggregation CPX PREROW OTHER 3 if row i is deleted for some other reason For variable i in the presolved problem values for ocstat i appear in Table 4 row i corresponds to row prstat i in the original problem Table 4 Values for ocstat i variable i in the presolved problem corresponds to variable ocstat i in the original problem variable i corresponds to a linear co
507. r to the CPLEX environment as returned by CPXopenCPLEX Returns The routine returns NULL if the environment does not exist and the pointer to a string otherwise 538 Global function CPXuncrushx int CPXuncrushx CPXCENVptr env CPXCLPptr lp double x const double prex Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXuncrushx uncrushes a solution for the presolved problem to the solution for the original problem Example status CPXuncrushx env lp x prex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX LP problem object as returned by CPXcreateprob x An array to receive the primal solution x values for the original problem as computed from primal values of the presolved problem object The array must be of length at least the number of columns in the LP problem object prex An array that contains primal solution x values for the presolved problem as returned by routines such as CPXgetx and CPXsolution when applied to the presolved problem object The array must be of le
508. ram This routine works in the same way as the routine CPXget 1pcallbackfunc It enables the user to create separate callback function to be called during the solution of mixed integer programming problems The prototype for the callback function is identical to that of CPXget1pcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX callback p The address of the pointer to the current user written callback function If no callback function has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer Example status CPXgetmipcallbackfunc env mycallback NULL Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the optimization Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata A pointer passed from the optimization routine to the user written callback function that identifies the LP problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value reporting from which optimization algorithm the user written callback function was called Possible values and their meaning appear in this table 426 Indicators of algorithm that called u
509. rameter numbers unique identifiers with nondefault values 545 Macro DUAL Definition file cplex h CPX DUAL OBJ Concert Technology enum DualObj Numeric meaning doub1e To access the objective value relative to the dual barrier solution This feature is available only for a barrier solution Integer meaning not applicable 546 Macro CPX EXACT KAPPA Definition file cplex h CPX EXACT KAPPA Concert Technology enum ExactKappa Numeric meaning double To access the exact condition number the scaled basis matrix This feature is available only for a simplex solution Integer meaning not applicable 547 Definition file cplex h CPX KAPPA Concert Technology enum Kappa Numeric meaning doub1e To access the estimated condition number of the scaled basis matrix This feature is available only for a simplex solution Integer meaning not applicable 548 Macro CPX SLACK Definition file cplex h CPX MAX COMP SLACK Concert Technology enum MaxCompSlack Numeric meaning doub1e To access the maximum violation of the complementary slackness conditions for the unscaled problem This feature is available only for a barrier solution Integer meaning To access the lowest index of a row or column with the largest violation of the complementary slackness conditions An index such as quality p strictly less than zero denotes
510. ray to receive the values of the lower bound values This array must be of length at least end begin 1 If successful 15 0 through 15 end begin contain the lower bound values for the current subproblem begin An integer specifying the beginning of the range of lower bounds to be returned end An integer specifying the end of the range of lower bounds to be returned Returns The routine returns zero if successful and nonzero if an error occurs 494 Global function CPXsetnetcallbackfunc int CPXsetnetcallbackfunc CPXENVptr env int CPXPUBLIC callback CPXCENVptr void int void void cbhandle Definition file cplex h The routine CPXsetnetcallbackfunc sets the user written callback routine to be called each time a log message is issued during the optimization of a network program If the display log is turned off the callback routine will still be called This routine works the same way as the routine CPXset lpcallbackfunc It enables the user to create separate callback function to be called during the solution of a network problem The prototype for the callback function is identical to that of CPXsetlpcallbackfunc Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the optimization Callback arguments env A pointer to the CPLEX environment that was passed
511. rays in which the nonzero entries of these rows are to be returned must be specified Note If the value of rmat space is 0 then the negative of the value of surplus p returned specifies the length needed for the arrays rmatval and rmatind Example Status CPXgetrows env lp amp nzcnt rmatbeg rmatind rmatval rmatspace amp surplus 0 cur numrows 1 Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob nzcnt p A pointer to an integer to contain the number of nonzeros returned that is the true length of the arrays rmatind and rmatval rmatbeg An array to contain indices specifying where each of the requested rows begins in the arrays rmatval and rmatind Specifically row i consists of the entries in rmatval and rmatind the range from rmatbeg i begin to rmatbeg i 1 begin 1 Row end consists of the entries from rmatbeg end begin to nzcnt p 1 This array must be of length at least end begin 1 rmatind An array to contain the column indices of the entries of xmat val May be NULL if rmatspace is 0 rmatval An array to contain the nonzero entries of the specified rows May be NULL if rmatspace is 0 rmatspace An integer specifying the length of the arrays rmat ind and rmatval be 0 surplus p A pointer to an integer to contain the difference between rmat space and the num
512. re associated with the variables If column names are passed to CPXnewcols but existing variables have no names assigned default names are created for the existing variables Returns The routine returns zero if successful and nonzero if an error occurs 98 Global function CPXprechgobj int CPXprechgobj CPXCENVptr env CPXLPptr lp int cnt const int indices const double values Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXprechgobj changes the objective function coefficients of an LP problem object and its associated presolved LP problem object The CPLEX parameter CPX PARAM REDUCE must be set to CPX PREREDUCE PRIMALONLY 1 PREREDUCE NOPRIMALORDUAL 0 atthe time of the presolve in order to change objective coefficients and preserve the presolved problem This routine should be used in place of CPXchgob when it is desired to preserve the presolved problem The arguments and operation of CPXprechgopb j are the same as those of CPXchgobj The objective coefficient changes are applied to bot
513. re the specified righthand side coefficients are to be returned This array must be of length at least end begin 1 The righthand side of constraint i is returned in rhs i begin begin An integer specifying the beginning of the range of righthand side terms to be returned end An integer specifying the end of the range of righthand side terms to be returned Returns The routine returns zero if successful and nonzero if an error occurs 460 Global function CPXgetsolnpoolnummipstarts int CPXgetsolnpoolnummipstarts CPXCENVptr env CPXCLPptr lp Definition file cplex h This routine is deprecated Use CPXgetnummipstarts instead The routine CPXgetsolnpoolnummipstarts accesses the number of MIP starts stored in the solution pool of a CPLEX problem object Example status CPXgetsolnpoolnummipstarts env 1 See Also CPXgetnummipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If the CPLEX problem object or environment does not exist CPXgetsolnpoolnummipstarts returns the value 0 zero otherwise it returns the number of MIP starts 461 Global function CPXgetlogfile int CPXgetlogfile CPXCENVptr env CPXFILEptr logfile p Definition file cplex h The routine CPXget logfile accesses the log file to which messages from all four CPLEX defined channels are written Example sta
514. rence Manual 37 Group optim cplex callable portability The portability routines in the CPLEX Callable Library Function Summary CPXfclose CPXfopen CPXfputs CPXgettime CPXmsgstr CPXputenv CPXstrlen CPXversion Portability routines are needed for Windows platforms They may also be used on UNIX platforms 38 Group optim cplex callable querygeneralproblem The routines in the CPLEX Callable Library to query general problem data Function Summary CPXgetcoef CPXgetcolindex CPXgetcolname CPXgetcols CPXgetlb CPXgetnumcols CPXgetnumnz CPXgetnumrows CPXgetobj CPXgetobjname CPXgetobjsen CPXgetprobname CPXgetprobtype CPXgetrhs CPXgetrngval CPXgetrowindex CPXgetrowname CPXgetrows CPXgetsense CPXgetub These routines to access information about a problem object after it has been created can be used at any time even after problem modifications 39 Group optim cplex callable querymip The routines in the CPLEX Callable Library to query MIP problem data Function Summary CPXgetctype CPXgetindconstr CPXgetindconstrindex CPXgetindconstrname CPXgetnumbin CPXgetnumindconstrs CPXgetnumint CPXgetnumsemicont CPXgetnumsemiint CPXgetnumsos CPXgetorder CPXgetsos CPXgetsosindex CPXgetsosname These routines to access information about a MIP problem object after it has been created can be used at any time even after problem modifications 40 Group optim c
515. returned by CPXcreateprob cnt An integer that specifies the total number of range coefficients to be changed and thus specifies the length of the arrays indices and values indices An array of length cnt containing the numeric indices of the rows corresponding to the linear constraints for which range coefficients are to be changed values An array of length cnt containing the new values of the range coefficients of the linear constraints present in indices Returns The routine returns zero if successful and nonzero if an error occurs 245 Global function CPXNETaddnodes int CPXNETaddnodes CPXCENVptr env CPXNETptr net int nnodes const double supply char name Definition file cplex h The routine CPXNETaddnodes adds new nodes to the network stored in a network problem object Example status CPXNETaddnodes env net nnodes supply NULL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob nnodes Number of nodes to add supply Supply values for the added nodes If NULL is passed all supplies defaults to 0 zero Otherwise the size of the array must be at least nnodes name Pointer to an array of names for added nodes If NULL is passed and the existing nodes have names default names are assigned to the added nodes If NULL is passed but the existing nodes have no names the new nodes are ass
516. ries in sosind and soswt in the range from sosbeg k begin to 1 begin 1 Set end consists of the entries from sosbeg end begin tonumsosnz_p 1 This array must be of length at least end begin 1 sosind An array to contain the variable indices of the SOS members May be NULL if sosspace is 0 zero soswt An array to contain the reference values weights for SOS members May be NULL if sosspace is 0 zero Weight soswt k corresponds to sosind k sosspace An integer specifying the length of the arrays sosind and soswt May be 0 zero surplus p A pointer to an integer to contain the difference between sosspace and the number of entries in each of the arrays sosind and soswt A nonnegative value of surplus p reports that the length of the arrays was sufficient A negative value reports that the length was insufficient and that the routine could not complete its task In this case the routine CPXget sos returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p specifies the amount of insufficient space in the arrays begin An integer specifying the beginning of the range of 5055 to be returned end An integer specifying the end of the range of SOSs to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in the arrays sosind and soswt to hold
517. rmation is requested Table 1 summarizes the possible values Table 2 summarizes possible values returned when the type of information requested is branch type that is whichinfo CPX CALLBACK INFO NODE TYPE result p generic pointer to a variable of type double or int representing the value returned by whichinfo The column C Type in Table 1 shows the type of various values returned by whichinfo Returns 232 The routine returns zero if successful nonzero if an error occurs The return value CPXI reports an attempt to access a node currently located in a node file on disk ERR NODI P ON DISK 233 Global function CPXbinvrow int CPXbinvrow CPXCENVptr env CPXCLPptr lp int i double y Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbinvrow computes the i th row of the basis inverse Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to the CPLEX LP problem object as returned by CPXcreateprob An integer that specifies the index of the
518. ro coefficients of the matrix Q The meaning of these vectors is identical to the meaning of the corresponding vectors matbeg matcnt matind and matval which are used to specify the structure of A in a call to CPXcopylp Q must be symmetric when copied by this function Therefore if the quadratic coefficient in algebraic form is 2x1x2 then x2 should be in the list for x1 and x7 should be in the list for x2 and the coefficient would be 1 0 each of those entries See the corresponding example C program to review how the symmetry requirement is implemented Note CPLEX evaluates the corresponding objective with a factor of 0 5 in front of the quadratic objective term When you build or modify your model with this routine you can verify that the results are as you intended by calling CPXcheckcopyquad during application development How the arrays are accessed Suppose that CPLEX wants to access the entries a column 5 These are assumed to be given by the array entries qmatval qgmatbeg jll qmatval gmatbeg j gmatcnt j 1 The corresponding column index entries are qmatind qmatbeg j qmatind qmatbeg j qmatent j 1 The entries in gmat ind k are not required to be in column order Duplicate entries in gmat ind within a single column are not allowed Note that any column j that has only a linear objective term has qmatcnt j 0 no entries in qmat ind and qmatval Example Status CPXcopyquad env lp qm
519. ror occurs If nonzero the requested value may not be available for the specific optimization algorithm For example the dual objective is not available from primal simplex 389 Global function CPXgetcallbacknodeintfeas int CPXgetcallbacknodeintfeas CPXCENVptr env void cbdata int wherefrom int feas int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbacknodeintfeas retrieves information for each variable about whether or not the variable is integer feasible in the node subproblem It can be used in a user written callback during MIP optimization The information is from the original problem if CPX MIPCBREDLP is set to CPX OFF Otherwise they are from the presolved problem Example Status CPXgetcallbacknodeintfeas env cbdata wherefrom feas 0 cols 1 See and admipex2 c in the standard distribution This routine may be called only when the value of the wherefrom argument is one of the following CALLBACK CPX CALLBACK MIP BRANCH CPX CALLBACK MIP INCUMB
520. routine also computes a relaxed solution vector that can be queried with CPXsolution CPXgetcolinfeas for columns CPXget rowinfeas for rows CPXgetqconstrinfeas for quadratic constraints CPXgetindconstrinfeas for indicator constraints or CPXget sosinfeas for special ordered sets The arguments to this routine define the set of groups Each group contains a list of member constraints and each member has a type lower bound upper bound linear constraint quadratic constraint or indicator constraint The group members and member types are entered by means of a data structure similar to the sparse matrix data structure used throughout CPLEX See CPXcopylp for one example The argument grpbeg gives the starting location of each group in grpind and grpt ype The list of members for group i can be found in grpind grpbeg i through grpind grpbeg it 1 1 foriless than grpcnt 1 and grpind grpbeg i through grpind concnt 1 fori grpcnt 1 The corresponding constraint types for these members be found grptype grpbeg i through grptype grpbeg i 1 1 foriless than concnt 1 and grptype grpbeg grpcnt 1 through arptype concnt 1 fori grpcnt 1 A constraint can appear in at most one group A constraint that appears in no group will not be relaxed Table 1 Possible values for elements of grptype CPX CON LOWER BOUND variable lower bound CPX CON ER BOUND variable upper bound CPX CON LINEAR linear constraint CPX CON Q
521. row i 1 or the slack variable for that row in the case of columns This feature is available only for a barrier solution 549 Macro CPX DUAL INFEAS Definition file cplex h CPX MAX DUAL INFEAS Concert Technology enum MaxDuallnfeas Numeric meaning double To access the maximum of dual infeasibility or equivalently the maximum reduced cost infeasibility for the unscaled problem Integer meaning To access the lowest index where the maximum dual infeasibility occurs for the unscaled problem 550 Macro CPX DUAL RESIDUAL Definition file cplex h CPX MAX DUAL RESIDUAL Concert Technology enum MaxDualResidual Numeric meaning doub1e To access maximum dual residual value For a simplex solution this is the maximum of the vector c B pi and for a barrier solution it is the maximum of the vector A pi rc c for the unscaled problem Integer meaning To access the lowest index where the maximum dual residual occurs for the unscaled problem 551 Macro CPX INDSLACK INFEAS Definition file cplex h CPX MAX INDSLACK INFEAS Concert Technology enum not applicable Numeric meaning double To access the maximum infeasibility of the indicator constraints or equivalently the maximum bound violation of the indicator constraint slacks Integer meaning To acces the lowest index of the indicator constraints where the maximum indicator slack infeasibility occurs Can use a supplied primal solu
522. row to be computed An array containing the i th row of Binv the inverse of the matrix B The array must be of length at least equal to the number of rows in the problem Returns The routine returns zero if successful and nonzero if an error occurs 234 Global function CPXcleanup int CPXcleanup CPXCENVptr env CPXLPptr lp double eps Definition file cplex h The routine CPXcleanup changes to zero any problem coefficients that are smaller in magnitude than the tolerance specified in the argument eps This routine may be called at any time after a problem object has been created by a call to CPXcreateprob This practice is also known as zero ing out the negligible coefficients Such coefficients may arise as round off errors if the matrix coefficients are computed with floating point arithmetic Example status CPXcleanup env lp eps Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob eps A tolerance to determine whether coefficients in the problem are sufficiently small in magnitude to eliminate Returns The routine returns zero unless an error occurred during the optimization 235 Global function CPXgetnodecnt int CPXgetnodecnt CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnodecnt accesses the number of nodes used to solve a mixed integer problem Example nodecoun
523. rray must be at least narcs and every name in the array must be a string terminating in O zero Returns The routine returns zero on success and nonzero if an error occurs 182 Global function CPXNETchgnodename int CPXNETchgnodename CPXCENVptr env CPXNETptr net int cnt const int indices char newname Definition file cplex h The routine CPXNETchgnodename changes the names of a set of nodes in the network stored in a network problem object Example status CPXNETchgnodename env net 10 indices newname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob cnt An integer that indicates the total number of node names to be changed Thus cnt specifies the length of the arrays indices and name indices An array of length cnt containing the numeric indices of the nodes for which the names are to be changed newname An array of length cnt containing the new names for the nodes specified in indices Returns The routine returns zero on success and nonzero if an error occurs 183 Global function CPXchgbds int CPXchgbds CPXCENVptr env CPXLPptr lp int cnt const int indices const char lu const double bd Definition file cplex h The routine CPXchgbds changes the lower or upper bounds on a set of variables of a problem Several bounds can be changed at once with each bound
524. rray used with rmatind and rmatval to define the rows to be added 213 rmatval colname rowname Returns An array used with rmatbeg and rmat val to define the rows to be added An array used with rmatbeg and rmatind to define the rows to be added The format is similar to the format used to describe the constraint matrix the routine CPXcopylp see description of matbeg matcnt matind and matval in that routine but the nonzero coefficients are grouped by row instead of column in the array rmatval The nonzero elements of every row must be stored in sequential locations in this array from position rmatbeg i to rmatbeg i 1 1 or from rmatbeg i tonzcnt 1 if i rcnt 1 Each entry rmatind il specifies the column index of the corresponding coefficient rmatval i Unlike CPXcopylp all rows must be contiguous and rmatbeg 0 must be 0 zero An array of length ccnt containing pointers to character strings that represent the names of the new columns added to the CPLEX problem object or equivalently the new variable names May be NULL in which case the new columns are assigned default names if the columns already resident in the CPLEX problem object have names otherwise no names are associated with the variables If column names are passed to CPXaddrows but existing variables have no names assigned default names are created for them An array containing pointers to character strings that represent the names of
525. rs env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob filename str A character string containing the name of the file to which the perturbed LP problem should be written epsilon The perturbation constant Returns The routine returns zero if successful and nonzero if an error occurs 217 Global function CPXgetobj int CPXgetobj CPXCENVptr env CPXCLPptr lp double obj int begin int end Definition file cplex h The routine CPXgetob accesses a range of objective function coefficients of a CPLEX problem object The beginning and end of the range must be specified Example status CPXgetobj env lp obj 0 cur numcols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to CPLEX problem object as returned by CPXcreateprob obj An array where the specified objective coefficients are to be returned This array must be of length atleast end begin 1 The objective function coefficient of variable j is returned inobj j begin begin An integer specifying the beginning of the range of objective function coefficients to be returned end An integer specifying the end of the range of objective function coefficients to be returned Returns The routine returns zero if successful and nonzero if an error occurs 218 Global function CPXcopyqpsep int CPXcopyqpsep CPXCE
526. rs 315 Global function CPXNETchgobjsen int CPXNETchgobjsen CPXCENVptr env CPXNETptr net int maxormin Definition file cplex h The routine CPXNETchgob jsen is used to change the sense of the network problem to a minimization or maximization problem Any solution information stored in the problem object is lost Changed optimization sense in a network problem CPX MAX For a maximization problem CPX MIN For a minimization problem Example Status CPXNETchgobjsen env net CPX Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob maxormin New optimization sense for the network problem The possible values are in the table Returns The routine returns zero on success and nonzero if an error occurs 316 Global function CPXgetsolnpoolfilterindex int CPXgetsolnpoolfilterindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXgetsolnpoolfilterindex searches for the index number of the specified filter of a CPLEX problem object Example Status CPXgetsolnpoolfilterindex env lp amp setindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str A filter name to search for index p A po
527. rs env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob X Array in which to write solution or flow values for requested arcs If NULL is passed no solution vector is returned Otherwise x must point to an array of size at least end begin 1 begin Index of the first arc for which a solution or flow value is to be obtained end Index of the last arc for which a solution or flow value is to be obtained Returns The routine returns zero on success and nonzero if an error occurs 437 Global function CPXpreaddrows int CPXpreaddrows CPXCENVptr env CPXLPptr lp int rcnt int nzcnt const double rhs const char sense const int rmatbeg const int rmatind const double rmatval char rowname Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXpreaddrows adds rows to an LP problem object and its associated presolved LP problem object The CPLEX parameter PARAM REDUCE must be set to PREREDUCE PRIMALONLY 1 or CPX PREREDUCE NOPR
528. rs The parameter PARAM QPMETHOD controls the choice of optimizer Dual Simplex Primal Simplex or Barrier With the default setting of this parameter that is Automatic CPLEX invokes the barrier method because it is fastest on a wide range of problems Example status CPXqpopt env lp See Also CPXgetmethod Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to the CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object PROBLEM Exceeding a user specified CPLEX limit or proving the model infeasible or unbounded are not considered errors Note that a zero return value does not necessarily mean that a solution exists Use the query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 425 Global function CPXgetmipcallbackfunc int CPXgetmipcallbackfunc CPXCENVptr env int CPXPUBLIC callback p CPXCENVptr void int void void cbhandle p Definition file cplex h The routine CPXgetmipcallbackfunc accesses the user written callback routine to be called prior to solving each subproblem in the branch and cut tree during the optimization of a mixed integer prog
529. rsity filters 695 Macro CPXERR ILL DEFINED PWL Definition file cplex h CPXERR ILL DEFINED PWI 1213 A piecewise linear function has been defined with a discontinuity at the anchor point Such a definition does not fully specify the piecewise linear function 696 Macro CPXERR LICENSE Definition file cplex h CPXERR ILOG LICENSE 32201 ILM Error A licensing error has occurred Check the environment variable 106 LICENSE FILE For more information consult the troubleshooting section of the LOG License Manager User s Guide and Reference Manual 697 Macro CPXERR IN INFOCALLBACK Definition file cplex h CPXERR IN INFOCALLBACK 1804 Calling routines not allowed in informational callback CPLEX encountered an error in an informational callback when the user written callback attempted to invoke a routine other than the routines CPXgetcallbackinfo CPXgetcallbackincumbent allowed in informational callbacks 698 Macro CPXERR INDEX NOT BASIC Definition file cplex h CPXERR INDEX NOT BASIC 1251 Index must correspond to a basic variable The requested variable is not basic 699 Macro CPXERR INDEX RANGE Definition file cplex h CPXERR INDEX RANGE 1200 Index is outside range of valid values Selected index is too large or small 700 Definition file cplex h CPXERR INDEX RANGE HIGH 1206 96s end value d is greater than
530. s env lp 1 lower upper Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob begin An integer specifying the beginning of the range of ranges to be returned end An integer specifying the end of the range of ranges to be returned lower An array where the righthand side lower range values are to be returned This array must be of length at least end begin 1 upper An array where the righthand side upper range values are to be returned This array must be of length at least end begin 1 Returns The routine returns zero if successful and nonzero if an error occurs This routine fails if no optimal basis exists 211 Global function CPXgetintquality int CPXgetintquality CPXCENVptr env CPXCLPptr lp int quality p int what Definition file cplex h The routine CPXgetintquality accesses integer valued information about the quality of the current solution of a problem A solution though not necessarily a feasible or optimal one must be available in the CPLEX problem object The quality values are returned in the int variable pointed to by the argument quality p Example Status CPXgetintquality env lp amp max x ind CPX MAX X Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob quality p A pointer to
531. s a separate callback function to be called during the solution of mixed integer programming problems MIPs Unlike any other callback routines this user written callback routine is used only to retrieve information about MIP search It does not control the search though it allows the search to terminate The user written callback function that this routine invokes is allowed to call only two other routines CPXgetcallbackinfo and CPXgetcallbackincumbent The prototype for the user written callback function is identical to that of CPXsetmipcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX callback p The address of the pointer to the current user written callback function If no callback function has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer Example status CPXgetinfocallbackfunc env mycallback NULL Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero return value terminates the optimization That is if your user written callback function returns a nonzero value it signals CPLEX that the optimization should terminate Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata A pointer passed from the optimization r
532. s a sequence number among all cuts generated The parameter PARAM REDUCE must be set to CPX PREREDUCE PRIMALONLY 1 or CPX PREREDUCE NOPRIMALORDUAL 0 ifthe constraints to be added in the callback are lazy constraints that is not implied by the constraints in the constraint matrix The parameter CPX PARAM PRELINEAR must be set to 0 if the constraints to be added are in terms of the original problem and the constraints are valid cutting planes Example Status CPXsetcutcallbackfunc env mycutfunc mydata See also the example admipex5 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX 342 cutcallback The pointer to the current user written cut callback If no callback has been set the pointer evaluates to NULL cbhandle A pointer to user private data This pointer is passed to the user written cut callback Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle int useraction p CPLEX calls the cut callback when the LP subproblem for a node has an optimal solution with objective value below the cutoff and is integer infeasible Callback return value The callback returns zero if successful and nonzero if an error occurs Callback arguments env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata A pointer passed from the optimizatio
533. s by solving the continuous relaxation of its subproblem that is the subproblem without integrality constraints If the solution violates any cuts CPLEX may add some or all of them to the node problem and may resolve it if CPLEX has added cuts This procedure is iterated until no more violated cuts are detected or deemed worth adding at this time by the algorithm If at any point in the addition of cuts the node becomes infeasible the node is pruned that is it is removed from the tree Otherwise CPLEX checks whether the solution of the node problem satisfies the integrality constraints If so and if its objective value is better than that of the current incumbent the solution of the node problem is used as the new incumbent If not branching will occur but first a heuristic method may be tried at this point to see if a new incumbent can be inferred from the LP QP solution at this node and other methods of analysis may be performed on this node The branch when it occurs is performed on a variable where the value of the present solution violates its integrality requirement This practice results in two new nodes being added to the tree for later processing Each node after its relaxation is solved possesses optimal objective function value Z At any given point in the algorithm there is a node whose Z value is better less in the case of a minimization problem or greater for a maximization problem than all the others This Best No
534. s in the network stored in a network problem object Any solution information stored in the problem object is lost Example Status CPXNETchgarcs env net cnt indices newfrom newto Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob cnt Number of arcs to change indices An array of arc indices that indicate the arcs to be changed This array must have a length of at least cnt All indices must be in the range O narcs 1 fromnode An array of from node indices The from node for each arc listed in indices is changed to the corresponding value from this array All node indices must be in the range 0 nnodes 1 The size of the array must be at least cnt tonode An array of to node indices The to node for each arc listed in indices is changed to the corresponding value from this array All node indices must be in the range 0 nnodes 1 The size of the array must be at least cnt Returns The routine returns zero on success and nonzero if an error occurs 298 Global function CPXgetsiftphase1cnt int CPXgetsiftphaselcnt CPXCENVptr env CPXCLPptr 1 Definition file cplex h The routine CPXgetsiftphaselcnt accesses the number of Phase sifting iterations to solve an LP problem Example itcnt CPXgetsiftphaselcnt env 1p Parameters env A pointer to the CPLEX environment as returned by CPXop
535. s located The linear objective row is referenced with i 1 j An integer that specifies the numeric index of the column in which the coefficient is located The RHS column is referenced with j 1 The range value column is referenced with j 2 1f j 2 is specified and row i is not a ranged row an error status is returned newvalue The new value for the coefficient being changed Returns The routine returns zero if successful and nonzero if an error occurs 541 Global function CPXgetqconstrslack int CPXgetqconstrslack CPXCENVptr env CPXCLPptr lp double qcslack int begin int end Definition file cplex h The routine CPXgetqconstrslack is used to access the slack values for a range of the quadratic constraints of a quadratically constrained program The beginning and end of the range must be specified The slack values returned consist of the righthand side minus the constraint activity level Example Status CPXgetqconstrslack env lp qcslack 0 CPXgetnumqconstrs env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob qcslack An array to receive the values of the slack or surplus variables for each of the constraints This array must be of length at least end begin 1 If successful 1 0 through qcslack end begin contain the values of the slacks begin An integer indicating the be
536. s to be returned end An integer specifying the end of the range of dual values to be returned Example Status CPXgetpi env lp pi 0 CPXgetnumrows env lp 1 Returns The routine returns zero if successful and nonzero if an error occurs 190 Global function CPXreadcopyprob int CPXreadcopyprob CPXCENVptr env CPXLPptr lp const char filename str const char filetype str Definition file cplex h The routine CPXreadcopyprob reads an MPS LP or SAV file into an existing CPLEX problem object Any existing data associated with the problem object is destroyed The problem can then be optimized by any one of the optimization routines To determine the contents of the data use CPLEX query routines The type of the file may be specified with the filetype argument When the filetype argument is NULL the file name is checked for one of these suffixes 1p mps or sav CPLEX will also look for the following additional optional suffixes 7 gz or bz2 If the file name matches of these patterns filetype is set accordingly If filetype is NULL and none of these strings is found at the end of the file name or if the specified type is not recognized CPLEX attempts automatically to detect the type of the file by examining the first few bytes If the file name ends in gz bz2 or z the file is read as a compressed file on platforms where the corresponding file compression application has been installed properly T
537. sdpushocnt accesses the number of dual push iterations in the crossover method A push occurs when a nonbasic variable switches bounds and does not enter the basis Example itcnt CPXgetcrossdpushcnt env 1p Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns the dual push iteration count if a solution exists If no solution exists it returns zero 248 Global function CPXgetparamtype int CPXgetparamtype CPXCENVptr env int whichparam int paramtype Definition file cplex h The routine CPXgetparamtype returns the type of a CPLEX parameter given the symbolic constant or reference number for it The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example Status CPXgetparamtype env CPX PARAM ADVIND amp paramtype Possible values returned in paramtype CPX PARAMTYPE NONE 0 zero CPX PARAMTYPE INT 1 one CPX PARAMTYPE DOUBLE 2 CPX PARAMTYPE STRING 3 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam An integer specifying the symbolic constant or reference number of the parameter for which the type is to be obtained paramtype A pointer to an integer to receive the type Returns The routine returns zero if successful and nonzero if an error occurs
538. ser written callback From probing or clique merging From Gomory fractional P FRACCU cuts From Mixed Integer Rounding cuts P FLOWMIR cbhandle Pointer to user private data as passed to CPXsetmipcallbackfunc See Also CPXgetcallbackinfo Returns The routine returns zero if successful and nonzero if an error occurs 427 Global function CPXtuneparamprobset int CPXtuneparamprobset CPXENVptr env int filecnt char filename char filetype int intcnt const int intind const int intval int dblcnt const int dblind const double dblval int strcnt const int strind char strval int tunestat p Definition file cplex h The routine CPXtuneparamprobset tunes the parameters of the CPLEX environment for improved optimizer performance for a set of problems Tuning is carried out by making a number of trial runs with a variety parameter settings Parameters and associated values which should not be changed by the tuning process known as the fixed parameters can be specified as arguments This routine does not apply to network models nor to quadratically constrained programming problems QCP After CPXtuneparamprobset has finished the environment will contain the combined fixed and tuned parameter settings which the user can query or write to a file All callbacks except the tuning callback will be ignored Tuning will monitor the value set by CPXsett
539. sercuts does not accept a NULL pointer for the array of righthand side values or senses Example status CPXaddusercuts env lp cutcnt cutnzcnt cutrhs cutsense cutbeg cutind cutval NULL See also admipex4 c in the standard distribution Values of sense G gt constraint Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob rcnt An integer that specifies the number of new rows to be added to the constraint matrix nzcnt An integer that specifies the number of nonzero constraint coefficients to be added to the constraint matrix This specifies the length of the arrays rmatind and rmatval rhs An array of length rcnt containing the righthand side term for each constraint to be added to the CPLEX problem object sense An array of length rcnt containing the sense of each constraint to be added to the CPLEX problem object Possible values of this argument appear in the table rmatbeg array used with rmatind and rmatval to define the rows to be added rmatind array used with rmatbeg and rmatval to define the rows to be added 412 rmatval rowname Returns An array used with rmatbeg and rmatind to define the rows to be added The format is similar to the format used to describe the constraint matrix the routine CPXcopylp see description of matbeg matcnt matind and matval in that routine bu
540. sful and nonzero if an error occurs 411 Global function CPXaddusercuts int CPXaddusercuts CPXCENVptr env CPXLPptr lp int rcnt int nzcnt const double rhs const char sense const int rmatbeg const int rmatind const double rmatval char rowname Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXaddusercuts adds constraints to the list of constraints that should be added to the LP subproblem of a MIP optimization if they are violated CPLEX handles addition of the constraints and makes sure that all integer solutions satisfy all the constraints The constraints are added to those specified in prior calls to CPXaddusercuts The constraints must be cuts that are implied by the constraint matrix The CPLEX parameter CPX PARAM PRELINEAR should be set to CPX_OFF 0 Use CPXfreeusercuts to clear the list of cuts The arguments of CPXaddusercuts are the same as those of CPXaddrows With the exception that new columns may not be specified so there are ccnt and arguments Furthermore unlike CPXaddrows CPXaddu
541. sible solution including one provided by a MIP start before any nodes exist against lazy constraints The callback routine adds globally valid cuts to the LP subproblem Example CPXgetcutcallbackfunc env amp current cutfunc amp current data See also Advanced MIP Control Interface in the CPLEX User s Manual For documentation of callback arguments see the routine CPXsetcutcallbackfunc Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cutcallback p The address of the pointer to the current user written cut callback If no callback has been set the pointer evaluates to NULL cbhandle p The address of a variable to hold the user s private pointer See Also CPXcutcallbackadd CPXsetcutcallbackfunc Returns This routine does not return a result 224 Global function int CPXgetnumint CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetnumint accesses the number of general integer variables in a CPLEX problem object Example numint CPXgetnumint env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example numint CPXgetnumint env lp Returns If the problem object or environment does not exist CPXgetnumint returns zero Otherwise it returns the number of general integer variables in the problem object
542. solute values in the primal solution vector for the unscaled problem Integer meaning not applicable Can use a supplied primal solution 628 Macro STRONGBRANCH Definition file cplex h CPXERR ABORT STRONGBRANCH 1263 Strong branching aborted Strong branching for variable selection could not proceed because a subproblem optimization was aborted 629 Macro SIGN QUAD Definition file cplex h CPXERR ADJ SIGN QUAD 1606 Lines d d Adjacent sign and quadratic character The previous line ended with a or so the subsequent line must start with a variable name rather than an one of the reserved quadratic characters 630 Macro CPXERR ADJ SIGN SENSE Definition file cplex h CPXERR ADJ SIGN SENSE 1604 Lines d d Adjacent sign and sense A sense specifier erroneously follows an arithmetic operator 631 Macro CPXERR ADJ SIGNS Definition file cplex h CPXERR ADJ SIGNS 1602 Lines d d Adjacent signs The previous line ended with a plus or minus so the next line must start with a variable name rather than an operator 632 Macro ALGNOTLICENSED Definition file cplex h CPXERR ALGNOTLICENSED 32024 Licensing problem Optimization algorithm not licensed The license is not configured for this optimization algorithm For example this error occurs when anyone tries to invoke the CPLEX Barrier Optimizer with a license key that does not permit t
543. solution required The requested operation can be performed only on a problem determined to be unbounded 782 Macro CPXERR NULL NAME Definition file cplex h CPXERR NULL NAME 1224 Null pointer d in name array Null pointers are not allowed in name arrays 783 Macro CPXERR NULL POINTER Definition file cplex h CPXERR NULL POINTER 1004 Null pointer for required data A value of NULL was passed to a routine where NULL is not allowed 784 Macro CPXERR ORDER BAD DIRECTION Definition file cplex h CPXERR ORDER BAD DIRECTION 3007 Illegal direction entry d Legal direction entries are limited to the values CPX BRANCH GLOBAL CPX BRANCH DOWN and CPX BRANCH UP 785 Macro CPXERR PARAM INCOMPATIBLE Definition file cplex h CPXERR PARAM INCOMPATIBLE 1807 Incompatible parameters Incompatible parameters cannot be used together In particular PARAM POLISHTIME cannot be used with any of the PARAM POLISHAFTER parameters 786 Macro CPXERR TOO BIG Definition file cplex h CPXERR PARAM TOO BIG 1015 Parameter value too big The value of the CPLEX parameter is outside the range of possible settings 787 Macro CPXERR PARAM TOO SMALL Definition file cplex h CPXERR PARAM TOO SMALL 1014 Parameter value too small The value of the CPLEX parameter is outside the range of possible settings 788 Macro CPXERR PRESLV ABORT Definition file cplex h CPXERR PRESLV ABORT
544. sos int CPXgetsos CPXCENVptr env CPXCLPptr lp int numsosnz p char sostype int sosbeg int sosind double soswt int sosspace int surplus p int begin int end Definition file cplex h The routine CPXget sos accesses the definitions of a range of special ordered sets SOS stored in a CPLEX problem object The beginning and end of the range along with the length of the array in which the definitions are to be returned must be provided Note If the value of sosspaceis 0 zero then the negative of the value of surplus p returned specifies the length needed for the arrays sosind and soswt Example Status CPXgetsos env lp amp numsosnz sostype sosbeg sosind Soswt sosspace amp surplus 0 numsos 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob numsosnz p pointer to an integer to contain the number of set members returned that is the true length of the arrays sosind and soswt sostype An array to contain the types of the requested SOSs The type of set k is returned in sostype k begin This array must be of length at least end begin 1 The entry contains either CPX TYPE 5051 17 for type 1 or CPX_TYPE_SOS2 2 for type 2 sosbeg An array to contain indices specifying where each of the requested SOSs begins in the arrays sosind soswt Specifically set consists of the ent
545. specified by the index of the variable with which it is associated The value of a variable can be fixed at one value by setting the upper and lower bounds to the same value Unbounded Variables If a variable lacks a lower bound then CPXget 1b returns a value less than or equal to INFBOUND If a variable lacks an upper bound then CPXgetub returns a value greater than or equal to INFBOUND These conventions about unbounded variables should be taken into account when you change bounds with CPXchgbds Example status CPXchgbds env lp cnt indices lu bd Values of lu denoting lower or upper bound in indices j bd j is a lower bound lu j U 31 is an upper bound lu j I bd 3 is the lower and upper bound Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer that specifies the total number of bounds to be changed and thus specifies the length of the arrays indices lu and ba indices An array of length cnt containing the numeric indices of the columns corresponding to the variables for which bounds are to be changed lu An array of length cnt containing characters that tell whether the corresponding entry in the array specifies the lower or upper bound on column indices j Possible values appear in the table bd An array of length cnt containing the new values of the lower or
546. ssssssssssssssssssssssssesssssessssssesssseesssseessssiesssssessssueesssseessssneesseseeessase 855 Macro CPXMIP_ABORT_INFEAS c ssssssssssssssssssssssssssssssssssssssessssssessssssesssssessssesssssiesssseesssseessssuessssneesseneesssass 856 Macro CPXMIP_ABORT_RELAXED sssssssssssssssssssssssssssssssssssesssssssssssssessssusesssseessssieesssueesssseesssseessssneesssneesssass 857 Macro CPXMIP FAIL FEAS is 858 Macro FAIL FEAS TREE nennt ttt 859 Macro FAIL INFEAS ennt ttt 860 Macro FAIL INFEAS NO 4 4 44 861 Macro CPXMIP FEASIBLE 2225 862 Macro FEASIBLE RELAXED 4 44 2 4 404 1240 863 Macro FEASIBLE RELAXED 1 864 Macro FEASIBLE RELAXED 50 2 44444 865 Macro 4 ttt ttt ntt 866 Macro CPXMIP_INFOrUNBDL sscssssssssssssssssssstsssssssssssssssssssssssssesssssseessssiesssseesssstessssiessssueesssueessssue
547. ssssssssssssssssssssssssssssssssesssssseesssssessssessssseessssiessssuessssueessssueesssseesssseesssase 754 Macro CPXERR NO RHS 755 Macro CPXERR NO RHS 44 449 8 ttt 756 Macro CPXERR_NO_RNGVAL w ssssssssssssssssssssssssssssssssssssssesessssessssssssssesesssnsessssesessassesssuaeessuneessanessssneeeseaueessans 757 Macro CPXERR ROW 4 758 Macro CPXERR SENGE eet 759 xxiii Table of Contents Macro CPXERR ROWS 5 ttt 760 Macro CPXERR NO 5 41 404 ttt ttt ttt 761 Macro CPXERR NO SOLN ts dE eed 762 Macro CPXERR NO 5 763 Macro CPXERH NO SOS 2 a RU Ese 764 Macro CPXERR NO SOS 5 ttt ttt ttt ttt 765 Macro CPXERR TREE entente tnnt ttt 766 Macro CPXERR NO VECTOR 501 767 Macro CPXERR NODE INDEX 768 Macro CPXERR NODE 769 Macro CPXERR NOT DUAL
548. ssssueesseseesssase 867 Macro CPXMIP_MEM_LIM_FEAS cc sssssssssssssssssssssssssssssssssssssssssssssssssssessssssssssssssssiessssseesssueesssstesssseesssseeessase 868 Macro INFEAS nnne 869 Macro 5 4 4 4 1444 44 870 Macro NODE INFEAG cenntntntttnnttttnttttntttttnttttn 871 Macro CPXMIP OPTIMALSs DM E UL ote c ILU 872 Macro OPTIMAL INFEAS ennt 873 Macro OPTIMAL 4 4 ttt 874 Macro OPTIMAL POPULATED TOL nce ttt 875 xxvii Table of Contents Macro CPXMIP OPTIMAL RELAXED 876 Macro OPTIMAL RELAXED nannte satt asma atas sna snas 877 Macro CPXMIP OPTIMAL RELAXED 60 2 22 20 00 878 Macro CPXMIP OPTIMAL TOL 0101 879 Macro POPULATESOL LIM eeeeeeeeteeeee tenente ntes tn nnns ates ansa tn sata asas atn ass 880 Macro 5 881 Macro CPXMIP TIME
549. st equal the number of rows in the LP problem object x An array that contains primal solution x values for a problem as returned by such routines as CPXuncrushx and CPXcrushx The length of the array must at least equal the number of columns in the LP problem object dj Anarray to receive the reduced cost values computed from the values for the problem object The length of the array must at least equal the number of columns in the problem object Returns The routine returns zero if successful and nonzero if an error occurs 479 Global function CPXrefineconflict int CPXrefineconflict CPXCENVptr env CPXLPptr lp int confnumrows p int confnumcols p Definition file cplex h The routine CPXrefineconflict identifies a minimal conflict for the infeasibility of the linear constraints and the variable bounds in the current problem Since the conflict returned by this routine is minimal removal of any member constraint or variable bound will remove that particular source of infeasibility There may be other conflicts in the problem so that repair of a conflict does not guarantee feasibility of the remaining problem To find a conflict by considering the quadratic constraints indicator constraints or special ordered sets as well as the linear constraints and variable bounds use CPXrefineconflictext When this routine returns the value in con numrows p specifies the number of constraints participating in the conflict
550. st int rowlist const int collist const double vallist Definition file cplex h The routine CPXcheckchgcoeflist validates the arguments of the corresponding CPXchgcoeflist routine This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To call this routine you must compile and link check c with your program as well as the CPLEX Callable Library The cPXcheckchgcoeflist routine has the same argument list as the CPXchgcoeflist routine The second argument 1p is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the problem For most user applications this distinction is unimportant Example Status CPXcheckchgcoeflist env lp numcoefs rowlist collist vallist Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob numcoefs The number of coefficients to check or equivalently the length of the arrays rowlist collist and vallist rowlist An array of length numcoe s that with co11ist and vallist specifies the coefficients to check collist An array of length numcoe s that with rowlist and vallist specifies the coefficients to check vallist An array of length numcoefs that with rowlist and collist specifies the coefficients to change The entries rowlist collist k
551. sts to be returned Returns The routine returns zero if successful and nonzero if an error occurs 215 Global function CPXdelnames int CPXdelnames CPXCENVptr env CPXLPptr lp Definition file cplex h The routine CPXdelnames removes all names that have been previously assigned to rows and columns The memory that was used by those names is released Names can be assigned to rows and columns in a variety of ways and this routine allows them to be removed For example if the problem is read from a file in LP or MPS format names are also read from the file Names can be assigned by the user by calling one of the routines CPXchgrowname CPXchgcolname Or CPXchgname Example CPXdelnames env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero if successful and nonzero if an error occurs 216 Global function CPXdperwrite int CPXdperwrite CPXCENVptr env CPXLPptr lp const char filename str double epsilon Definition file cplex h When solving degenerate linear programs with the dual simplex method CPLEX may initiate a perturbation of the objective function of the problem in order to improve performance The routine CPXdperwrite Writes a similarly perturbed problem to a binary SAV format file Example Status CPXdperwrite env lp myprob dpe epsilon Paramete
552. t CPXgetnodecnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example nodecount CPXgetnodecnt env 1 Returns If a solution exists CPXgetnodecnt returns the node count If no solution problem or environment exists CPXgetnodecnt returns the value 0 236 Global function CPXgetsolnpoolintquality int CPXgetsolnpoolintquality CPXCENVptr env CPXCLPptr lp int soln int quality p int what Definition file cplex h The routine CPXgetsolnpoolintquality accesses integer valued information about the quality of a solution in the solution pool The quality values are returned the int variable pointed to by the argument quality p Example Status CPXgetsolnpooldblquality env lp soln amp max x CPX MAX X Parameters env A pointer to the CPLEX environment as returned by the CPXopenCPLEX routine Ip A pointer to a CPLEX problem object as returned by CPXcreateprob soln An integer specifying the index of the solution pool member for which the quality measure is to be computed A value of 1 specifies that the incumbent should be used instead of a member of the solution pool quality p A pointer to an int variable in which the requested quality value is to be stored If an error occurs the quality value remains unchanged what A symbolic constant specifying the quality value to be retr
553. t rstat const double cprim const double rprim const double cdual const double rdual Definition file cplex h The routine CPXcopystart provides starting information for use in a subsequent call to a simplex optimization routine CPX1popt with PARAM LPMETHOD Or CPX PARAM QPMETHOD Setto CPX ALG PRIMAL CPX ALG DUAL CPXdualopt CPXprimopt Or CPXhybnetopt Starting information is not applicable to the barrier optimizer or the mixed integer optimizer When basis arguments cstat and rstat is installed for a linear problem and CPX1popt is used with CPX PARAM LPMETHOD setto CPX ALG AUTOMATIC CPLEX will use the primal simplex algorithm if the basis is primal feasible and the dual simplex method otherwise Any of three different kinds of starting points can be provided a starting basis cstat rstat starting primal values cprim and starting dual values cdua1 rdual Only a starting basis is applicable to a CPXhybnetopt call but for Dual Simplex and Primal Simplex any combination of these three types of information can be of use in providing a starting point If no starting point is provided this routine returns an error otherwise any resident starting information in the CPLEX problem object is freed and the new information is copied into it If you provide a starting basis then both cstat and rstat must be specified It is permissible to provide cprim with or without rprim or rdual wit
554. t double low const double up const double obj char anames Definition file cplex h The routine CPXNETcopynet copies a network to a network object overriding any other network saved in the object The network to be copied is specified by providing the the objective sense number of nodes supply values for each node names for each node number of arcs indices of the from nodes or equivalently the tail nodes for each arc indices of the to nodes or equivalently the head nodes for each arc lower and upper bounds on flow through each arc cost for flow through each arc names of each arc The arcs are numbered according to the order given in the fromnode and t onode arrays Some of the parameters are optional and replaced by default values if NULL is passed for them Example status CPXNETcopynet env net CPX MAX nnodes supply NULL narcs fromnode tonode NULL NULL obj NULL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob objsen Optimization sense of the network to be copied It may take values CPX MAX for a maximization problem or CPX MIN for a minimization problem nnodes Number of nodes to be copied to the network object supply Supply values for the nodes If NULL is passed all supply values default to O zero Otherwise the size of t
555. t of relaxing each range lb An array of doubles of length at least equal to the number of columns in the problem NULL may be passed if no lower bound of any variable is allowed to be relaxed When not NULL the array specifies the preference values that determine the cost of relaxing each lower bound ub An array of doubles of length at least equal to the number of columns in the problem NULL may be passed if no upper bound of any variable is allowed to be relaxed When not NULL the array specifies the preference values that determine the cost of relaxing each upper bound Returns 510 The routine returns zero if successful nonzero if an error occurs 511 Global function CPXgetsubstat int CPXgetsubstat CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetsubstat accesses the solution status of the last subproblem optimization in the case of an error termination during mixed integer optimization Example substatus CPXgetsubstat env lp See Also CPXgetsubmethod Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Example substatus CPXgetsubstat env lp Returns The routine returns zero if no solution exists A nonzero return value reports that there was an error termination where a subproblem could not be solved to completion The values returned are documented in the gro
556. t the nonzero coefficients are grouped by row instead of column in the array rmatval The nonzero elements of every row must be stored in sequential locations in this array from position rmatbeg i to rmatbeg i 1 1 or from rmatbeg i tonzcnt 1 if i rcnt 1 Each entry xmat ind i specifies the column index of the corresponding coefficient rmatval i Unlike CPXcopylp all rows must be contiguous and rmatbeg 0 must be 0 An array containing pointers to character strings that represent the names of the user cuts May be NULL in which case the new user cuts are assigned default names if the user cuts already resident in the CPLEX problem object have names otherwise no names are associated with the user cuts If row names are passed to CPXaddusercuts but existing user cuts have no names assigned default names are created for them The routine returns zero if successful and nonzero if an error occurs 413 Global function CPXcopydnorms int CPXcopydnorms CPXCENVptr env CPXLPptr lp const double norm const int head int len Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routin
557. tal iteration count if a solution exists It returns zero if no solution exists or any other type of error occurs 142 Global function CPXcopyctype int CPXcopyctype CPXCENVptr env CPXLPptr lp const char xctype Definition file cplex h The routine CPXcopyct ype can be used to copy variable type information into a given problem Variable types specify whether a variable is continuous integer binary semi continuous or semi integer Adding ct ype information automatically changes the problem type from continuous to mixed integer from CPXPROB LP to CPXPROB MILP from CPXPROB to CPXPROB MIQP and from QCP to CPXPROB MIQCP even if the provided ct ype data specifies that all variables are continuous This routine allows the types of all the variables to be set in one function call When CPXcopyct ype is called any current solution information is freed Note Defining a variable j to be binary by setting the corresponding ctype j B does not change the bounds associated with that variable A later call to CPXmipopt will change the bounds to 0 zero and 1 one and issue a warning Table 1 Possible values for elements of xctype Y TEGER general integer variable ICONT semi continuous variable N semi integer variable When you build or modify your problem with this routine you can verify that the results are as you intended by calling CPXcheckcopyct ype during applicati
558. tat rstat and dnorm as returned by CPXgetbasednorms into a specified problem object Each of the arrays cstat rstat and dnorm must be non NULL Only data returned by CPXgetbasednorms should be copied by CPXcopybasednorms Other details of cstat rstat and dnorm are not documented Note The routine CPXcopybasednorms should be called only if the return values of CPXgetnumrows and CPXgetnumcols have not changed since the companion call to CPXgetbasednorms If either of these values has increased since that companion call a memory violation may occur If one of those values has decreased the call will be safe but its meaning will be undefined See Also CPXgetbasednorms Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX LP problem object as returned by CPXcreateprob cstat An array containing the basis status of the columns in the constraint matrix returned by a call to CPXgetbasednorms The length of the allocated array must be at least the value returned by CPXgetnumcols rstat array containing the basis status of the rows in the constraint matrix returned by a call to CPXgetbasednorms The length of the allocated array must be at least the value returned by CPXgetnumrows dnorm An array containing the dual steepest edge norms returned by a call to CPXgetbasednorms The length of the allocated array must be at least the value returned by CPXgetnumrows Returns
559. ted command cannot be executed because no solution exists for the problem Optimize the problem first 762 Macro CPXERR SOLNPOOL Definition file cplex h CPXERR NO SOLNPOOL 3024 No solution pool exists The requested command cannot be executed because no solution pool exists for the problem Optimize the problem first If you have changed the solution pool capacity parameter from its default value note that it needs to take a positive value for the solution pool to exist 763 Macro CPXERR SOS Definition file cplex h CPXERR NO SOS 3015 No user defined SOSs exist SOS information can be written to a file only if the SOS has already been defined SOS Type 3 information found by the SOSSCAN feature cannot be written to an SOS file 764 Macro CPXERR NO SOS SEPARATOR Definition file cplex h CPXERR NO SOS SEPARATOR 1627 Expected found c The separator must follow the S1 or S2 declaration 765 Macro CPXERR TREE Definition file cplex h CPXERR NO TREE 3412 Current problem has no tree No tree exists until after the mixed integer optimization has begun 766 Macro CPXERR NO VECTOR SOLN Definition file cplex h CPXERR NO VECTOR SOLN 1556 Vector solution does not exist CPLEX could not write VEC file because no vector solution is available 767 Macro CPXERR NODE INDEX RANGE Definition file cplex h CPXERR NODE INDEX RANGE 1230 Node index d out of range The specified nod
560. ter a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to CPX FEASOPT OPT QUAD Or OptQuad on a mixed integer problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is optimal 877 Macro OPTIMAL RELAXED SUM Definition file cplex h CPXMIP OPTIMAL RELAXED SUM 121 MIP only enum OptimalRelaxedSum This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to CPX FEASOPT SUM or Opt Sum on a mixed integer problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is optimal 878 Macro CPXMIP OPTIMAL TOL Definition file cplex h CPXMIP OPTIMAL TOL 102 MIP only enum OptimalTol Optimal solution with the tolerance defined by epgap or epagap has been found 879 Macro CPXMIP POPULATESOL LIM Definition file cplex h CPXMIP POPULATESOL LIM 128 MIP only enum PopulateSolLim This status occurs only after a call to the Callable Library routine CPXpopulate or the Concert Technology method populate problem The limit on mixed integer solutions
561. tes that arcspace was sufficient A negative value indicates that it was insufficient and that the routine could not complete its task In that case CPXERR_NEGATIVE_SURPLUS is returned and the negative value of surplus p indicates the amount of insufficient space in the array arc begin Index of the first node for which arcs are to be obtained end Index of the last node for which arcs are to be obtained Returns 253 The routine returns zero success nonzero if an error occurs 254 Global function CPXgeterrorstring CPXCCHARptr CPXgeterrorstring CPXCENVptr env int errcode char buffer str Definition file cplex h The routine CPXgeterrorstring returns an error message string corresponding to an error code Error codes are returned by CPLEX routines when an error occurs Note This routine allows the CPLEX environment argument to be NULL so that errors caused by the routine CPXopenCPLEX can be translated Example char errstr errstr CPXgeterrorstring env errcode buffer if errstr NULL printf sn buffer else printf CPLEX Error 554 Unknown error code n errcode Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX errcode The error code to be translated buffer str A character string buffer This buffer must be at least 4096 characters to hold the error string Returns This routine returns a pointer to the
562. th atleast end begin 1 If successful dj 0 through dj end begin contain the values of the reduced costs begin An integer specifying the beginning of the range of reduced cost values to be returned end An integer specifying the end of the range of reduced costs values to be returned Returns The routine returns zero if successful and nonzero if an error occurs 147 Global function CPXNETfreeprob int CPXNETfreeprob CPXENVptr env CPXNETptr net p Definition file cplex h The routine CPXNETfreeprob deletes the network problem object pointed to by net p This also deletes all network problem data and solution data stored in the network problem object Example CPXNETfreeprob env amp net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net p CPLEX network problem object to be deleted Returns The routine returns zero on success and nonzero if an error occurs 148 Global function CPXgetparamname int CPXgetparamname CPXCENVptr env int whichparam char name str Definition file cplex h The routine CPXgetparamname returns the name of a CPLEX parameter given the symbolic constant or reference number for it The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example Status CPXgetparamname env CPX PARAM ADVIND param string Parameters env A pointer to the CPLEX env
563. that the relevant algorithm was not able to conclude that it was feasible when it terminated Returns The routine returns zero on success and nonzero if an error occurs 104 Global function CPXgetsolnpooldivfilter int CPXgetsolnpooldivfilter CPXCENVptr env CPXCLPptr lp double lowercutoff p double upper cutoff p int nzcnt p int ind double val double refval int space int surplus p int which Definition file cplex h Accesses a diversity filter of the solution pool This routine accesses a diversity filter specified by the argument which of the solution pool associated with the problem specified by the argument 1p Details about that filter are returned in the arguments of this routine Example status CPXgetsolnpooldivfilter env lp amp limlo amp limup amp num ind val refval cols amp surplus i Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob lowercutoff Lower bound on the diversity measure of a diversity filter upper cutoff p Upper bound on the diversity measure of a diversity filter nzcnt p Number of variables in the diversity measure ind An array of indices of variables in the diversity measure May be NULL if space is O val An array of weights used in the diversity measure May be NULL if space is 0 refval List of reference values with which to compare the solution
564. the arrays May be NULL if space is O zero which An integer specifying which indicator constraint to return Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS reports that insufficient space was available in either of the arrays 1inind and linval to hold the nonzero coefficients 243 Global function int CPXgetphaselcnt CPXCENVptr env CPXCLPptr 1 Definition file cplex h The routine CPXgetphaselcnt accesses the number of Phase iterations to solve a problem using the primal or dual simplex method Example itcnt CPXgetphaselcnt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns If a solution exists CPXgetphase1cnt returns the Phase iteration count If no solution exists CPXgetphase1cnt returns the value 0 244 Global function CPXchgrngval int CPXchgrngval CPXCENVptr env CPXLPptr lp int cnt const int indices const double values Definition file cplex h The routine CPXchgrngval changes the range coefficients of a set of linear constraints in the CPLEX problem object Example Status CPXchgrngval env lp cnt indices values Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as
565. the current solution is not feasible the value returned depends on the setting of the parameter CPX_PARAM_NETDISPLAY If this parameter is set to PENALIZED OBJECTIVE 2 an objective function value is reported that includes penalty contributions for arcs on which the flow at termination violated the flow bounds on that arc Example status CPXNETgetobjval env net amp objval Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to CPLEX network problem object as returned by CPXNETcreateprob objval p Pointer to where the objective value is written If NULL is passed no objective value is returned Returns The routine returns zero on success and nonzero if an error occurs 498 Global function CPXstrongbranch int CPXstrongbranch CPXCENVptr env CPXLPptr lp const int indices int cnt double downobj double upobj int itlim Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXst rongbranch computes information for selecting a branching variable in
566. the elements of qmat val May be NULL if space IS Zero qmatval An array to contain the nonzero coefficients of the specified columns May be NULL if amat space is zero qmatspace An integer indicating the length of the arrays qmat ind and qmatval May be zero surplus p A pointer to an integer to contain the difference between qmat space and the number of entries in each of the arrays qmat ind and qmat val A nonnegative value of surplus p indicates that the length of the arrays was sufficient A negative value indicates that the length was insufficient and that the routine could not complete its task In this case CPXget quad returns the value CPXERR NEGATIVE SURPLUS and the negative value of surplus p indicates the amount of insufficient space in the arrays begin An integer indicating the beginning of the range of columns to be returned end An integer indicating the end of the range of columns to be returned Returns The routine returns zero if successful and nonzero if an error occurs The value CPXERR NEGATIVE SURPLUS indicates that insufficient space was available in the arrays qmat ind and qmat val to hold the nonzero coefficients 497 Global function CPXNETgetobjval int CPXNETgetobjval CPXCENVptr env CPXCNETptr net double objval p Definition file cplex h The routine CPXNETgetob jval returns the objective value of the solution stored a network problem object If
567. this pointer may be used only in CPLEX Callable Library query routines such as CPXsolution or CPXgetrows Note that the setting of the parameter PARAM MIPCBREDLP does not affect this 1p pointer Since CPLEX does not explicitly maintain an unpresolved node LP the 1p pointer will correspond to the presolved node LP unless CPLEX presolve has been turned off or CPLEX has made no presolve reductions at all Example status CPXgetcallbacknodelp env cbdata wherefrom amp nodelp See also the example admipexi c and in the standard distribution CPXgetcallbacknodelp may be called only when its wherefrom argument has one of the following values CALLBACK CALLBACK BRANCH CALLBACK CUT CALLBACK HEURISTIC CALLBACK INCUMBENT or CALLBACK SOLVE When the wherefrom argument has the value CALLBACK SOLVE the subproblem pointer may also be used in CPLEX optimization routines Note Any modification to the subproblem may result in corruption of the problem and of the CPLEX environment Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The cbdata pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting where the user written
568. tic coefficients If an error occurs 0 is returned 186 Global function CPXaddchannel CPXCHANNELptr CPXaddchannel CPXENVptr env Definition file cplex h The routine CPXaddchannel instantiates a new channel object Example mychannel CPXaddchannel env See also 1pex5 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Returns If successful CPXaddchannel returns a pointer to the new channel object otherwise it returns NULL 187 Global function CPXNETgetarcindex int CPXNETgetarcindex CPXCENVptr env CPXCNETptr net const char lname str int index p Definition file cplex h The routine CPXNETgetarcindex returns the index of the specified arc in the network stored in a network problem object in the integer pointed to by index p Example Status CPXNETgetarcindex env net from a to b amp index Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Iname str Name of the arc to look for index p A pointer to an integer to hold the arc index If the routine is successful index p contains the index number otherwise index p is undefined Returns The routine returns zero on success and nonzero if an error occurs 188 Global function CPXgetnumcols int CPXgetnumcols CPXCENVptr env CPXCLPptr lp
569. tines such as CPXchgcoeflist CPXchgbds CPXchgobj and CPXchgrhs This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To call this routine you must compile and link check c With your program as well as the CPLEX Callable Library Example Consider the following call to CPXchgobj status CPXchgobj env lp cnt indices values The arguments to this routine can be checked with a call to CPXcheckvals like this Status CPXcheckvals env lp cnt NULL indices values Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt The length of the indices and values arrays to be examined rowind An array containing row indices May be NULL colind An array containing column indices May be NULL values An array of values May be NULL Returns The routine returns zero if successful and nonzero if an error occurs 481 Global function CPXgetindconstrslack int CPXgetindconstrslack CPXCENVptr env CPXCLPptr lp double indslack int begin int end Definition file cplex h The routine CPXgetindconstrslack accesses the slack values for a range of indicator constraints The beginning and end of the range must be specified Note that an indicator constraint is considered inactive and thus returns an infinite slack value when the corresponding indicator binar
570. tion Concert Technology does not distinguish indicator constraints from linear constraints in this respect 552 Macro INT INFEAS Definition file cplex h CPX MAX INT INFEAS Concert Technology enum Numeric meaning double To access the maximum of integer infeasibility for the unscaled problem Integer meaning To access the lowest index where the maximum integer infeasibility occurs for the unscaled problem Can use a supplied primal solution 553 Definition file cplex h CPX MAX PI Concert Technology enum MaxPi Numeric meaning double To access the maximum absolute value in the dual solution vector for the unscaled problem Integer meaning To access the lowest index where the maximum pi value occurs for the unscaled problem 554 Macro PRIMAL INFEAS Definition file cplex h CPX MAX PRIMAL INFEAS Concert Technology enum MaxPrimallnfeas Numeric meaning double To access the maximum primal infeasibility or equivalently the maximum bound violation including slacks for the unscaled problem Integer meaning To access the lowest index of a column or row where the maximum primal infeasibility occurs for the unscaled problem An index such as quality p strictly less than zero specifies that the maximum occurs at the slack variable for row i 1 Can use a supplied primal solution 555 Macro PRIMAL RES
571. tion rmatbeg i to rmatbeg it 1 1 or from rmatbeg i tonzcnt 1 if i rcnt 1 Each entry rmatind i specifies the column index of the corresponding coefficient rmatval i Unlike CPXcopylp all rows must be contiguous and rmatbeg 0 must be 0 zero rowname An array containing pointers to character strings that represent the names of the lazy constraints May be NULL in which case the new lazy constraints are assigned default names if the lazy constraints already resident in the CPLEX problem object have names otherwise no names are associated with the lazy constraints If row names are passed to CPXaddlazyconstraints but existing lazy constraints have no names assigned default names are created for them Returns The routine returns zero if successful and nonzero if an error occurs 452 Global function CPXcheckcopylpwnames int CPXcheckcopylpwnames CPXC int objsen const double ob matbeg const int matont b const double ub cons Definition file cplex h The routine CPXcheckcopylpwnames const int matind ENVptr env CPXCLPptr lp int numcols int numrows j const double rhs const char sense const int const double matval const double char colname char rowname t double rngval validates the arguments of the corresponding CPXcopylpwnames routine This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To
572. to a string longer than this results in an error Returns The routine returns zero if successful and nonzero if an error occurs 344 Global function CPXsetintparam int CPXsetintparam CPXENVptr env int whichparam int newvalue Definition file cplex h The routine CPXsetintparam sets the value of a CPLEX parameter of type int The CPLEX Parameters Reference Manual provides a list of parameters with their types options and default values Example status CPXsetintparam env CPX PARAM SCRIND CPX ON See also 1pex1 c in the CPLEX User s Manual Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX whichparam The symbolic constant or reference number of the parameter to change newvalue The new value of the parameter Returns The routine returns zero if successful and nonzero if an error occurs 345 Global function CPXchgctype int CPXchgctype CPXCENVptr env CPXLPptr lp int cnt const int indices const char xctype Definition file cplex h The routine CPXchgctype changes the types of a set of variables of a CPLEX problem object Several types can be changed at once with each type specified by the index of the variable with which it is associated Note If a variable is to be changed to binary call to CPXchgbds should also be made to change the bounds to 0 and 1 Table 1 Values of elements of ctype CPX CONTI C make column indices j continuous C
573. to solve the i th MIP start Can be NULL in which case CPLEX assigns an effort level of AUTO to each start mipstartname An array of length mcnt which specifies the names of the MIP starts Can be NULL Returns The routine returns zero if successful and nonzero if an error occurs 341 Global function CPXsetcutcallbackfunc int CPXsetcutcallbackfunc CPXENVptr env int CPXPUBLIC cutcallback CALLBACK CUT ARGS void cbhandle Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXsetcutcallbackfunc sets and modifies the user written callback for adding cuts The user written callback is called by CPLEX during MIP branch and cut for every node that has an LP optimal solution with objective value below the cutoff and is integer infeasible CPLEX also calls the callback when comparing an integer feasible solution including one provided by a MIP start before any nodes exist against lazy constraints The callback routine adds globally valid cuts to the LP subproblem The cut may be for the original problem if the parameter
574. toresz is 0 zero then the negative of the value of surplus p returned specifies the total number of characters needed for the array name Example status CPXgetmipstartname env lp name store storesz amp surplus 0 cur nummipstarts 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob name An array of pointers to the MIP start names stored in the array name This array must be of length at least end begin 1 The pointer to the name of start i is returned in name i begin store An array of characters where the specified MIP start names are to be returned May be NULL if storesz 0 zero storesz integer specifying the length of the array store May be 0 zero surplus p A pointer to an integer to contain the difference between storesz and the total amount of memory required to store the requested names A nonnegative value of surplus p specifies that storesz was sufficient A negative value specifies that it was insufficient and that the routine could not complete its task In that case CPXgetmipstartname returns the value CPXERR NEGATIVE SURPLUS and the negative value of the variable surplus p specifies the amount of insufficient space in the array store begin An integer specifying the beginning of the range of MIP start names to be returned end An integer specifying the end of t
575. tr Returns The routine returns a pointer to the string being copied to 490 Global function CPXgetindconstrindex int CPXgetindconstrindex CPXCENVptr env CPXCLPptr lp const char lname str int index p Definition file cplex h The routine CPXget indconst rindex searches for the index number of the specified indicator constraint in a CPLEX problem object Example Status CPXgetindconstrindex env lp resource89 amp indconstrindex Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Iname str Name of an indicator constraint to search for index p A pointer to an integer to hold the index number of the indicator constraint with the name lname str lfthe routine is successful p contains the index number otherwise index is undefined Returns The routine returns zero if successful and nonzero if an error occurs 491 Global function CPXaddqconstr int CPXaddqconstr CPXCENVptr env CPXLPptr lp int linnzcnt int quadnzcnt double rhs int sense const int linind const double linval const int quadrow const int quadcol const double quadval const char lname str Definition file cplex h The routine CPXaddqconstr adds a quadratic constraint to a specified CPLEX problem object This routine may be called any time after a call to CPXcreateprob Codes for sense of constra
576. traints CPXbranchcallbackbranchgeneral Returns This routine does not return a result 409 Global function CPXgetcallbackglobalub int CPXgetcallbackglobalub CPXCENVptr env void cbdata int wherefrom double ub int begin int end Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackglobalub retrieves the best known global upper bound values during MIP optimization from within a user written callback The global upper bounds are tightened after a new incumbent is found so the values returned by CPXgetcallbacknodex may violate these bounds at nodes where new incumbents have been found The values are from the original problem if CPX MIPCBREDLIP is set to OFF otherwise they are from the presolved problem This routine may be called only when the value of the wherefrom argument is one of the following CPX CALLBACK MIP CPX CALLBACK MIP BRANCH CPX CALLBACK MIP INCUMBENT CALLBACK NODE CPX CALLBACK MIP HEURISTIC CALLBACK SOLVE CALLBACK CUT
577. traints When the node status is unbounded then the function CPXgetcallbacknodex returns a ray that can be used to decide which lazy constraints need to be added to the subproblem This routine may be called only when the value of the wherefrom argument is CALLBACK CUT Example Status CPXgetcallbacknodestat env cbdata wherefrom amp nodestatus Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX cbdata The pointer passed to the user written callback This argument must be the value of cbdata passed to the user written callback wherefrom An integer value reporting from where the user written callback was called The argument must be the value of wherefrom passed to the user written callback nodestat p A pointer to an integer where the node subproblem optimization status is to be returned The values of nodestat p may be CPX STAT OPTIMAL Or CPX STAT UNBOUNDED Returns The routine returns zero if successful and nonzero if an error occurs 467 Global function CPXNETdelset int CPXNETdelset CPXCENVptr env CPXNETptr net int whichnodes int whicharcs Definition file cplex h The routine CPXNETdelset is used to delete a set of nodes and arcs from the network stored in a network problem object The remaining nodes and arcs are renumbered starting at zero their order is preserved Any solution information stored in the problem object is lost Example status
578. trs env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob x The solution whose infeasibility is to be computed May be NULL in which case the resident solution is used infeasout An array to receive the infeasibility value for each of the indicator constraints This array must be of length at least end begin 1 begin An integer specifying the beginning of the range of indicator constraints whose infeasibility is to be returned Returns The routine returns zero if successful and nonzero if an error occurs 266 Global function CPXgetcrossdexchcnt int CPXgetcrossdexchent CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetcrossdexchocnt accesses the number of dual exchange iterations in the crossover method An exchange occurs when a nonbasic variable is forced to enter the basis as it is pushed toward a bound Example itcnt CPXgetcrossdexchcnt env 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns the dual exchange iteration count if a solution exists If no solution exists it returns zero 267 Global function CPXaddsos int CPXaddsos CPXCENVptr env CPXLPptr lp int numsos int numsosnz const char sostype const int sosbeg const i
579. tte 169 Global function 170 Global function CPXsetinfocallbackfunc eeeeeeeeee esee eene eene nennen nnne nnnm n nn nn nsn annnm n stra nnnm anten nennt 171 Global function 173 Global function 174 Global function 175 Global function 176 Global function 177 Global function CPXcheckaddcols 4 cesses eee esee eene nennen nennen dansis dnas nnnm ss nnn senes nnne nnne 178 Global function 179 Global function 5 180 Global function 181 Global function 183 Global function 184 Global function CPXreadcopymipstarts eese sees esee 185 Global function 186 Table of Contents Global function CPXaddchanneL eese esee 187 Global function
580. turns The routine returns zero if successful and nonzero if an error occurs 383 Global function CPXbtran int CPXbtran CPXCENVptr env CPXCLPptr lp double y Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbt ran solves and puts the answer in is the basis matrix Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to the CPLEX LP problem object as returned by CPXcreateprob y Anarray that holds the righthand side vector on input and the solution vector on output The array must be of length at least equal to the number of rows in the LP problem object Returns The routine returns zero if successful and nonzero if an error occurs 384 Global function CPXgetcallbackinfo int CPXgetcallbackinfo CPXCENVptr env void cbdata int wherefrom int whichinfo void result p Definition file cplex h The routine CPXgetcallbackinfo accesses information about the current optimization process from within user written callback function Note This routine is the o
581. tus CPXgetlogfile env amp logfile Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX logfile p The address of a CPXFILEptr variable This routine sets 1ogfile p to be the file pointer for the current log file Returns The routine returns zero if successful and nonzero if an error occurs 462 Global function CPXgetcallbackindicatorinfo int CPXgetcallbackindicatorinfo CPXCENVptr env void cbdata int wherefrom int iindex int whichinfo void result p Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXgetcallbackindicatorinfo accesses information about the indicator constraints of the presolved problem during MIP callbacks When indicator constraints are present CPLEX creates a presolved problem with indicator constraints in canonical form regardless of the presolve settings Canonical Form implying variable 0 1 IMPLIES implied variable R rhs In that canonical form rhs stands for righthand side stands for one of these relations less than or equal to greater than or
582. ubupper When the routine returns the element lblower j begin lbupper j begin will contain the lowest and highest value the lower bound of variable 5 can assume without affecting the optimality of the solution Likewise ublower j begin and ubupper j begin will contain the lowest and highest value the upper bound of variable 5 can assume without affecting the optimality of the solution Note If you want sensitivity ranges only for lower bound then both 151ower and lbupper should be non NULL and ublower and ubupper can be NULL Example status CPXboundsa env lp 0 CPXgetnumcols env lp 1 lblower lbupper ublower ubupper Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob begin integer specifying the beginning of the range of ranges to be returned end An integer specifying the end of the range of ranges to be returned An array where the lower bound lower range values are to be returned The length of this array must be atleast end begin 1 be NULL An array where the lower bound upper range values are to be returned The length of this array must be atleast end begin 1 May be NULL ublower An array where the upper bound lower range values are to be returned The length of this array must be atleast end begin 1 be NULL ubupper An array where th
583. uccessful and nonzero if an error occurs 516 Global function CPXchgprobname int CPXchgprobname CPXCENVptr env CPXLPptr lp const char probname str Definition file cplex h The routine CPXchgprobname changes the name of the current problem Example Status CPXchgprobname env lp probname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob probname str The new name of the problem Returns The routine returns zero if successful and nonzero if an error occurs 517 Global function CPXgetctype int CPXgetctype CPXCENVptr env CPXCLPptr lp char xctype int begin int end Definition file cplex h The routine CPXgetctype accesses the types for a range of variables in a problem object The beginning and end of the range must be specified Example Status CPXgetctype env lp ctype 0 cur numcols 1 See Also CPXcopyctype Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob xctype An array where the specified types are to be returned This array must be of length end begin 1 The type of variable 3 is returned in j begin See the routine CPXcopyct ype for a list of possible values for the variables in ctype begin An integer specifying the beginning of the range of types to be returned e
584. uccessfully solved by the Callable Library optimizer CPXdualopt with the dual pricing option PARAM DPRIIND set to CPX DPRIIND STEEP CPX DPRIIND FULLSTEEP or CPX DPRIIND STEEPOSTART then a call to CPXgetbasednorms should succeed That optimizer and those pricing options are documented in the Callable Library Reference Manual and their use is illustrated in the CPLEX User s Manual Motivation When the Callable Library optimizer CPXdualopt is called to solve a problem with the dual pricing option CPX PARAM DPRIIND Set to CPX DPRIIND STEEP or CPX DPRIIND FULLSTEEP there must be values of appropriate dual norms available before the optimizer can begin If these norms are not already resident they must be computed and that computation may be expensive The functions CPXgetbasednorms and CPXcopybasednorms can in some cases avoid that expense Suppose for example that in some application an LP is solved by CPXdualopt with one of those pricing settings After the solution of the LP some intermediate optimizations are carried out on the same LP and those subsequent optimizations are in turn followed by some changes to the LP and a re solve In such a case copying the basis and norms that were resident before the intermediate solves back into CPLEX data structures can greatly increase the speed of the re solve See Also CPXcopybasednorms Parameters env The pointer to the CPLE
585. ues to be returned Returns The routine returns zero if successful and nonzero if an error occurs 129 Global function CPXcloneprob CPXLPptr CPXcloneprob CPXCENVptr env CPXCLPptr lp int status p Definition file cplex h The routine CPXcloneprob can be used to create a new CPLEX problem object and copy all the problem data from an existing problem object to it Solution and starting information is not copied Example copy CPXcloneprob env lp amp status Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object of which a copy is to be created status p A pointer to an integer used to return any error code produced by this routine Returns If successful CPXcloneprob returns a pointer that can be passed to other CPLEX routines to identify the problem object that has been created and the argument status p is zero If not successful a NULL pointer is returned and an error status is returned in the argument status_p 130 Global function CPXgetxqxax int CPXgetxqxax CPXCENVptr env CPXCLPptr lp double xqxax int begin int end Definition file cplex h The routine CPXgetxqxax is used to access quadratic constraint activity levels for a range of quadratic constraints in a quadratically constrained program QCP The beginning and end of the range must be specified Quadratic constraint activity is the sum of the linear and quadratic t
586. ulated This status occurs only after a call to the Callable Library routine CPXpopulate or the Concert Technology method populate problem Populate has completed the enumeration of all solutions it could enumerate 874 Macro CPXMIP OPTIMAL POPULATED TOL Definition file cplex h CPXMIP OPTIMAL POPULATED TOL 130 MIP only enum OptimalPopulatedTol This status occurs only after a call to the Callable Library routine CPXpopulate or the Concert Technology method populate problem Populate has completed the enumeration of all solutions it could enumerate whose objective value fit the tolerance specified by the parameters CPX SOLNPOOLAGAP and CPX PARAM SOLNPOOLGAP 875 Macro OPTIMAL RELAXED Definition file cplex h CPXMIP OPTIMAL RELAXED INF 123 MIP only enum OptimalRelaxedInf This status occurs only after call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to FEASOPT INF or Opt Inf on a mixed integer problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is optimal 876 Macro CPXMIP OPTIMAL RELAXED QUAD Definition file cplex h CPXMIP OPTIMAL RELAXED QUAD 125 MIP only enum OptimalRelaxedQuad This status occurs only af
587. ulty Dual Steepest Edge Norms If one of the dual steepest edge algorithms is in use when this routine is called the corresponding norms are automatically updated as part of the pivot Primal steepest edge norms are not automatically updated in this way because in general the deletion of rows invalidates those norms Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to CPLEX LP problem object as returned by CPXcreateprob rlist An array of length rlen containing distinct row indices of slack variables that are not basic in the current solution If x11st contains negative entries or entries exceeding the number of rows CPXpivotin returns an error code Entries of nonslack rows are ignored An integer that specifies the number of entries in the array rlist If rlen is negative or greater than the number of rows CPXpivotin returns an error code Returns The routine returns zero if successful and nonzero if an error occurs 274 Global function CPXtuneparam int CPXtuneparam CPXENVptr env CPXLPptr lp int intcnt const int intnum const int intval int dblcnt const int dblnum const double dblval int stront const int strnum char strval int tunestat p Definition file cplex h The routine CPXtuneparam tunes the parameters of the environment for improved optimizer performance on the specified problem object Tuning is carried out by making a nu
588. ummarized in the trable 406 Global function CPXgetbase int CPXgetbase CPXCENVptr env CPXCLPptr lp int cstat int rstat Definition file cplex h The routine CPXgetbase accesses the basis resident in a CPLEX problem object Either of the arguments cstat Or rstat may be NULL if only one set of status values is needed Table 1 Values of elements of cstat E SUPER CPX FRE variable free and nonbasic Table 2 Values of elements of rstat in rows other than ranged rows CPX AT LOWER 0 associated slack surplus or artificial variable is nonbasic at value 0 0 zero CPX BASIC associated slack surplus or artificial variable is basic Table 3 Values of elements of rstat for ranged rows CPX AT LOWER associated slack surplus or artificial variable is nonbasic at its lower bound CPX BASIC associated slack surplus or artificial variable is basic CPX AT UPPER associated slack surplus or artificial variable is nonbasic at upper bound Example Status CPXgetbase env lp cstat rstat See also the example 1pex2 c in the examples distributed with the product Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned CPXcreateprob cstat An array to receive the basis status of the columns in the CPLEX problem object The length of the array must be no less than t
589. unds on the flow for a set of arcs in the network stored in a network problem object The flow value of an arc can be fixed to a value by setting both bounds to that value Any solution information stored in the problem object is lost Example status CPXNETchgbds env net cnt index lu Indicators to change lower upper bounds of flows through arcs Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob cnt Number of bounds to change indices An array of arc indices that indicate the bounds to be changed This array must have a length of at least cnt All indices must be in the range 0 narcs 1 lu An array indicating which bounds to change This array must have a length of at least cnt The indicators appear in the table bd An array of bound values This array must have a length of at least cnt Values greater than or equal to CPX INFBOUND less than or equal to INFBOUND are considered infinity or infinity respectively Returns The routine returns zero on success and nonzero if an error occurs 435 Global function CPXchgsense int CPXchgsense CPXCENVptr env CPXLPptr lp int cnt const int indices const char sense Definition file cplex h The routine CPXchgsense changes the sense of a set of linear constraints of a CPLEX problem object When changing the sense of a r
590. up optim cplex callable solutionstatus in the reference manual of the API 512 Global function CPXsetlpcallbackfunc int CPXsetlpcallbackfunc CPXENVptr env int CPXPUBLIC callback CPXCENVptr void int void void cbhandle Definition file cplex h The routine CPXset1pcallbackfunc modifies the user written callback routine to be called after each iteration during the optimization of a linear program and also periodically during the CPLEX presolve algorithm Callback description int callback CPXCENVptr env void cbdata int wherefrom void cbhandle This is the user written callback routine Callback return value A nonzero terminates the optimization Callback arguments env A pointer to the CPLEX environment that was passed into the associated optimization routine cbdata A pointer passed from the optimization routine to the user written callback function that identifies the problem being optimized The only purpose for the cbdata pointer is to pass it to the routine CPXgetcallbackinfo wherefrom An integer value specifying from which optimization algorithm the user written callback function was called Possible values and their meaning appear in the table below Value Symbolic Constant Meaning CPX CALLBACK DUAL From dual simplex CPX CALLBACK PRIMAL CROSSOVER CPX CALLBACK BARRIER From barrier CPX CALLBACK PRESOLVE From presolve LBACK Q RIER CPX CALI PBARRII From QP barrier
591. urned by CPXcreateprob filename str The name of the file from which the solution information should be read Returns The routine returns zero if successful and nonzero if an error occurs 321 Global function CPXNETdelnodes int CPXNETdelnodes CPXCENVptr env CPXNETptr net int begin int end Definition file cplex h The routine CPXNETdelnodes is used to remove a range of nodes from the network stored in a network problem object The remaining nodes are renumbered starting at zero their order is preserved All arcs incident to the nodes that are deleted are also deleted from the network Any solution information stored in the problem object is lost Example status CPXNETdelnodes env net 10 20 Parameters env pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob begin Index of the first node to be deleted end Index of the last node to be deleted Returns The routine returns zero on success and nonzero if an error occurs 322 Global function CPXcutcallbackadd int CPXcutcallbackadd CPXCENVptr env void cbdata int wherefrom int nzcnt double rhs int sense const int cutind const double cutval int purgeable Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a highe
592. urns If no solution problem or environment exists CPXgetnodeint returns a value of 1 otherwise CPXgetnodeint returns the node number 456 Global function CPXchgmipstart int CPXchgmipstart CPXCENVptr env CPXLPptr lp int cnt const int indices const double values Definition file cplex h This routine is deprecated See CPXchgmipstarts instead to change values of several starts The routine CPXchgmipstart modifies or extends the incumbent MIP start If the existing incumbent MIP start has no value for the variable x 3 for example and the call to CPXchgmipstart specifies a start value then the specified value is added to the incumbent MIP start If the existing incumbent MIP start already has a value for x 3 then the new value replaces the old If the problem has no MIP start CPXchgmipstart creates one Start values may be specified for both integer and continuous variables See the routine CPXcopymipstart for more information about how CPLEX uses MIP start information Example status CPXchgmipstart env lp cnt indices values See Also CPXcopymipstart CPXchgmipstarts Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob cnt An integer giving the number of entries in the list indices An array of length cnt containing the numeric indices of the columns corresponding to the variables which are assi
593. urs 78 Global function CPXNETgetnumnodes int CPXNETgetnumnodes CPXCENVptr env CPXCNETptr net Definition file cplex h The routine CPXNETgetnumnodes is used to access the number of nodes in a network stored in a network problem object Example cur nnodes CPXNETgetnumnodes env net Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob Returns The routine returns the number of network nodes stored a network problem object If an error occurs 0 is returned and an error message is issued 79 Global function CPXqconstrslackfromx int CPXqconstrslackfromx CPXCENVptr env CPXCLPptr lp const double x double qcslack Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXqconstrslackfromx computes an array of slack values for quadratic constraints from primal solution values Example Status CPXqconstrslackfromx env lp x qcslack Parameters env A pointer to the CPLEX environment as returne
594. utine CPXgetpnorms returns the norms from the primal steepest edge There is no comparable argument in this routine for xnorzm If the rows of the problem have changed since the norms were computed they are generally no longer valid However if columns have been deleted or if columns have been added the norms for all remaining columns present before the deletions or additions remain valid See Also CPXcopypnorms Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob cnorm An array containing the primal steepest edge norms for the normal column variables The array must be of length at least equal to the number of columns in the LP problem object rnorm An array containing the primal steepest edge norms for ranged variables and slacks The array must be of length at least equal to the number of rows in the LP problem object len pointer to the number of entries in the array cnorm When this routine is called p is equal to the number of columns in the LP problem object when optimization occurred The routine CPXcopypnorms needs the value 1en p Returns The routine returns zero if successful and nonzero if an error occurs 533 Global function CPXgetsolnpoolslack int CPXgetsolnpoolslack CPXCENVptr env CPXCLPptr lp int soln double slack int begin int end Definition file cplex h The routine CPX
595. utine CPXsetnodecallbackfunc Example CPXgetnodecallbackfunc env amp current callback amp current handle See also the example admipex1 c in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX nodecallback p The address of the pointer to the current user written node callback If no callback has been set the pointer will evaluate to NULL cbhandle p The address of a variable to hold the user s private pointer Returns This routine does not return a result 446 Global function CPXgetobjval int CPXgetobjval CPXCENVptr env CPXCLPptr lp double objval p Definition file cplex h The routine CPXgetobjval accesses the solution objective value Example status CPXgetobjval env lp amp objval See also the example 1pex2 c in the CPLEX User s Manual and in the standard distribution Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob p A pointer to a variable of type double where the objective value is stored Returns The routine returns zero if successful and nonzero if no solution exists 447 Global function CPXgetpsbocnt int CPXgetpsbent CPXCENVptr env CPXCLPptr lp Definition file cplex h The routine CPXgetpsbcnt accesses the number of primal super basic variables in the current solution Example psbcnt CPXgetpsbcnt
596. utines instead The routine CPXgetcallbacklp retrieves the pointer to the MIP problem that is in use when the user written callback function is called It is the original if CPX PARAM MIPCBREDLP is set to CPX OFF otherwise it is the presolved MIP To obtain information about the node LP associated with this MIP use the following routines e CPXgetcallbacknodeintfeas e CPXgetcallbacknodelb e CPXgetcallbacknodeub e CPXgetcallbacknodex e CPXgetcallbackgloballb e CPXgetcallbackglobalub Each of those routines will return node information associated with the original if CPX MIPCBREDLP is turned off that is set to OFF otherwise they return information associated with the presolved In contrast the function CPXgetcallbacknodelp returns a pointer to the node subproblem which is an LP Note that the setting of MIPCBREDLP does not affect this 1p pointer Since CPLEX does not explicitly maintain an unpresolved node LP the 1p pointer will correspond to the presolved node LP unless CPLEX presolve has been turned off or CPLEX has made no presolve reductions at all Generally this pointer may be used only in CPLEX Callable Library query routines such as CPXsolution or CPXgetrows The routine CPXgetcallbacklp may be called only when the value of the wherefrom argument is one of the following CALLBACK CPX CALLBACK MIP BRANCH CALLBACK INCUM
597. ution as reported in return values Returns 112 The routine returns zero if successful nonzero if an error occurs 113 Global function CPXcutcallbackaddlocal int CPXcutcallbackaddlocal CPXCENVptr env void cbdata int wherefrom int nzont double rhs int sense const int cutind const double cutval Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXcutcallbackaddlocal adds local cuts during MIP branch and cut A local cut is one that applies to the current node and the subtree rooted at this node Global cuts that is cuts that apply throughout the branch and cut tree are added with the routine CPXcut callbackadd This routine may be called only from within user written cut callbacks thus it may be called only when the value of its wherefrom argument is CPX CUT The cut be for the original problem if the parameter PARAM MIPCBREDLP Was set to OFF before the call to CPXmipopt that calls the callback Otherwise the cut is used on the presolved problem Example status CP
598. val The routine returns zero if successful and nonzero if an error occurs 270 Global function CPXbaropt int CPXbaropt CPXCENVptr env CPXLPptr 1 Definition file cplex h The routine CPXbaropt may be used to find a solution to a linear program LP quadratic program QP or quadratically constrained program QCP by means of the barrier algorithm at any time after the problem is created by a call to CPXcreateprob The optimization results are recorded in the CPLEX problem object Example Status CPXbaropt env lp Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX lp A pointer to a CPLEX problem object as returned by CPXcreateprob Returns The routine returns zero unless an error occurred during the optimization Examples of errors include exhausting available memory CPXERR NO MEMORY or encountering invalid data in the CPLEX problem object NO PROBLEM Exceeding a user specified CPLEX limit or proving the model infeasible or unbounded are not considered errors Note that a zero return value does not necessarily mean that a solution exists Use query routines CPXsolninfo CPXgetstat and CPXsolution to obtain further information about the status of the optimization 271 Global function CPXdelsolnpoolfilters int CPXdelsolnpoolfilters CPXCENVptr env CPXLPptr lp int begin int end Definition file cplex h The routine CPXdelsolnpoolfilters deletes
599. val int CPXgetbestobjval CPXCENVptr env CPXCLPptr lp double objval p Definition file cplex h The routine CPXgetbestobjval accesses the currently best known bound of all the remaining open nodes in a branch and cut tree It is computed for a minimization problem as the minimum objective function value of all remaining unexplored nodes Similarly it is computed for a maximization problem as the maximum objective function value of all remaining unexplored nodes For a regular optimization using CPXmipopt this value is also the best known bound on the optimal solution value of the MIP problem In fact when a problem has been solved to optimality this value matches the optimal solution value However for CPXpopulate the value can also exceed the optimal solution value if CPLEX has already solved the model to optimality but continues to search for additional solutions Example Status CPXgetbestobjval env lp amp objval Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob objval p A pointer to the location where the best node objective value is returned Returns The routine returns zero if successful and nonzero if an error occurs 160 Global function CPXgetqconstrinfeas int CPXgetqconstrinfeas CPXCENVptr env CPXCLPptr lp const double x double infeasout int begin int end Definition file cp
600. variables This array may be NULL in which case the new objective coefficients are all set to 0 zero Ib An array of length ccnt containing the lower bound on each of the new variables Any lower bound that is set to a value less than or equal to that of the constant CPX INFBOUND is treated as negative infinity CPX INFBOUND is defined in the header file cplex h This array may be NULL in which case the new lower bounds are all set to 0 zero ub An array of length ccnt containing the upper bound on each of the new variables Any upper bound that is set to a value greater than or equal to that of the constant CPX INFBOUND is treated as infinity CPX INFBOUND is defined in the header file cplex h This array may be NULL in which case the new upper bounds are all set to CPX INFBOUND xctype An array of length ccnt containing the type of each of the new variables Possible values appear in the table This array may be NULL in which case the new variables are created as continuous type If this array is not NULL then CPLEX interprets the problem as a in that case the routine CPX1popt will return the error CPXERR NOT FOR 97 colname An array of length ccnt containing pointers to character strings that specify the names of the new variables added to the problem object May be NULL in which case the new columns are assigned default names if the columns already resident in the problem object have names otherwise no names a
601. ver CPXstrongbranch should be faster because it takes advantage of direct access to internal CPLEX data structures Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob indices An array of integers The length of the array must be at least cnt As in other Callable Library routines row variables in indices are specified by the negative of row index shifted down by one that is rowindex 1 cnt An integer specifying the number of entries in indices downobj An array containing objective values that are the result of the downward fix of branching variables in dual steepest edge iterations carried out by CPXst rongbranch The length of the array must be at least cnt upobj array containing objective values that are the result of the upward fix of branching variables dual steepest edge iterations carried out by CPXst rongbranch The length of the array must be at least cnt itlim An integer specifying the limit on the number of dual steepest edge iterations carried out by CPXstrongbranch on each LP Returns The routine returns zero if successful and nonzero if an error occurs 499 Global function CPXaddindconstr int CPXaddindconstr CPXCENVptr env CPXLPptr lp int indvar int complemented int nzcnt double rhs int sense const int linind const double linval const char indname str Definition file cple
602. when a file is being read such as an ORD file when no names were assigned during the prior call to CPXreadcopyprob 741 Macro CPXERR NORMS Definition file cplex h CPXERR NO NORMS 1264 No norms available Norms are not present Change pricing and call the optimization routine 742 Macro CPXERR NO NUMBER Definition file cplex h CPXERR NO NUMBER 1615 Line 96d Expected number found c Some character other than a number as required appears on the specified line 743 Macro CPXERR NO NUMBER BOUND Definition file cplex h CPXERR NO NUMBER BOUND 1623 Line 96d Missing bound number The bound data is missing from the LP file CPLEX expected a number where no number was found 744 Macro NO NUMBER FIRST Definition file cplex h CPXERR NO NUMBER FIRST 1611 Line d Expected number first Some character other than a number as required appears on the specified line 745 Macro CPXERR OBJ SENSE Definition file cplex h CPXERR NO OBJ SENSE 1436 Max or Min missing The sense of the objective function Max maximization or Min minimization is missing from the LP file No problem has been read as a consequence 746 Macro CPXERR NO OBJECTIVE Definition file cplex h CPXERR NO OBJECTIVE 1476 Line 96d No objective row found No free row was found in the MPS file Check the file At least one free row must be present Free rows have an N sense beginning in column 2 747 M
603. wherefrom An integer value reporting where in the optimization this function was called It will have the value CPX CALLBACK DELETENODE cbhandle A pointer to user private data seqnum The sequence number of the node that is being deleted handle A pointer to the user private data that was assigned to the node when it was created with one of the callback branching routines CPXbranchcallbackbranchbds or eCPXbranchcallbackbranchconstraints or e CPXbranchcallbackbranchgeneral Returns The routine returns zero if successful and nonzero if an error occurs 222 Global function CPXNETwriteprob int CPXNETwriteprob CPXCENVptr env CPXCNETptr net const char filename str const char format str Definition file cplex h The routine CPXNETwriteprob writes the network stored in a network problem object to a file This can be done in CPLEX net or DIMACS min network file format or as the LP representation of the network in any of the LP formats 1p mps or sav If the file name ends with gz a compressed file is written File extensions for network files for CPLEX network format for DIMACS network format m for LP format of LP formulation for MPS format of LP formulation for SAV format of LP formulation Example Status CPXNETwriteprob env net network net NULL Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX
604. with 4 See Also CPXcopydnorms Parameters env The pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to the CPLEX LP problem object as returned by CPXcreateprob norm An array containing the dual steepest edge norms in the ordered specified by head The array must be of length at least equal to the number of rows in the LP problem object head An array containing column or row indices The allocated length of the array must be at least equal to the number of rows in the LP problem object len p A pointer to an integer that specifies the number of entries in both norm and head The value assigned to the pointer 1en p is needed by the routine CPXcopydnorms Returns The routine returns zero if successful and nonzero if an error occurs 324 Global function CPXbinvcol int CPXbinvcol CPXCENVptr env CPXCLPptr lp int j double x Definition file cplex h Note This is an advanced routine Advanced routines typically demand a thorough understanding of the algorithms used by CPLEX Thus they incur a higher risk of incorrect behavior in your application behavior that can be difficult to debug Therefore the team encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead The routine CPXbinvcol computes the j th column of the basis inverse Parameters env The pointer to the CPLEX environment as returned by C
605. write output to a file opened with CPXfopen The purpose of this routine is to allow user defined output in a file to be interspersed with the output created by using the routines CPXaddfpdest or CPXsetlogfile The syntax of CPXfputs is the same as the standard C library function fputs Example CPXfputs Solved first problem n fp Parameters S str A pointer to a string to be output to the file stream A pointer to a file opened by the routine CPXfopen Returns This routine returns a nonnegative value if successful Otherwise it returns the system constant EOF end of file 307 Global function CPXgetlb int CPXgetlb CPXCENVptr env CPXCLPptr lp double lb int begin int end Definition file cplex h The routine CPXget 1b accesses a range of lower bounds on the variables of a CPLEX problem object The beginning and end of the range must be specified Unbounded Variables If a variable lacks a lower bound then CPXget 1b returns a value less than or equal to INFBOUND Example Status CPXgetlb env lp lb 0 cur numcols 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob Ib An array where the specified lower bounds on the variables are to be returned This array must be of length atleast end begin 1 The lower bound of variable j is returned in 161 begin begin An integer specifying the b
606. x index of the arc or node whose name is to be changed name str The new name for the arc or node Returns The routine returns zero on success and nonzero if an error occurs 364 Global function CPXNETaddarcs int CPXNETaddarcs CPXCENVptr env CPXNETptr net int narcs const int fromnode const int tonode const double low const double up const double obj char anames Definition file cplex h The routine CPXNETaddarcs adds new arcs to the network stored in a network problem object Example status CPXNETaddarcs env net narcs fromnode tonode NULL NULL obj NULL See Also CPXNETgetnumnodes Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX net A pointer to a CPLEX network problem object as returned by CPXNETcreateprob narcs Number of arcs to be added fromnode Array of indices of the from node for the arcs to be added All the indices must be greater than or equal to O If a node index is greater than or equal to the number of nodes currently in the network see CPXNETgetnumnodes new nodes are created implicitly with default supply values 0 The size of the fromnode array must be at least narcs tonode Array of indices of the to node for the arcs to be added All the indices must be greater than or equal to 0 If a node index is greater than or equal to the number of nodes currently in the network see CPXNETgetnumnodes new nodes are created implic
607. x h The routine CPXaddindconstr adds an indicator constraint to the specified problem object This routine may be called any time after a call to CPXcreateprob An indicator constraint is a linear constraint that is enforced only when an associated binary variable takes a value of 1 or when an associated binary variable takes the value of 0 zero if the binary variable is complemented The linear constraint may be a less than or equal to constraint a greater than or equal to constraint or an equality constraint Codes for the sense of a linear constraint sense constraint constraint Example status CPXaddindconstr env lp indicator complemented nzcnt rhs sense ind val newindname Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX LP problem object as returned by CPXcreateprob indvar The binary variable that acts as the indicator for this constraint complemented A Boolean value that specifies whether the indicator variable is complemented The linear constraint must be satisfied when the indicator takes a value of 1 one if the indicator is not complemented and similarly the linear constraint must be satisfied when the indicator takes a value of 0 zero if the indicator is complemented nzcnt An integer that specifies the number of nonzero coefficients in the linear portion of the indicator constraint This argument gives the length o
608. xample when a MIP problem is being solved if a callback asks for information that is not available from CPLEX 670 Macro CPXERR CANT CLOSE CHILD Definition file cplex h CPXERR CANT CLOSE CHILD 1021 Cannot close a child environment It is not permitted to call CPXcloseCPLI EX for a child environment 671 Macro CPXERR CHILD OF CHILD Definition file cplex h CPXERR CHILD OF CHILD 1019 Cannot clone a cloned environment CPXparenv cannot be called from a child thread 672 Macro CPXERR COL INDEX RANGE Definition file cplex h CPXERR COL INDEX RANGE 1201 Column index 96d out of range The specified column index is negative or greater than or equal to the number of columns in the currently loaded problem 673 Macro CPXERR COL REPEAT PRINT Definition file cplex h CPXERR COL REPEAT PRINT 1478 Column repeats messages not printed The MPS problem or REV file contains duplicate column entries Inspect and edit the file 674 Macro CPXERR COL REPEATS Definition file cplex h CPXERR COL REPEATS 1446 Column s repeats The MPS file contains duplicate column entries Inspect and edit the file 675 Macro CPXERR COL ROW REPEATS Definition file cplex h CPXERR COL ROW REPEATS 1443 Column 96s has repeated row s The specified column appears more than once in a row Check the MPS file for duplicate entries 676 Macro CPXERR COL UNKNOWN Definition file cplex h CPXERR COL UNKNOWN 1449
609. y enum MaxScaledRedCost Numeric meaning double To access the maximum absolute reduced cost value for the scaled problem Integer meaning To access the lowest index where the maximum reduced cost value occurs for the scaled problem 566 Macro SCALED SLACK Definition file cplex h CPX MAX SCALED SLACK Concert Technology enum MaxScaledSlack Numeric meaning double To access the maximum absolute slack value for the scaled problem Integer meaning To access the lowest index where the maximum slack value occurs for the scaled problem Can use a supplied primal solution 567 Macro CPX MAX SCALED X Definition file cplex h CPX MAX SCALED X Concert Technology enum MaxScaledX Numeric meaning double To access the maximum absolute value in the primal solution vector for the scaled problem Integer meaning To access the lowest index where the maximum x value occurs for the scaled problem Can use a supplied primal solution 568 Macro SLACK Definition file cplex h CPX MAX SLACK Concert Technology enum MaxSlack Numeric meaning doub1e To access the maximum absolute slack value for the unscaled problem Integer meaning To access the lowest index where the maximum slack value occurs for the unscaled problem Can use a supplied primal solution 569 Definition file cplex h CPX MAX X Concert Technology enum MaxX Numeric meaning double To
610. y enum SumScaledPi Concert Technology enum SumScaledSlack Concert Technology enum SumScaledX Concert Technology enum SumSlack CPX SUM X This table lists quality values Concert Technology enum SumX Values that are stored in a numeric variable or double variable are accessed by the Concert Technology method getQuality ofthe class 11oCplex or by the Callable Library routine CPXgetdblquality Values that are stored in an integer variable are accessed by the method getQuality of the class IloCplex or by the routine CPXgetintquality 59 Group optim cplex solutionstatus The Callable Library macros that define solution status their symbolic constants their equivalent in Concert Technology enumerations and their meaning There is a note about unboundedness after the table Macro Summary CPX STAT ABORT DUAL OBJ LIM 22 Barrier only enum AbortDualObjLim 10 Simplex or Barrier enum AbortltLim 12 Simplex or Barrier enum AbortObjLim 21 Barrier only enum AbortPrimObjLim 11 Simplex or Barrier enum AbortTimeLim 13 Simplex or Barrier enum AbortUser CPX STAT CONFLICT ABORT CONTRADICTION 32 conflict refiner enum ConflictAbortContradiction CPX STAT CONFLICT ABORT CPX STAT CONFLICT ABORT MEM LIM CPX STAT CONFLICT NODE CPX STAT CONFLICT OBJ LIM CPX STAT CONFLICT ABORT TIME LIM CPX STAT CONFLICT ABORT USER CPX STAT CONFLICT FEASIBLE CPX STAT
611. y routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to FEASOPT MIN INF or MinInf on a continuous problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is minimal 594 Macro CPX STAT FEASIBLE RELAXED QUAD Definition file cplex h CPX STAT FEASIBLE RELAXED QUAD 18 Simplex or Barrier enum FeasibleRelaxedQuad This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to FEASOPT MIN QUAD MinQuad a continuous problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation was installed The relaxation is minimal 595 Macro CPX STAT FEASIBLE RELAXED SUM Definition file cplex h CPX STAT FEASIBLE RELAXED SUM 14 Simplex or Barrier enum FeasibleRelaxedSum This status occurs only after a call to the Callable Library routine CPXfeasopt or the Concert Technology method easopt with the parameter PARAM FEASOPTMODE or FeasOptMode set to FEASOPT MIN SUM or MinSum on a continuous problem A relaxation was successfully found and a feasible solution for the problem if relaxed according to that relaxation w
612. y takes a value less than the integrality tolerance or greater than 1 minus the integrality tolerance if the indicator binary is complemented Example Status CPXgetindconstrslack env lp indslack 0 CPXgetnumindconstrs env lp 1 Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob indslack An array to receive the slack values for each of the constraints This array must be of length atleast end begin 1 If successful indslack 0 through indslack end begin contain the values of the slacks begin An integer specifying the beginning of the range of slack values to be returned end An integer specifying the end of the range of slack values to be returned Returns The routine returns O zero if successful and nonzero if an error occurs 482 Global function CPXgetsosname int CPXgetsosname CPXCENVptr env CPXCLPptr lp char name char namestore int storespace int surplus p int begin int end Definition file cplex h The routine CPXgetsosname accesses a range of special ordered set SOS names of a CPLEX problem object The beginning and end of the range along with the length of the array in which the SOS names are to be returned must be specified Note If the value of storespace is 0 zero then the negative of the value of surplus p returned specifies the total number of characters needed for t
613. your model and possibly repair it CPXrefineconflict and CPXfeasopt Conflict Refiner Given an infeasible model the conflict refiner can identify conflicting constraints and bounds within the model to help you identify the causes of the infeasibility In this context a conflict is a subset of the constraints and bounds of the model which are mutually contradictory The conflict refiner first examines the full infeasible model to identify portions of the conflict that it can remove By this process of refinement the conflict refiner arrives at a minimal conflict A minimal conflict is usually smaller than the full infeasible model and thus makes infeasibility analysis easier To invoke the conflict refiner call the routine CPXrefineconflict If a model happens to include multiple independent causes of infeasibility then it may be necessary for the user to repair one such cause and then repeat the diagnosis with further conflict analysis A conflict does not provide information about the magnitude of change in data values needed to achieve feasibility The techniques that CPLEX uses to refine a conflict include or remove constraints or bounds in trial conflicts the techniques do not vary the data in constraints nor in bounds To gain insight about changes in bounds on variables and constraints consider the FeasOpt feature Also consider FeasOpt for an approach to automatic repair of infeasibility Refining a conflict in an infeasible model as d
614. zation algorithm not CPXERR ARC INDEX RANGE 1231 Arc index d out of range 1003 Bad argument to Callable Library routine 1622 Line 96d Invalid bound sense 1457 Line 96d Unrecognized bound type s 3012 Line d Unrecognized direction c c 1435 Line Exponent s out of range 1618 Line 96d Exponent 965 965 with number 1617 Line 96d not valid identifier 1439 Line d Illegal indicator constraint 1551 Line d Unrecognized basis marker s 1438 Line d Illegal lazy constraint or user cut 1229 Illegal bound change specified by entry d CPXERR BAD METHOD 1292 Invalid choice of optimization method 1434 Line 96d Couldn t convert s to a number 1487 Line d Unrecognized objective sense s CPXERR BAD PROB TYPE 1022 Unknown problem type Problem not changed CPXERR BAD ROW ID 1532 Incorrect row identifier 1473 Line d Unrecognized section marker Expecting GEXEHROPAD SECTION BOUNDS RANGES BOUNDS QMATRIX or ENDATA EDEN 3 CPXERR SECTION ENDATA Unrecognized section marker Expecting 51 42 is E So section marker Expecting 1201 Column index d out of range CPXERR_COL_REPEAT_PRINT 1478 d Column repeats messages not printed 1446 Column s repeats 1228 Count entry d specifies overlapping entries 1227 Count entry d negative or larger than allowed 5 CPXERR DBL d Numeric entry 96d is larger than allowed maximum of o CPXERR DECOMPRESS
615. zcnt rhs sense rmatbeg rmatind rmatval newcolname newrowname See also the example 1pex3 c in the CPLEX User s Manual and in the stan For more about the conventions for representing a matrix as compact arrays matval in the routine CPXcopylp dard distribution see the discussion of matbeg Parameters env A pointer to the CPLEX environment as returned by CPXopenCPLEX Ip A pointer to a CPLEX problem object as returned by CPXcreateprob ccnt An integer that specifies the number of new columns in the constraints being added to the constraint matrix When new columns are added they are given an objective coefficient of zero a lower bound of zero an upper bound of INFBOUND rcnt An integer that specifies the number of new rows to be added to the constraint matrix nzcnt An integer that specifies the number of nonzero constraint coefficients to be added to the constraint matrix This specifies the length of the arrays xmatind and rmatval rhs An array of length rcnt containing the righthand side term for each constraint to be added to the CPLEX problem object May be NULL in which case the new righthand side values are set to 0 0 sense An array of length rent containing the sense of each constraint to be added to the CPLEX problem object May be NULL in which case the new constraints are created as equality constraints Possible values of this argument appear in the table rmatbeg a
616. zed here Symbolic Constant Algorithm 0 mouesm we ALG DUA Dual simplex ALG BARRIER Barrier optimizer no crossover 379 Global function CPXcheckaddrows int CPXcheckaddrows CPXCENVptr env CPXCLPptr lp int ccnt int rcnt int nzcnt const double rhs const char sense const int rmatbeg const int rmatind const double rmatval char colname char rowname Definition file cplex h The routine CPXcheckaddrows validates the arguments of the corresponding CPXaddrows routine This data checking routine is found in source format in the file check c which is provided with the standard CPLEX distribution To call this routine you must compile and link check c with your program as well as the CPLEX Callable Library The CPXcheckaddrows routine has the same argument list as the CPXaddrows routine The second argument lp is technically a pointer to a constant LP object of type CPXCLPptr rather than type CPXLPptr as this routine will not modify the problem For most user applications this distinction is unimportant Example status CPXcheckaddrows env lp ccnt rcnt nzcnt rhs sense rmatbeg rmatind rmatval newcolname newrowname Returns The routine returns nonzero if it detects an error in the data it returns zero if it does not detect any data errors 380 Global function CPXcopylpwnames int CPXcopylpwnames CPXCENVptr env CPXLPptr lp int numcols int numr
Download Pdf Manuals
Related Search
Related Contents
エコバネル 取扱説明書 PDF document - Eetasia.com タケトップ遮熱 - 竹林化学工業 Zotac NM10-DTX WiFi Philips BDL4765EL Analizador Portátil de Combustión Weider XC2 User's Manual Copyright © All rights reserved.
Failed to retrieve file