#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:              
Report Upstream:  N/A                 |     Reviewers:              
        Authors:  john_perry, ncohen  |     Merged in:              
   Dependencies:  12833               |      Stopgaps:              
--------------------------------------+-------------------------------------

Comment (by john_perry):

 Why do you enumerate the constraints in coin_backend, maybe others? Why
 not simply loop i from 0 to len(constraints)?

 More: I don't understand this:
 {{{
 for i,c in enumerate(constraints):
   if i < 0 or i >= nrows:
     sage_free(rows)
     raise ValueError("The constraint's index i must satisfy 0 <= i <
 number_of_constraints")

   rows[i] = constraints[i]
 }}}
 Seems to me the test should be
 {{{
   if c < 0 or c >= nrows:
 }}}
 shouldn't it? and then you could have
 {{{
   rows[i] = c     # same as constraints[i]
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12823#comment:11>
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