Skip to content

Commit

Permalink
Merge pull request #1403 from hersle/fix_fixpoint_sub
Browse files Browse the repository at this point in the history
Fix fixpoint_sub warning
  • Loading branch information
ChrisRackauckas authored Jan 17, 2025
2 parents 19b252e + ab99113 commit 372783a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function _recursive_unwrap(val)
end

"""
fixpoint_sub(expr, dict; operator = Nothing, maxiters = 10000)
fixpoint_sub(expr, dict; operator = Nothing, maxiters = 1000)
Given a symbolic expression, equation or inequality `expr` perform the substitutions in
`dict` recursively until the expression does not change. Substitutions that depend on one
Expand All @@ -546,10 +546,11 @@ See also: [`fast_substitute`](@ref).
function fixpoint_sub(x, dict; operator = Nothing, maxiters = 1000)
dict = subrules_to_dict(dict)
y = fast_substitute(x, dict; operator)
while !isequal(x, y) && maxiters > 0
iters = maxiters
while !isequal(x, y) && iters > 0
y = x
x = fast_substitute(y, dict; operator)
maxiters -= 1
iters -= 1
end

if !isequal(x, y)
Expand Down

0 comments on commit 372783a

Please sign in to comment.