Ticket #9836: trac_9836 - renaming a variable.patch

File trac_9836 - renaming a variable.patch, 1.2 KB (added by ncohen, 9 years ago)
  • doc/en/thematic_tutorials/linear_programming.rst

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1284201949 -7200
    # Node ID aa40b85c88b263d080936bb241448e6bbb29f82d
    # Parent  c7d0d23da6dc1a6aa95b569aacf390769b4e7b10
    trac 9836 -- fixes in the LP thematic tutorial
    
    diff -r c7d0d23da6dc -r aa40b85c88b2 doc/en/thematic_tutorials/linear_programming.rst
    a b  
    238238
    239239::
    240240
    241     sage: poids = {}
     241    sage: weight = {}
    242242    sage: usefulness = {}
    243243
    244244.. link
     
    247247
    248248    sage: set_random_seed(685474)
    249249    sage: for o in L:
    250     ...       poids[o] = random()
     250    ...       weight[o] = random()
    251251    ...       usefulness[o] = random()
    252252
    253253We can now define the MILP itself
     
    263263
    264264::
    265265
    266     sage: p.add_constraint(sum(poids[o] * taken[o] for o in L) <= C)
     266    sage: p.add_constraint(sum(weight[o] * taken[o] for o in L) <= C)
    267267
    268268.. link
    269269
     
    285285
    286286::
    287287
    288     sage: sum(poids[o] * taken[o] for o in L)
     288    sage: sum(weight[o] * taken[o] for o in L)
    289289    0.69649597966191712
    290290
    291291Should we take a flashlight?