#20337: MIP: Several fixes regarding constant terms in the objective function
-------------------------------------+-------------------------------------
       Reporter:  mkoeppe            |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.2
      Component:  numerical          |   Resolution:
       Keywords:  lp                 |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  
u/mkoeppe/mip_backends__obj_constant_term_should_be_exposed_by_a_backend_method|
  ad40508934049090580c678ec4249588273b43cf
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by mkoeppe):

 * status:  new => needs_review
 * commit:   => ad40508934049090580c678ec4249588273b43cf


Old description:

> ... rather than being accessed directly in
> `MixedIntegerLinearProgram.show`

New description:

 Contrary to documentation, one cannot set a constantly zero objective
 function by passing 0 to `set_objective`.
 {{{
     sage: p = MixedIntegerLinearProgram(maximization=True)
     sage: x = p.new_variable(nonnegative=True)
     sage: p.set_objective(0)
     AttributeError: 'sage.rings.integer.Integer' object has no attribute
 'dict'
 }}}
 This ticket fixes that and actually allows any field number (which ends up
 in the `obj_constant_term`).

 Moreover, the backend slot `obj_constant_term` is accessed directly by
 `MixedIntegerLinearProgram.show`; it should instead be exposed by a
 backend method, which this ticket adds as well.

 Finally, the `show` method added an extraneous blank line when a nonzero
 `obj_constant_term` was present.  Fixed and doctest added.

--

Comment:

 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=62a4da07df2c7c000b2fb22b96e5c493b5976c20
 62a4da0]||{{{objective_constant_term: New MIP backend method}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=edb9d7f795f8254571a2f060eb1c49d6012bb9f3
 edb9d7f]||{{{MixedIntegerLinearProgram.show: Remove extraneous blank line
 when objective constant term is nonzero; add doctest}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=ad40508934049090580c678ec4249588273b43cf
 ad40508]||{{{MixedIntegerLinearProgram.set_objective: Accept constants as
 objective}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/20337#comment:2>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to