Skip to content

Commit 681107a

Browse files
bug fix Woflan in Numpy 2.4
1 parent ce85858 commit 681107a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • pm4py/algo/analysis/woflan/place_invariants

pm4py/algo/analysis/woflan/place_invariants/utility.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,16 @@ def transform_basis(basis, style=None):
156156
val = solver.get_prim_obj_from_sol(sol, variant=proposed_solver)
157157

158158
if points is not None:
159-
new_vector = np.zeros(len(vector))
159+
new_vector = np.zeros(len(vector), dtype=np.float64)
160160

161161
if style == "weighted":
162162
for i in range(len(new_vector)):
163-
new_vector[i] = points[len(set_B)] * vector[i]
163+
base_value = np.asarray(vector[i]).reshape(-1)[0]
164+
new_vector[i] = points[len(set_B)] * base_value
164165
for j in range(len(modified_base)):
166+
coeff = np.asarray(modified_base[j][i]).reshape(-1)[0]
165167
new_vector[i] = (
166-
new_vector[i] + modified_base[j][i] * points[j]
168+
new_vector[i] + coeff * points[j]
167169
)
168170
elif style == "uniform":
169171
for i in range(len(new_vector)):

0 commit comments

Comments
 (0)