Skip to content

Commit abf799e

Browse files
fix: flatten inputs and outputs in linearization_function
1 parent faa6869 commit abf799e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/linearization.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,25 @@ function linearization_function(
6464
ics[x] = Symbolics.COMMON_ZERO
6565
end
6666
end
67+
68+
_inputs = SymbolicT[]
69+
_outputs = SymbolicT[]
70+
for x in inputs
71+
if SU.is_array_shape(SU.shape(x))
72+
append!(_inputs, vec(collect(x)::Array{SymbolicT})::Vector{SymbolicT})
73+
else
74+
push!(_inputs, x)
75+
end
76+
end
77+
for x in outputs
78+
if SU.is_array_shape(SU.shape(x))
79+
append!(_outputs, vec(collect(x)::Array{SymbolicT})::Vector{SymbolicT})
80+
else
81+
push!(_outputs, x)
82+
end
83+
end
84+
inputs = _inputs
85+
outputs = _outputs
6786
sys = ssys
6887

6988
if initializealg === nothing

0 commit comments

Comments
 (0)