Skip to content

Commit eb6bc15

Browse files
fix: appropriately map array variables to scalarized versions in add_fallbacks!
1 parent 3dd2810 commit eb6bc15

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/systems/problem_utils.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Variables as they are specified in `vars` will take priority over their `toterm`
117117
function add_fallbacks!(
118118
varmap::AnyDict, vars::Vector, fallbacks::Dict; toterm = default_toterm)
119119
missingvars = Set()
120+
arrvars = Set()
120121
for var in vars
121122
haskey(varmap, var) && continue
122123
ttvar = toterm(var)
@@ -157,6 +158,7 @@ function add_fallbacks!(
157158
fallbacks, arrvar, nothing) get(fallbacks, ttarrvar, nothing) Some(nothing)
158159
if val !== nothing
159160
val = val[idxs...]
161+
is_sized_array_symbolic(arrvar) && push!(arrvars, arrvar)
160162
end
161163
else
162164
val = nothing
@@ -170,6 +172,10 @@ function add_fallbacks!(
170172
end
171173
end
172174

175+
for arrvar in arrvars
176+
varmap[arrvar] = collect(arrvar)
177+
end
178+
173179
return missingvars
174180
end
175181

0 commit comments

Comments
 (0)