Ticket #12418: 12418_update.patch

File 12418_update.patch, 3.8 KB (added by dimpase, 8 years ago)

update to fix the remaining issues

  • sage/coding/all.py

    # HG changeset patch
    # User Dmitrii Pasechnik <dimpase@gmail.com>
    # Date 1373147760 -10800
    # Node ID 57a27638dd297c4d65ef8588764a504502d19b7e
    # Parent  71260c4f7840a7527415e947a76a2e9901360206
    patch update to fix laziness, wikipedia ref, one more doctest
    
    diff --git a/sage/coding/all.py b/sage/coding/all.py
    a b  
     1from sage.misc.lazy_import import lazy_import
     2
    13from ag_code import ag_code
    24
    35from code_constructions import (permutation_action,
     
    5557
    5658from sd_codes import self_dual_codes_binary
    5759
    58 from delsarte_bounds import (Krawtchouk,
    59                              delsarte_bound_hamming_space,
    60                              delsarte_bound_additive_hamming_space)
     60lazy_import("sage.coding.delsarte_bounds",
     61    ["Krawtchouk", "delsarte_bound_hamming_space", "delsarte_bound_additive_hamming_space"])
  • sage/coding/delsarte_bounds.py

    diff --git a/sage/coding/delsarte_bounds.py b/sage/coding/delsarte_bounds.py
    a b  
    1818#*****************************************************************************
    1919def Krawtchouk(n,q,l,i):
    2020    """
    21     Compute ``K^{n,q}_l(i)``, the Krawtchouk polynomial: see
    22     `en.wikipedia.org/wiki/Kravchuk_polynomials <http://en.wikipedia.org/wiki/Kravchuk_polynomials>`_.
     21    Compute ``K^{n,q}_l(i)``, the Krawtchouk polynomial:
     22    see :wikipedia:`Kravchuk_polynomials`.
    2323    It is given by
    2424
    2525    .. math::
     
    4646def _delsarte_LP_building(n, d, d_star, q, isinteger,  solver, maxc = 0):
    4747    """
    4848    LP builder - common for the two functions; not exported.
     49
     50    EXAMPLES::
     51
     52        sage: from sage.coding.delsarte_bounds import _delsarte_LP_building
     53        sage: _,p=_delsarte_LP_building(7, 3, 0, 2, False, "PPL")
     54        sage: p.show()
     55        Maximization:
     56          x_0 + x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7
     57        Constraints:
     58          constraint_0: 1 <= x_0 <= 1
     59          constraint_1: 0 <= x_1 <= 0
     60          constraint_2: 0 <= x_2 <= 0
     61          constraint_3: -7 x_0 - 5 x_1 - 3 x_2 - x_3 + x_4 + 3 x_5 + 5 x_6 + 7 x_7 <= 0
     62          constraint_4: -7 x_0 - 5 x_1 - 3 x_2 - x_3 + x_4 + 3 x_5 + 5 x_6 + 7 x_7 <= 0
     63          constraint_5: -21 x_0 - 9 x_1 - x_2 + 3 x_3 + 3 x_4 - x_5 - 9 x_6 - 21 x_7 <= 0
     64          constraint_6: -21 x_0 - 9 x_1 - x_2 + 3 x_3 + 3 x_4 - x_5 - 9 x_6 - 21 x_7 <= 0
     65          constraint_7: -35 x_0 - 5 x_1 + 5 x_2 + 3 x_3 - 3 x_4 - 5 x_5 + 5 x_6 + 35 x_7 <= 0
     66          constraint_8: -35 x_0 - 5 x_1 + 5 x_2 + 3 x_3 - 3 x_4 - 5 x_5 + 5 x_6 + 35 x_7 <= 0
     67          constraint_9: -35 x_0 + 5 x_1 + 5 x_2 - 3 x_3 - 3 x_4 + 5 x_5 + 5 x_6 - 35 x_7 <= 0
     68          constraint_10: -35 x_0 + 5 x_1 + 5 x_2 - 3 x_3 - 3 x_4 + 5 x_5 + 5 x_6 - 35 x_7 <= 0
     69          constraint_11: -21 x_0 + 9 x_1 - x_2 - 3 x_3 + 3 x_4 + x_5 - 9 x_6 + 21 x_7 <= 0
     70          constraint_12: -21 x_0 + 9 x_1 - x_2 - 3 x_3 + 3 x_4 + x_5 - 9 x_6 + 21 x_7 <= 0
     71          constraint_13: -7 x_0 + 5 x_1 - 3 x_2 + x_3 + x_4 - 3 x_5 + 5 x_6 - 7 x_7 <= 0
     72          constraint_14: -7 x_0 + 5 x_1 - 3 x_2 + x_3 + x_4 - 3 x_5 + 5 x_6 - 7 x_7 <= 0
     73          constraint_15: - x_0 + x_1 - x_2 + x_3 - x_4 + x_5 - x_6 + x_7 <= 0
     74          constraint_16: - x_0 + x_1 - x_2 + x_3 - x_4 + x_5 - x_6 + x_7 <= 0
     75        Variables:
     76          x_0 is a continuous variable (min=0, max=+oo)
     77          x_1 is a continuous variable (min=0, max=+oo)
     78          x_2 is a continuous variable (min=0, max=+oo)
     79          x_3 is a continuous variable (min=0, max=+oo)
     80          x_4 is a continuous variable (min=0, max=+oo)
     81          x_5 is a continuous variable (min=0, max=+oo)
     82          x_6 is a continuous variable (min=0, max=+oo)
     83          x_7 is a continuous variable (min=0, max=+oo)
     84
    4985    """
    5086    from sage.numerical.mip import MixedIntegerLinearProgram
    5187