Skip to content

Commit

Permalink
Merge pull request #587 from JuliaControl/sisorat
Browse files Browse the repository at this point in the history
type fixes in SisoRational
  • Loading branch information
baggepinnen committed Jan 3, 2022
2 parents 6bffec6 + e532db2 commit 70725e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/types/SisoTfTypes/SisoRational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ struct SisoRational{T} <: SisoTf{T}
num::Polynomial{T}
den::Polynomial{T}
function SisoRational{T}(num::Polynomial{T}, den::Polynomial{T}) where T <: Number
if all(den == zero(den))
if isequal(den, zero(den))
error("Cannot create SisoRational with zero denominator")
elseif all(isequal(num, zero(num)))
elseif isequal(num, zero(num))
# The numerator is zero, make the denominator 1
den = one(den)
end
Expand Down
4 changes: 2 additions & 2 deletions src/types/SisoTfTypes/SisoZpk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct SisoZpk{T,TR<:Number} <: SisoTf{T}
p::Vector{TR}
k::T
function SisoZpk{T,TR}(z::Vector{TR}, p::Vector{TR}, k::T) where {T<:Number, TR<:Number}
if k == zero(T)
if isequal(k, zero(T))
p = TR[]
z = TR[]
end
Expand Down Expand Up @@ -113,7 +113,7 @@ function pairup_conjugates!(x::AbstractVector)
imag(x[i]) == 0 && continue

# Attempt to find a matching conjugate to x[i]
j = findnext(==(conj(x[i])), x, i+1)
j = findnext(isequal(conj(x[i])), x, i+1)
j === nothing && return false

tmp = x[j]
Expand Down

0 comments on commit 70725e4

Please sign in to comment.