Skip to content

Commit 5c2d251

Browse files
committed
implement typed_hvcat for LTI systems
1 parent 5dd6602 commit 5c2d251

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/ControlSystemsBase/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "ControlSystemsBase"
22
uuid = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
33
authors = ["Dept. Automatic Control, Lund University"]
44
repo = "https://github.com/JuliaControl/ControlSystems.jl.git"
5-
version = "1.14.6"
5+
version = "1.14.7"
66

77
[deps]
88
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

lib/ControlSystemsBase/src/connections.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ end
134134
function Base.typed_hcat(::Type{T}, X...) where {T<:LTISystem}
135135
hcat(convert.(T, X)...)
136136
end
137+
138+
# This method is copied from Base on julia v1.11, it was changed in v1.12, but we rely on it to create a MIMO transfer function
139+
function Base.typed_hvcat(::Type{T}, rows::Tuple{Vararg{Int}}, as...) where {T<:LTISystem}
140+
nbr = length(rows) # number of block rows
141+
rs = Vector{Any}(undef, nbr)
142+
a = 1
143+
for i = 1:nbr
144+
rs[i] = Base.typed_hcat(T, as[a:a-1+rows[i]]...)
145+
a += rows[i]
146+
end
147+
T[rs...;]
148+
end
149+
137150
# Ambiguity
138151
Base.typed_hcat(::Type{S}, X::Number...) where {S<:LTISystem} = hcat(convert.(S, X)...)
139152
Base.typed_hcat(::Type{S}, X::Union{AbstractArray{<:Number,1}, AbstractArray{<:Number,2}}...) where {S<:LTISystem} = hcat(convert.(S, X)...)

0 commit comments

Comments
 (0)