Yes -- it would be very convenient for the users. For example, applying solve() on a a set of linear equations probably do some preprocessing to turn them into more efficient format and send it to some specialize solver. But all those steps happen behind the scene , the only thing I give solve() is a list of equations !
I just wrote some functions for this at http://pastebin.com/FBUQ0jsr . It's geared toward my project but can easily be modified for more general purpose. Feel free to use them. On Tuesday, March 26, 2013 12:17:41 PM UTC-6, john_perry_usm wrote: > > Dima & Nathann > > What he's facing is an annoyance. Would it be feasible (ha ha) to rewrite > the creation of constraints so that variables are automatically created in > the LP if they're not there? That is, rather than looking for a workaround > for the user, should we see this as an opportunity for enhancement? > > john perry > > On Tuesday, March 26, 2013 12:54:48 AM UTC-5, tvn wrote: >> >> I am trying to play around with MixedIntegerLinearProgram but now sure >> how to add constraints properly to it. My input is a list of relations , >> e.g. csts = [l <= 15, u >= 10, l <= u] and I want to add these to the >> solver. >> >> All the examples I've seen requires constructing these constraints >> explicity (e.g. p = MixedIntegerLinearProgram(), l = p['l'], u = p['u'], >> p.set_objective(l-u), p.add_constraint(l <= 15), p.add_constraint(u>=10)) >> . I could analyze the input list of constraint to determine is >> coeficients and variables etc and then recreate new variables and relations >> but that seem too cumbersome. Is there an easier method to feed a given >> list of relations as above directly to p.add_constraint() ? >> >> >> >> -- You received this message because you are subscribed to the Google Groups "sage-support" 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 http://groups.google.com/group/sage-support?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
