Skip to content

Commit 2bd9b58

Browse files
committed
Always use lower bounds
1 parent 96bf787 commit 2bd9b58

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/modeling/determinestrategy.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,9 @@ function solve_unroll_lagrange(X, R, u₁L, u₂L, u₁step::Int, u₂step::Int,
461461
u₁float_finite = isfinite(u₁float)
462462
u₂float_finite = isfinite(u₂float)
463463
if !(u₁float_finite & u₂float_finite) # brute force
464-
u₁low = u₂low = 1
465-
u₁high = Core.ifelse(iszero(X₃), 1, Core.ifelse(atleast31registers, 8, 6))
466-
u₂high = Core.ifelse(iszero(X₂), 1, Core.ifelse(atleast31registers, 8, 6))
467-
return solve_unroll_iter(X, R, u₁L, u₂L, u₁low:u₁step:u₁high, u₂low:u₂step:u₂high)
464+
u₁high = Core.ifelse(iszero(X₃), u₁step, Core.ifelse(atleast31registers, 8, 6))
465+
u₂high = Core.ifelse(iszero(X₂), u₂step, Core.ifelse(atleast31registers, 8, 6))
466+
return solve_unroll_iter(X, R, u₁L, u₂L, u₁step:u₁step:u₁high, u₂step:u₂step:u₂high)
468467
end
469468
u₁low = floor(Int, u₁float)
470469
u₂low = max(u₂step, floor(Int, 0.8u₂float)) # must be at least 1
@@ -477,8 +476,8 @@ function solve_unroll_lagrange(X, R, u₁L, u₂L, u₁step::Int, u₂step::Int,
477476
u₂low = solve_unroll_constU(R, u₁high)
478477
end
479478
maxunroll = atleast31registers ? (((X₂ > 0) & (X₃ > 0)) ? 10 : 8) : 6
480-
u₁low = (clamp(u₁low, 1, maxunroll) ÷ u₁step) * u₁step
481-
u₂low = (clamp(u₂low, 1, maxunroll) ÷ u₂step) * u₂step
479+
u₁low = (clamp(u₁low, u₁step, maxunroll) ÷ u₁step) * u₁step
480+
u₂low = (clamp(u₂low, u₂step, maxunroll) ÷ u₂step) * u₂step
482481
u₁high = clamp(u₁high, 1, maxunroll)
483482
u₂high = clamp(u₂high, 1, maxunroll)
484483
solve_unroll_iter(X, R, u₁L, u₂L, reverse(u₁low:u₁step:u₁high), reverse(u₂low:u₂step:u₂high))

0 commit comments

Comments
 (0)