# Ticket #12418: update.diff

File update.diff, 2.8 KB (added by dimpase, 9 years ago)

update of the patch - for reviewing only

• ## sage/coding/delsarte_bounds.py

diff --git a/sage/coding/delsarte_bounds.py b/sage/coding/delsarte_bounds.py
 a AUTHORS: - Dmitrii V. (Dima) Pasechnik (2012-10): initial implementation. """ #***************************************************************************** #       Copyright (C) 2012 Dima Pasechnik """ Compute K^{n,q}_l(i), the Krawtchouk polynomial: see en.wikipedia.org/wiki/Kravchuk_polynomials _. It is given by .. math:: K^{n,q}_l(i)=\sum_{j=0}^l (-1)^j(q-1)^{(l-j)}{i \choose j}{n-i \choose l-j} """ from sage.rings.arith import binomial # Use the expression in equation (55) of MacWilliams & Sloane, pg 151 # We write jth term = some_factor * (j-1)th term kraw = jth_term = (q-1)**l * binomial(n, l) # j=0 for j in range(1,l+1): jth_term *= -q*(l-j+1)*(i-j+1)/((q-1)*j*(n-j+1)) kraw += jth_term return kraw return sum([((-1)**j)*((q-1)**(l-j))*binomial(i,j)*binomial(n-i,l-j) for j in range(l+1)]) def delsarte_bound_hamming_space(n, d, q, \ isinteger=False, return_data=False, solver="PPL"): - isinteger -- if True, uses an integer programming solver (ILP), rather that an LP solver. Can be very slow if set to True. - return_data -- if True, return a weights vector, which actually need not be a proper weight enumerator, or even have integer entries, and the LP. - return_data -- if True, return a triple (W,LP,bound), where W is a weights vector. W need not be a weight distribution of a code, or, if isinteger==False, even have integer entries, and the Delsarte bound LP. - solver -- the LP/ILP solved to be used. Defaults to PPL. It is arbitrary precision, thus there will be no rounding errors. With other solvers, you are on - isinteger -- if True, uses an integer programming solver (ILP), rather that an LP solver. Can be very slow if set to True. - return_data -- if True, return a weights vector, which actually need not be a proper weight enumerator, or even have integer entries, and the LP. - return_data -- if True, return a triple (W,LP,bound), where W is a weights vector. W need not be a weight distribution of a code, or, if isinteger==False, even have integer entries, and the Delsarte bound LP. - solver -- the LP/ILP solved to be used. Defaults to PPL. It is arbitrary precision, thus there will be no rounding errors. With other solvers, you are on