Skip to content

Commit

Permalink
remove unnecessary checking
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyolicoris committed May 28, 2024
1 parent 6011b56 commit f26d78b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kamui/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,10 @@ def calculate_k(
c = np.tile(weights, 2)

res = linprog(c, A_eq=A_eq, b_eq=b_eq, integrality=1)
if res.x is None:
return None
k = res.x[:M] - res.x[M:]
k = k.astype(np.int64)
cost = np.abs(V @ k + y).sum()
if cost > 0:
print(f"Warning: no solution found.")
return None
return k


Expand Down

0 comments on commit f26d78b

Please sign in to comment.