From 39f2074258b65f110a675aa26fb96ceb7c4fd056 Mon Sep 17 00:00:00 2001 From: Vincent Grande <103126700+vincent-grande@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:33:20 +0200 Subject: [PATCH] fix: Solutions to the integer linear program for fixing faulty cocyle lifts are now allowed to take negative values. (#17) --- dreimac/complexprojectivecoords.py | 3 +++ dreimac/toroidalcoords.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/dreimac/complexprojectivecoords.py b/dreimac/complexprojectivecoords.py index 27f0f0d..936fa83 100644 --- a/dreimac/complexprojectivecoords.py +++ b/dreimac/complexprojectivecoords.py @@ -132,10 +132,13 @@ def get_coordinates( n_edges = delta2.shape[1] objective = np.zeros((n_edges), dtype=int) integrality = np.ones((n_edges), dtype=int) + bounds = scipy.optimize.Bounds() # empty bounds + optimizer_solution = milp( objective, integrality=integrality, constraints=constraints, + bounds=bounds, ) if not optimizer_solution["success"]: diff --git a/dreimac/toroidalcoords.py b/dreimac/toroidalcoords.py index f875baa..77e7438 100644 --- a/dreimac/toroidalcoords.py +++ b/dreimac/toroidalcoords.py @@ -148,11 +148,13 @@ def get_coordinates( n_edges = delta1.shape[1] objective = np.zeros((n_edges)) integrality = np.ones((n_edges)) + bounds = scipy.optimize.Bounds() # empty bounds optimizer_solution = milp( objective, integrality=integrality, constraints=constraints, + bounds=bounds, ) if not optimizer_solution["success"]: