Ticket #13375: trac_13375_problem_name_length_check.patch

File trac_13375_problem_name_length_check.patch, 749 bytes (added by trehn, 10 years ago)
  • sage/numerical/backends/glpk_backend.pyx

    # HG changeset patch
    # User Thomas Rehn <thomas.rehn@uni-rostock.de>
    # Date 1345195925 -7200
    # Node ID 8498dce6d1dbffe85813a2350536180d24029355
    # Parent  90cdc6a8ad4e4bed83142b4ca0e6c551acd73204
    Trac 13375: add a check for the length of the problem name
    
    diff --git a/sage/numerical/backends/glpk_backend.pyx b/sage/numerical/backends/glpk_backend.pyx
    a b  
    311311                return n
    312312
    313313        else:
     314            if len(name) > 255:
     315                raise ValueError("Problem name for GLPK must not be longer than 255 characters.")
    314316            glp_set_prob_name(self.lp, name)
    315317
    316318    cpdef set_objective(self, list coeff, double d = 0.0):