JuliaControl / ControlSystems.jl

A Control Systems Toolbox for Julia
https://juliacontrol.github.io/ControlSystems.jl/stable/
Other
513 stars 85 forks source link

SisoZpk and SisoRational constructors called multiple times from zpk and tf #387

Closed albheim closed 1 year ago

albheim commented 4 years ago

Calling zpk([], [1], 1) will call the SisoZpk constuctor twice and calling tf([1], [1]) will call the SisoRational constructor three times.

@mfalt found that it was a conversion call that was the villain and it could be fixedfor zpk by changing struct SisoZpk{T,TR<:Number} <: SisoTf{T} to struct SisoZpk{T<:Number,TR<:Number} <: SisoTf{T} in SisoZpk.jl and adding Base.convert(::Type{T}, x::T) where {T<:SisoZpk} = x in conversion.jl

albheim commented 1 year ago

This seems to not show anymore, at least not for the cases suggested here.