Skip to content

Commit

Permalink
widen the scope of ss*mat method (#949)
Browse files Browse the repository at this point in the history
* widen the scope of ss*mat method

* remove unbound type param
  • Loading branch information
baggepinnen authored Jan 10, 2025
1 parent 9f0bcff commit fd44401
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ControlSystemsBase/src/types/StateSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ function Base.Broadcast.broadcasted(::typeof(*), M::AbstractArray{<:Number}, sys
sminreal(basetype(ST)(Ae, Be, Ce, De, sys1.timeevol))
end

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

0 comments on commit fd44401

Please sign in to comment.