Skip to content

Commit

Permalink
Always use lower bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Oct 17, 2021
1 parent 96bf787 commit 2bd9b58
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/modeling/determinestrategy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,9 @@ function solve_unroll_lagrange(X, R, u₁L, u₂L, u₁step::Int, u₂step::Int,
u₁float_finite = isfinite(u₁float)
u₂float_finite = isfinite(u₂float)
if !(u₁float_finite & u₂float_finite) # brute force
u₁low = u₂low = 1
u₁high = Core.ifelse(iszero(X₃), 1, Core.ifelse(atleast31registers, 8, 6))
u₂high = Core.ifelse(iszero(X₂), 1, Core.ifelse(atleast31registers, 8, 6))
return solve_unroll_iter(X, R, u₁L, u₂L, u₁low:u₁step:u₁high, u₂low:u₂step:u₂high)
u₁high = Core.ifelse(iszero(X₃), u₁step, Core.ifelse(atleast31registers, 8, 6))
u₂high = Core.ifelse(iszero(X₂), u₂step, Core.ifelse(atleast31registers, 8, 6))
return solve_unroll_iter(X, R, u₁L, u₂L, u₁step:u₁step:u₁high, u₂step:u₂step:u₂high)
end
u₁low = floor(Int, u₁float)
u₂low = max(u₂step, floor(Int, 0.8u₂float)) # must be at least 1
Expand All @@ -477,8 +476,8 @@ function solve_unroll_lagrange(X, R, u₁L, u₂L, u₁step::Int, u₂step::Int,
u₂low = solve_unroll_constU(R, u₁high)
end
maxunroll = atleast31registers ? (((X₂ > 0) & (X₃ > 0)) ? 10 : 8) : 6
u₁low = (clamp(u₁low, 1, maxunroll) ÷ u₁step) * u₁step
u₂low = (clamp(u₂low, 1, maxunroll) ÷ u₂step) * u₂step
u₁low = (clamp(u₁low, u₁step, maxunroll) ÷ u₁step) * u₁step
u₂low = (clamp(u₂low, u₂step, maxunroll) ÷ u₂step) * u₂step
u₁high = clamp(u₁high, 1, maxunroll)
u₂high = clamp(u₂high, 1, maxunroll)
solve_unroll_iter(X, R, u₁L, u₂L, reverse(u₁low:u₁step:u₁high), reverse(u₂low:u₂step:u₂high))
Expand Down

2 comments on commit 2bd9b58

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/46919

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.86 -m "<description of version>" 2bd9b58c1cf00f1665eb7c16c5bc0859c539221b
git push origin v0.12.86

Please sign in to comment.