# Ticket #15194: exception_imports.patch

File exception_imports.patch, 1.8 KB (added by dimpase, 8 years ago)

the straightforward patch

• ## sage/coding/delsarte_bounds.py

```# HG changeset patch
# User Dmitrii Pasechnik <dimpase@gmail.com>
# Date 1379091707 -28800
# Node ID 5a3ea49447bdd6c572a23418916c5459cb582ca4
# Parent  7f0b4d66a9ccf7c467dcc550baed9e4e88b4233b
added imports and doctests for MIPSolver exceptions

diff --git a/sage/coding/delsarte_bounds.py b/sage/coding/delsarte_bounds.py```
 a sage: delsarte_bound_hamming_space(11,3,4) 327680/3 Such an input is invalid:: sage: delsarte_bound_hamming_space(11,3,-4) Solver exception:  'PPL : There is no feasible solution' () False REFERENCES: .. [1] P. Delsarte, An algebraic approach to the association schemes of coding theory, """ from sage.numerical.mip import MIPSolverException A, p = _delsarte_LP_building(n, d, 0, q, isinteger,  solver) try: bd=p.solve() except sage.numerical.mip.MIPSolverException, exc: except MIPSolverException, exc: print "Solver exception: ", exc, exc.args if return_data: return A,p,False sage: delsarte_bound_additive_hamming_space(11,3,4,q_base=2) 16 Such a d_star is not possible:: sage: delsarte_bound_additive_hamming_space(11,3,4,d_star=9) Solver exception:  'PPL : There is no feasible solution' () False """ from sage.numerical.mip import MIPSolverException if q_base == 0: q_base = q A, p = _delsarte_LP_building(n, d, d_star, q, isinteger,  solver, q_base**m) try: bd=p.solve() except sage.numerical.mip.MIPSolverException, exc: except MIPSolverException, exc: print "Solver exception: ", exc, exc.args if return_data: return A,p,False