mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Use np.ndarray in Variables
This commit is contained in:
@@ -41,10 +41,10 @@ def run_basic_usage_tests(solver: InternalSolver) -> None:
|
||||
solver.get_variables(),
|
||||
Variables(
|
||||
names=["x[0]", "x[1]", "x[2]", "x[3]", "z"],
|
||||
lower_bounds=[0.0, 0.0, 0.0, 0.0, 0.0],
|
||||
upper_bounds=[1.0, 1.0, 1.0, 1.0, 67.0],
|
||||
lower_bounds=np.array([0.0, 0.0, 0.0, 0.0, 0.0]),
|
||||
upper_bounds=np.array([1.0, 1.0, 1.0, 1.0, 67.0]),
|
||||
types=["B", "B", "B", "B", "C"],
|
||||
obj_coeffs=[505.0, 352.0, 458.0, 220.0, 0.0],
|
||||
obj_coeffs=np.array([505.0, 352.0, 458.0, 220.0, 0.0]),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -85,14 +85,18 @@ def run_basic_usage_tests(solver: InternalSolver) -> None:
|
||||
Variables(
|
||||
names=["x[0]", "x[1]", "x[2]", "x[3]", "z"],
|
||||
basis_status=["U", "B", "U", "L", "U"],
|
||||
reduced_costs=[193.615385, 0.0, 187.230769, -23.692308, 13.538462],
|
||||
sa_lb_down=[-inf, -inf, -inf, -0.111111, -inf],
|
||||
sa_lb_up=[1.0, 0.923077, 1.0, 1.0, 67.0],
|
||||
sa_obj_down=[311.384615, 317.777778, 270.769231, -inf, -13.538462],
|
||||
sa_obj_up=[inf, 570.869565, inf, 243.692308, inf],
|
||||
sa_ub_down=[0.913043, 0.923077, 0.9, 0.0, 43.0],
|
||||
sa_ub_up=[2.043478, inf, 2.2, inf, 69.0],
|
||||
values=[1.0, 0.923077, 1.0, 0.0, 67.0],
|
||||
reduced_costs=np.array(
|
||||
[193.615385, 0.0, 187.230769, -23.692308, 13.538462]
|
||||
),
|
||||
sa_lb_down=np.array([-inf, -inf, -inf, -0.111111, -inf]),
|
||||
sa_lb_up=np.array([1.0, 0.923077, 1.0, 1.0, 67.0]),
|
||||
sa_obj_down=np.array(
|
||||
[311.384615, 317.777778, 270.769231, -inf, -13.538462]
|
||||
),
|
||||
sa_obj_up=np.array([inf, 570.869565, inf, 243.692308, inf]),
|
||||
sa_ub_down=np.array([0.913043, 0.923077, 0.9, 0.0, 43.0]),
|
||||
sa_ub_up=np.array([2.043478, inf, 2.2, inf, 69.0]),
|
||||
values=np.array([1.0, 0.923077, 1.0, 0.0, 67.0]),
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -137,7 +141,7 @@ def run_basic_usage_tests(solver: InternalSolver) -> None:
|
||||
solver.get_variable_attrs(),
|
||||
Variables(
|
||||
names=["x[0]", "x[1]", "x[2]", "x[3]", "z"],
|
||||
values=[1.0, 0.0, 1.0, 1.0, 61.0],
|
||||
values=np.array([1.0, 0.0, 1.0, 1.0, 61.0]),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user