#12823: Allow constants for objective function & deletion of rows in
MixedIntegerLinearProgram
------------------------------------------+---------------------------------
       Reporter:  john_perry              |         Owner:  ncohen          
           Type:  defect                  |        Status:  needs_review    
       Priority:  major                   |     Milestone:  sage-5.0        
      Component:  linear programming      |    Resolution:                  
       Keywords:  solver objective        |   Work issues:  failing doctests
Report Upstream:  N/A                     |     Reviewers:                  
        Authors:  john_perry, ncohen      |     Merged in:                  
   Dependencies:  #12220, #12736, #12833  |      Stopgaps:                  
------------------------------------------+---------------------------------

Comment (by dcoudert):

 Ok, I'm now able to install successfully the patch !

 Tests are OK with GLPK but not with CPLEX.
 {{{
 sage -t -optional "devel/sage-
 myclone/sage/numerical/backends/cplex_backend.pyx"
 IBM ILOG License Manager: "IBM ILOG Optimization Suite for Academic
 Initiative" is accessing CPLEX 12 with option(s): "e m b q ".
 **********************************************************************
 File "/path-to-sage/devel/sage-
 myclone/sage/numerical/backends/cplex_backend.pyx", line 435:
     sage: p.solve()                                    # optional - CPLEX
 Exception raised:
     Traceback (most recent call last):
       File "/path-to-sage/local/bin/ncadoctest.py", line 1231, in
 run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/path-to-sage/local/bin/sagedoctest.py", line 38, in
 run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/path-to-sage/local/bin/ncadoctest.py", line 1172, in
 run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_9[10]>", line 1, in <module>
         p.solve()                                    # optional -
 CPLEX###line 435:
     sage: p.solve()                                    # optional - CPLEX
       File "mip.pyx", line 1431, in
 sage.numerical.mip.MixedIntegerLinearProgram.solve
 (sage/numerical/mip.c:7747)
       File "cplex_backend.pyx", line 854, in
 sage.numerical.backends.cplex_backend.CPLEXBackend.solve
 (sage/numerical/backends/cplex_backend.c:7823)
     MIPSolverException: 'CPLEX: The problem is unbounded'
 **********************************************************************
 File "/path-to-sage/devel/sage-
 myclone/sage/numerical/backends/cplex_backend.pyx", line 437:
     sage: p.get_values([x,y])                          # optional - CPLEX
 Expected:
     [0.0, 3.0]
 Got:
     [2.0, 0.0]
 **********************************************************************
 1 items had failures:
    2 of  13 in __main__.example_9
 ***Test Failed*** 2 failures.
 For whitespace errors, see the file
 /home/dcoudert/.sage//tmp/cplex_backend_17001.py
          [1.2 s]

 ----------------------------------------------------------------------
 The following tests failed:


         sage -t -optional "devel/sage-
 myclone/sage/numerical/backends/cplex_backend.pyx"
 Total time for all tests: 1.2 seconds
 }}}


 I have observed that ``p.remove_constraint(0)`` removes all constraints
 for the test example, hence the unbounded problem error.
 {{{
 sage: p = MixedIntegerLinearProgram(solver='CPLEX')
 IBM ILOG License Manager: "IBM ILOG Optimization Suite for Academic
 Initiative" is accessing CPLEX 12 with option(s): "e m b q ".
 sage: x, y = p[0], p[1]
 sage: p.add_constraint(2*x + 3*y, max = 6)
 sage: p.add_constraint(3*x + 2*y, max = 6)
 sage: p.set_objective(x + y + 7)
 sage: p.set_integer(x); p.set_integer(y)
 sage: p.show()
 Maximization:
   x_0 + x_1 + 7.0

 Constraints:
   2.0 x_0 + 3.0 x_1 <= 6.0
   3.0 x_0 + 2.0 x_1 <= 6.0
 Variables:
   x_0 is an integer variable (min=0.0, max=+oo)
   x_1 is an integer variable (min=0.0, max=+oo)
 sage: p.solve()
 9.0
 sage: p.get_values([x,y])
 [2.0, 0.0]
 sage: p.remove_constraint(0)
 sage: p.show()
 Maximization:
   x_0 + x_1 + 7.0

 Constraints:
 Variables:
   x_0 is an integer variable (min=0.0, max=+oo)
   x_1 is an integer variable (min=0.0, max=+oo)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12823#comment:43>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to