Skip to content

Commit 2883d73

Browse files
fix: handle wrapped constants in find_eq_solvables!
1 parent 89f1803 commit 2883d73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/structural_transformation/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ function find_eq_solvables!(state::TearingState, ieq, to_rm = Int[], coeffs = no
239239
fullvars = state.fullvars
240240
@unpack graph, solvable_graph = state.structure
241241
eq = equations(state)[ieq]
242-
term = value(eq.rhs - eq.lhs)
242+
term = unwrap(eq.rhs - eq.lhs)
243243
all_int_vars = true
244244
coeffs === nothing || empty!(coeffs)
245245
empty!(to_rm)
@@ -289,7 +289,7 @@ function find_eq_solvables!(state::TearingState, ieq, to_rm = Int[], coeffs = no
289289
# When the expression is linear with numeric `a`, then we can safely
290290
# only consider `b` for the following iterations.
291291
term = b
292-
if SU._isone(abs(a))
292+
if SU._isone(abs(unwrap_const(a)))
293293
coeffs === nothing || push!(coeffs, convert(Int, unwrap_const(a)))
294294
else
295295
all_int_vars = false

0 commit comments

Comments
 (0)