Skip to content

Commit fd44401

Browse files
authored
widen the scope of ss*mat method (#949)
* widen the scope of ss*mat method * remove unbound type param
1 parent 9f0bcff commit fd44401

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ControlSystemsBase/src/types/StateSpace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ function Base.Broadcast.broadcasted(::typeof(*), M::AbstractArray{<:Number}, sys
365365
sminreal(basetype(ST)(Ae, Be, Ce, De, sys1.timeevol))
366366
end
367367

368-
function *(sys1::ST, D::Diagonal) where {ST <: AbstractStateSpace}
369-
if issiso(sys1) # This is a special case that falls back on broadcasting
368+
function *(sys1::AbstractStateSpace, D::AbstractMatrix)
369+
if issiso(sys1) && isdiag(D) # This is a special case that falls back on broadcasting
370370
return sys1 .* D
371371
else # This is the standard implementation but must be handled here since we special case diagonal matrices for the case above
372372
sys1 * ss(D, sys1.timeevol)

0 commit comments

Comments
 (0)