Skip to content

Commit 89ad2f2

Browse files
committed
read/write
1 parent db8e80e commit 89ad2f2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

highs_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
print()
2323
print(f"objective bound: {model.objective_bound}, {solver.get_objective_bound()}")
2424
print(f"obj expr: {model.objective}, {solver.get_objective()}")
25+
model.write("test.lp")
2526

2627
# internals
2728
print()

mip/highs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,10 @@ def set_num_threads(self: "SolverHighs", threads: int):
455455
self._set_int_option_value("threads", threads)
456456

457457
def write(self: "SolverHighs", file_path: str):
458-
pass
458+
status = self._lib.Highs_writeModel(self._model, file_path.encode("utf-8"))
459459

460460
def read(self: "SolverHighs", file_path: str):
461-
pass
461+
status = self._lib.Highs_readModel(self._model, file_path.encode("utf-8"))
462462

463463
def num_cols(self: "SolverHighs") -> int:
464464
return self._lib.Highs_getNumCol(self._model)

0 commit comments

Comments
 (0)