Re: [sage-support] Re: domains for variables

2010-08-03 Thread Johannes
thnx i got it working. Am 30.07.2010 12:00, schrieb Harald Schilly: > On 30 Jul., 00:01, Johannes wrote: > >> Hi list, >> i try to solve a linear equation in ZZ in the variables w_i: >> > Here is a MILP formulation of your problem, I've pasted the input cell > in {{{}}} and the output in

[sage-support] Re: domains for variables

2010-07-30 Thread Nathann Cohen
Hello !! You may also like this : http://www-sop.inria.fr/members/Nathann.Cohen/tut/LP/ Writing documentation for both graphhs and LP has been responsble for many of my last sleepless nights, though this documentation is in french. The next ones will be for the english version :-) Nathann --

[sage-support] Re: domains for variables

2010-07-30 Thread Harald Schilly
On 30 Jul., 18:14, kcrisman wrote: > Harald, this is very informative for me.  Maybe something stepwise > like this should be at the top of... #9647 H -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@g

[sage-support] Re: domains for variables

2010-07-30 Thread kcrisman
Harald, this is very informative for me. Maybe something stepwise like this should be at the top of http://www.sagemath.org/doc/reference/sage/numerical/mip.html so that it's very visible as an example of doing everything, or at least as an additional example in sage.numerical.mip.MixedIntegerLin

[sage-support] Re: domains for variables

2010-07-30 Thread Harald Schilly
On 30 Jul., 00:01, Johannes wrote: > Hi list, > i try to solve a linear equation in ZZ in the variables w_i: Here is a MILP formulation of your problem, I've pasted the input cell in {{{}}} and the output in between {{{ p = MixedIntegerLinearProgram(maximization=False) # not reals, we want integ

Re: [sage-support] Re: domains for variables

2010-07-29 Thread Johannes
maybe it helps if i give my full pice of code: def calc_wights_by_sum_to_zero(s): #create the equations variables = [var("w" + str(i),domain=ZZ)for i in range(s.nvertices())] equation = reduce(lambda f1,f2: f1 + f2, [variables[i] * s.vertex(i) for i in range(s.nvertices())]) #calcu

[sage-support] Re: domains for variables

2010-07-29 Thread kcrisman
On Jul 29, 6:01 pm, Johannes wrote: > Hi list, > i try to solve a linear equation in ZZ in the variables w_i: > > sage: variables = [var("w" + str(i),domain=ZZ)for i in range(s.nvertices())] > sage: eq > (w0 + w1 + w2 - 14*w3, w1 + 2*w2 - 8*w3, 2*w2 - 3*w3) > sage: result > [w0 == 15/2*r548, w1