# HG changeset patch
# User Leif Leonhardy <not.really@online.de>
# Date 1278274007 7200
# Node ID f33ad853b0a78286c9b35b8172d6631081776dd9
# Parent 415efe09065e11cb108eec6034845dbd44b0077f
#9392 broken doctest due to different (valid) solutions from binpacking  first reviewer patch
Fixes: Modified doctest fails on "normal" (nonoptional) testing because of undefined variables.
Apply on top of Nathann Cohen's patch.
diff r 415efe09065e r f33ad853b0a7 sage/numerical/optimize.py
a

b


699  699  sage: from sage.numerical.optimize import binpacking 
700  700  sage: values = [1/5, 1/3, 2/3, 3/4, 5/7] 
701  701  sage: bins = binpacking(values) # optional  GLPK, CBC 
702   sage: len(bins) 
 702  sage: len(bins) # optional  GLPK, CBC 
703  703  3 
704  704  
705  705  Checking the bins are of correct size :: 
706  706  
707   sage: all([ sum(b)<= 1 for b in bins ]) 
 707  sage: all([ sum(b)<= 1 for b in bins ]) # optional  GLPK, CBC 
708  708  True 
709  709  
710  710  Checking every item is in a bin :: 
711  711  
712   sage: b1, b2, b3 = bins 
713   sage: all([ (v in b1 or v in b2 or v in b3) for v in values ]) 
 712  sage: b1, b2, b3 = bins # optional  GLPK, CBC 
 713  sage: all([ (v in b1 or v in b2 or v in b3) for v in values ]) # optional  GLPK, CBC 
714  714  True 
715  715  
716  716  One way to use only three boxes (which is best possible) is to put 