I frequently use the IP/LP functionality in Sage for problems in graph theory. I'm now used to the assumption that most solvers make about variables being nonnegative, but I find it nonobvious and it has tripped me up several times in the past. I think that making no assumption about variables but letting nonnegativity be added when the variable is declared would be great.
Might it make sense to add a type of variable (ie, "continuous", "integer", "binary", "nonnegative")? One disadvantage is that nonnegative continuous is different than nonnegative integer. One additional comment: The set_min (and set_max) functionality is still needed, even if there is a way to indicate bounds when declaring variables. One situation is for indexed variables where they had different bounds. Another situation occurs when "fixing" a variable to a value after the program has been created. For instance, an IP might model finding a maximum independent set in a graph, but I might wish to ask about independent sets that contain a specific vertex. This is easy to do from the usual IP by forcing that variable to 1. Best wishes, Stephen On Wed, Dec 11, 2013 at 11:35 AM, Nathann Cohen <nathann.co...@gmail.com>wrote: > > Perhaps keep default >=0 but when new_variable is called issue > DeprecationWarning that the default will change? New parameters should > allow setting both >=0 and free explicitly, so that those who want >=0 in > the future can set it now and those who don't can also set it now, and when > the default will change - no code will be broken, just some of it will > explicitly set a parameter which is there by default anyway, which is not > that big of a deal. > > > > get/set methods on the other hand can just be deprecated directly. > > Hmmm.. Well, indeed new_variable could give a warning whenever the > future "min" argument is left undefined. Makes sense. Though p['x'] > call new_variable implicitly. Hmmmmmm.. Okay okay, this way works. > > Nathann > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.