414 #endif |
414 #endif |
415 } |
415 } |
416 |
416 |
417 LpCplex::SolutionStatus LpCplex::_getPrimalStatus() |
417 LpCplex::SolutionStatus LpCplex::_getPrimalStatus() |
418 { |
418 { |
|
419 //Unboundedness not treated well: the following is from cplex 9.0 doc |
|
420 // About Unboundedness |
|
421 |
|
422 // The treatment of models that are unbounded involves a few |
|
423 // subtleties. Specifically, a declaration of unboundedness means that |
|
424 // ILOG CPLEX has determined that the model has an unbounded |
|
425 // ray. Given any feasible solution x with objective z, a multiple of |
|
426 // the unbounded ray can be added to x to give a feasible solution |
|
427 // with objective z-1 (or z+1 for maximization models). Thus, if a |
|
428 // feasible solution exists, then the optimal objective is |
|
429 // unbounded. Note that ILOG CPLEX has not necessarily concluded that |
|
430 // a feasible solution exists. Users can call the routine CPXsolninfo |
|
431 // to determine whether ILOG CPLEX has also concluded that the model |
|
432 // has a feasible solution. |
|
433 |
419 int stat = CPXgetstat(env, lp); |
434 int stat = CPXgetstat(env, lp); |
420 #if CPX_VERSION >= 900 |
435 #if CPX_VERSION >= 800 |
421 switch (stat) |
436 switch (stat) |
422 { |
437 { |
423 case CPX_STAT_OPTIMAL: |
438 case CPX_STAT_OPTIMAL: |
424 return OPTIMAL; |
439 return OPTIMAL; |
425 case CPX_STAT_UNBOUNDED: |
440 case CPX_STAT_UNBOUNDED: |
483 // CPX_STAT_UNBOUNDED |
498 // CPX_STAT_UNBOUNDED |
484 |
499 |
485 LpCplex::SolutionStatus LpCplex::_getDualStatus() |
500 LpCplex::SolutionStatus LpCplex::_getDualStatus() |
486 { |
501 { |
487 int stat = CPXgetstat(env, lp); |
502 int stat = CPXgetstat(env, lp); |
488 #if CPX_VERSION >= 900 |
503 #if CPX_VERSION >= 800 |
489 switch (stat) |
504 switch (stat) |
490 { |
505 { |
491 case CPX_STAT_OPTIMAL: |
506 case CPX_STAT_OPTIMAL: |
492 return OPTIMAL; |
507 return OPTIMAL; |
493 case CPX_STAT_UNBOUNDED: |
508 case CPX_STAT_UNBOUNDED: |
512 } |
527 } |
513 |
528 |
514 LpCplex::ProblemTypes LpCplex::_getProblemType() |
529 LpCplex::ProblemTypes LpCplex::_getProblemType() |
515 { |
530 { |
516 int stat = CPXgetstat(env, lp); |
531 int stat = CPXgetstat(env, lp); |
517 #if CPX_VERSION >= 900 |
532 #if CPX_VERSION >= 800 |
518 switch (stat) |
533 switch (stat) |
519 { |
534 { |
520 case CPX_STAT_OPTIMAL: |
535 case CPX_STAT_OPTIMAL: |
521 return PRIMAL_DUAL_FEASIBLE; |
536 return PRIMAL_DUAL_FEASIBLE; |
522 case CPX_STAT_UNBOUNDED: |
537 case CPX_STAT_UNBOUNDED: |