Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b2e80cf

Browse files
committedJul 28, 2024·
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0a1b0d5 commit b2e80cf

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
 

‎linear_programming/interior_point_method.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
class InteriorPointMethod:
1313
"""
14-
Operate on linear programming problems using the Primal-Dual Interior-Point Method.
15-
16-
Attributes:
17-
objective_coefficients (np.ndarray): Coefficient matrix for the objective
18-
function.
19-
constraint_matrix (np.ndarray): Constraint matrix.
20-
constraint_bounds (np.ndarray): Constraint bounds.
21-
tol (float): Tolerance for stopping criterion.
22-
max_iter (int): Maximum number of iterations.
14+
Operate on linear programming problems using the Primal-Dual Interior-Point Method.
15+
16+
Attributes:
17+
objective_coefficients (np.ndarray): Coefficient matrix for the objective
18+
function.
19+
constraint_matrix (np.ndarray): Constraint matrix.
20+
constraint_bounds (np.ndarray): Constraint bounds.
21+
tol (float): Tolerance for stopping criterion.
22+
max_iter (int): Maximum number of iterations.
2323
"""
2424

2525
def __init__(
@@ -48,7 +48,7 @@ def _is_valid_input(self) -> bool:
4848

4949
def _convert_to_standard_form(self) -> tuple[np.ndarray, np.ndarray]:
5050
"""Convert constraints to standard form by adding slack and surplus
51-
variables."""
51+
variables."""
5252
(m, n) = self.constraint_matrix.shape
5353
slack_surplus = np.eye(m)
5454
a_standard = np.hstack([self.constraint_matrix, slack_surplus])
@@ -57,11 +57,11 @@ def _convert_to_standard_form(self) -> tuple[np.ndarray, np.ndarray]:
5757

5858
def solve(self) -> tuple[np.ndarray, float]:
5959
"""
60-
Solve the linear programming problem using the Primal-Dual Interior-Point
61-
Method.
60+
Solve the linear programming problem using the Primal-Dual Interior-Point
61+
Method.
6262
63-
Returns:
64-
tuple: A tuple containing the optimal solution and the optimal value.
63+
Returns:
64+
tuple: A tuple containing the optimal solution and the optimal value.
6565
"""
6666
a, c = self._convert_to_standard_form()
6767
m, n = a.shape

0 commit comments

Comments
 (0)
Please sign in to comment.