Skip to content

Commit

Permalink
rename AbstractFloats to RealOrComplexFloat
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelSlevinsky committed Aug 10, 2022
1 parent 6fb7c5d commit 52bb89d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dspbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ function _conv(u, v, su, sv)
end

# We use this type definition for clarity
const AbstractFloats = Union{<:AbstractFloat,Complex{T} where T<:AbstractFloat}
const RealOrComplexFloat = Union{AbstractFloat, Complex{T} where T<:AbstractFloat}

# May switch argument order
"""
Expand All @@ -688,7 +688,7 @@ depending on the size of the input. `u` and `v` can be N-dimensional arrays,
with arbitrary indexing offsets, but their axes must be a `UnitRange`.
"""
function conv(u::AbstractArray{T, N},
v::AbstractArray{T, N}) where {T<:AbstractFloats, N}
v::AbstractArray{T, N}) where {T<:RealOrComplexFloat, N}
su = size(u)
sv = size(v)
if prod(su) >= prod(sv)
Expand All @@ -698,8 +698,8 @@ function conv(u::AbstractArray{T, N},
end
end

function conv(u::AbstractArray{<:AbstractFloats, N},
v::AbstractArray{<:AbstractFloats, N}) where N
function conv(u::AbstractArray{<:RealOrComplexFloat, N},
v::AbstractArray{<:RealOrComplexFloat, N}) where N
fu, fv = promote(u, v)
conv(fu, fv)
end
Expand All @@ -711,11 +711,11 @@ conv(u::AbstractArray{<:Number, N}, v::AbstractArray{<:Number, N}) where {N} =
conv(float(u), float(v))

function conv(u::AbstractArray{<:Number, N},
v::AbstractArray{<:AbstractFloats, N}) where N
v::AbstractArray{<:RealOrComplexFloat, N}) where N
conv(float(u), v)
end

function conv(u::AbstractArray{<:AbstractFloats, N},
function conv(u::AbstractArray{<:RealOrComplexFloat, N},
v::AbstractArray{<:Number, N}) where N
conv(u, float(v))
end
Expand Down

0 comments on commit 52bb89d

Please sign in to comment.