Update dpm_solver.py

This commit is contained in:
Andres Caicedo 2023-05-08 14:43:25 +02:00
parent 462a9d3298
commit 683c14645e
No known key found for this signature in database
GPG key ID: 6E797C4F5A327624

View file

@ -522,15 +522,21 @@ class DPM_Solver:
if order == 3: if order == 3:
K = steps // 3 + 1 K = steps // 3 + 1
if steps % 3 == 0: if steps % 3 == 0:
orders = [3, ] * ( orders = [
3,
] * (
K - 2 K - 2
) + [2, 1] ) + [2, 1]
elif steps % 3 == 1: elif steps % 3 == 1:
orders = [3, ] * ( orders = [
3,
] * (
K - 1 K - 1
) + [1] ) + [1]
else: else:
orders = [3, ] * ( orders = [
3,
] * (
K - 1 K - 1
) + [2] ) + [2]
elif order == 2: elif order == 2:
@ -541,7 +547,9 @@ class DPM_Solver:
] * K ] * K
else: else:
K = steps // 2 + 1 K = steps // 2 + 1
orders = [2, ] * ( orders = [
2,
] * (
K - 1 K - 1
) + [1] ) + [1]
elif order == 1: elif order == 1: