Merge branch 'release/1.5.9'
This commit is contained in:
2
setup.py
2
setup.py
@@ -35,7 +35,7 @@ problems.
|
||||
keywords = ["Optimization", "Linear Programming", "Operations Research"],
|
||||
author="J.S. Roy and S.A. Mitchell",
|
||||
author_email="pulp@stuartmitchell.com",
|
||||
url="https://github.com/stumitchell/pulp-or",
|
||||
url="https://github.com/coin-or/pulp",
|
||||
classifiers = ['Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Console',
|
||||
'Intended Audience :: Science/Research',
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
This file contains the constant definitions for PuLP
|
||||
Note that hopefully these will be changed into something more pythonic
|
||||
"""
|
||||
VERSION = '1.5.8'
|
||||
VERSION = '1.5.9'
|
||||
EPS = 1e-7
|
||||
|
||||
# variable categories
|
||||
|
||||
@@ -12,7 +12,7 @@ CplexPath = /usr/ilog/cplex/bin/x86_rhel4.0_3.4/libcplex110.so
|
||||
GurobiPath = /opt/gurobi201/linux32/lib/python2.5
|
||||
CbcPath = cbc
|
||||
GlpkPath = glpsol
|
||||
PulpCbcPath = %(here)s/solverdir/cbc/%(os)s/%(arch)scbc
|
||||
PulpCbcPath = %(here)s/solverdir/cbc/%(os)s/%(arch)s/cbc
|
||||
[licenses]
|
||||
ilm_cplex_license = "LICENSE your-enterprise\nRUNTIME NEVER ..."
|
||||
ilm_cplex_license_signature = 0
|
||||
|
||||
@@ -419,7 +419,7 @@ class GLPK_CMD(LpSolver_CMD):
|
||||
name = line[1]
|
||||
if len(line) ==2: line = [0,0]+f.readline().split()
|
||||
if isInteger:
|
||||
if line[2] == "*": value = int(line[3])
|
||||
if line[2] == "*": value = int(float(line[3]))
|
||||
else: value = float(line[2])
|
||||
else:
|
||||
value = float(line[3])
|
||||
|
||||
@@ -9,6 +9,7 @@ def pulpTestCheck(prob, solver, okstatus, sol = {},
|
||||
slacks = None,
|
||||
eps = 10**-3,
|
||||
status = None,
|
||||
objective = None,
|
||||
**kwargs):
|
||||
|
||||
if status is None:
|
||||
@@ -48,9 +49,17 @@ def pulpTestCheck(prob, solver, okstatus, sol = {},
|
||||
if abs(c.slack - slack) > eps:
|
||||
prob.writeLP("debug.lp")
|
||||
prob.writeMPS("debug.mps")
|
||||
print(("Test failed: constraint.slack", cname , "==",
|
||||
c.slack, "!=", slack))
|
||||
raise PulpError("Tests failed for solver %s"%solver)
|
||||
print("Test failed: constraint.slack", cname , "==",
|
||||
c.slack, "!=", slack)
|
||||
raise PulpError("Tests failed for solver %s" % solver)
|
||||
if objective is not None:
|
||||
z = prob.objective.value()
|
||||
if abs(z - objective) > eps:
|
||||
prob.writeLP("debug.lp")
|
||||
prob.writeMPS("debug.mps")
|
||||
print("Test failed: objective ", z, " != ", objective)
|
||||
raise PulpError("Tests failed for solver %s" % solver)
|
||||
|
||||
|
||||
def pulpTest001(solver):
|
||||
"""
|
||||
@@ -224,7 +233,7 @@ def pulpTest016(solver):
|
||||
|
||||
def pulpTest017(solver):
|
||||
# variable as objective
|
||||
prob = LpProblem("test016", LpMinimize)
|
||||
prob = LpProblem("test017", LpMinimize)
|
||||
x = LpVariable("x", 0, 4)
|
||||
y = LpVariable("y", -1, 1)
|
||||
z = LpVariable("z", 0)
|
||||
@@ -240,7 +249,7 @@ def pulpTest017(solver):
|
||||
|
||||
def pulpTest018(solver):
|
||||
# Long name in lp
|
||||
prob = LpProblem("test013", LpMinimize)
|
||||
prob = LpProblem("test018", LpMinimize)
|
||||
x = LpVariable("x"*90, 0, 4)
|
||||
y = LpVariable("y"*90, -1, 1)
|
||||
z = LpVariable("z"*90, 0)
|
||||
@@ -283,6 +292,20 @@ def pulpTest020(solver):
|
||||
print("\t Testing MIP solution")
|
||||
pulpTestCheck(prob, solver, [LpStatusOptimal], {x:3, y:-0.5, z:7})
|
||||
|
||||
def pulpTest021(solver):
|
||||
# MIP with floats in objective
|
||||
prob = LpProblem("test021", LpMinimize)
|
||||
x = LpVariable("x", 0, 4)
|
||||
y = LpVariable("y", -1, 1)
|
||||
z = LpVariable("z", 0, None, LpInteger)
|
||||
prob += 1.1 * x + 4.1 * y + 9.1 * z, "obj"
|
||||
prob += x+y <= 5, "c1"
|
||||
prob += x+z >= 10, "c2"
|
||||
prob += -y+z == 7.5, "c3"
|
||||
print("\t Testing MIP solution with floats in objective")
|
||||
pulpTestCheck(prob, solver, [LpStatusOptimal], {x:3, y:-0.5, z:7},
|
||||
objective=64.95)
|
||||
|
||||
def pulpTest030(solver):
|
||||
# relaxed MIP
|
||||
prob = LpProblem("test030", LpMinimize)
|
||||
@@ -580,7 +603,7 @@ def pulpTestSolver(solver, msg = 0):
|
||||
pulpTest010, pulpTest011, pulpTest012, pulpTest013, pulpTest014,
|
||||
pulpTest015, pulpTest016, pulpTest017,
|
||||
pulpTest018, pulpTest019,
|
||||
pulpTest020,
|
||||
pulpTest020, pulpTest021,
|
||||
pulpTest030,
|
||||
pulpTest040,
|
||||
pulpTest050,
|
||||
|
||||
Reference in New Issue
Block a user