|
23 | 23 | else: |
24 | 24 | # Try library from highsbox, which is optional dependency. |
25 | 25 | import highsbox |
| 26 | + |
26 | 27 | root = highsbox.highs_dist_dir() |
27 | 28 |
|
28 | 29 | # Need library matching operating system. |
@@ -1098,7 +1099,9 @@ def set_max_nodes(self: "SolverHighs", max_nodes: int): |
1098 | 1099 | def get_max_nodes_same_incumbent(self: "SolverHighs") -> int: |
1099 | 1100 | return self._get_int_option_value("mip_max_stall_nodes") |
1100 | 1101 |
|
1101 | | - def set_max_nodes_same_incumbent(self: "SolverHighs", max_nodes_same_incumbent: int): |
| 1102 | + def set_max_nodes_same_incumbent( |
| 1103 | + self: "SolverHighs", max_nodes_same_incumbent: int |
| 1104 | + ): |
1102 | 1105 | self._set_int_option_value("mip_max_stall_nodes", max_nodes_same_incumbent) |
1103 | 1106 |
|
1104 | 1107 | def set_num_threads(self: "SolverHighs", threads: int): |
@@ -1333,7 +1336,7 @@ def constr_get_index(self: "SolverHighs", name: str) -> int: |
1333 | 1336 | if status == STATUS_ERROR: |
1334 | 1337 | # This means that no constraint with that name was found. Unfortunately, |
1335 | 1338 | # Highs: getRowByName doesn't assign a value to idx in that case. |
1336 | | - return -1 |
| 1339 | + return -1 |
1337 | 1340 | return idx[0] |
1338 | 1341 |
|
1339 | 1342 | # Variable-related getters/setters |
@@ -1556,7 +1559,9 @@ def _get_dual_solution_status(self: "SolverHighs"): |
1556 | 1559 | return self._get_int_info_value("dual_solution_status") |
1557 | 1560 |
|
1558 | 1561 | def _has_dual_solution(self: "SolverHighs"): |
1559 | | - return self._get_dual_solution_status() == self._lib.kHighsSolutionStatusFeasible |
| 1562 | + return ( |
| 1563 | + self._get_dual_solution_status() == self._lib.kHighsSolutionStatusFeasible |
| 1564 | + ) |
1560 | 1565 |
|
1561 | 1566 | def get_status(self: "SolverHighs") -> mip.OptimizationStatus: |
1562 | 1567 | OS = mip.OptimizationStatus |
@@ -1584,7 +1589,9 @@ def get_status(self: "SolverHighs") -> mip.OptimizationStatus: |
1584 | 1589 | status = status_map[highs_status] |
1585 | 1590 | if status is None: |
1586 | 1591 | # depends on solution status |
1587 | | - status = OS.FEASIBLE if self._has_primal_solution() else OS.NO_SOLUTION_FOUND |
| 1592 | + status = ( |
| 1593 | + OS.FEASIBLE if self._has_primal_solution() else OS.NO_SOLUTION_FOUND |
| 1594 | + ) |
1588 | 1595 | return status |
1589 | 1596 |
|
1590 | 1597 | def cgraph_density(self: "SolverHighs") -> float: |
|
0 commit comments