From 220dffb6012650b2a14baf60c7eec71836aacc12 Mon Sep 17 00:00:00 2001 From: Mikael Slevinsky Date: Wed, 20 Jul 2022 11:56:50 -0600 Subject: [PATCH 1/4] exchange BLAS.BlasFloat for Union{AbstractFloat, Complex{<:AbstractFloat}} --- src/dspbase.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/dspbase.jl b/src/dspbase.jl index 6163c1af8..dde9cd6fa 100644 --- a/src/dspbase.jl +++ b/src/dspbase.jl @@ -1,7 +1,6 @@ # This file was formerly a part of Julia. License is MIT: https://julialang.org/license import Base: trailingsize -import LinearAlgebra.BLAS const SMALL_FILT_CUTOFF = 58 @@ -677,6 +676,9 @@ function _conv(u, v, su, sv) _conv!(out, u, v, su, sv, outsize) end +# We use this type definition for clarity +const AbstractFloats = Union{AbstractFloat,Complex{T} where T<:AbstractFloat} + # May switch argument order """ conv(u,v) @@ -686,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<:BLAS.BlasFloat, N} + v::AbstractArray{T, N}) where {T<:AbstractFloats, N} su = size(u) sv = size(v) if prod(su) >= prod(sv) @@ -696,8 +698,8 @@ function conv(u::AbstractArray{T, N}, end end -function conv(u::AbstractArray{<:BLAS.BlasFloat, N}, - v::AbstractArray{<:BLAS.BlasFloat, N}) where N +function conv(u::AbstractArray{<:AbstractFloats, N}, + v::AbstractArray{<:AbstractFloats, N}) where N fu, fv = promote(u, v) conv(fu, fv) end @@ -709,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{<:BLAS.BlasFloat, N}) where N + v::AbstractArray{<:AbstractFloats, N}) where N conv(float(u), v) end -function conv(u::AbstractArray{<:BLAS.BlasFloat, N}, +function conv(u::AbstractArray{<:AbstractFloats, N}, v::AbstractArray{<:Number, N}) where N conv(u, float(v)) end From b531fa289b84205505642ffea749063d167d1434 Mon Sep 17 00:00:00 2001 From: Mikael Slevinsky Date: Wed, 20 Jul 2022 16:11:12 -0600 Subject: [PATCH 2/4] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 716a8d129..a57a5e69d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DSP" uuid = "717857b8-e6f2-59f4-9121-6e50c889abd2" -version = "0.7.6" +version = "0.7.7" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" From 6fb7c5df646a3c1c236471973d04e466bd9c4dfc Mon Sep 17 00:00:00 2001 From: Mikael Slevinsky Date: Fri, 5 Aug 2022 21:33:55 -0600 Subject: [PATCH 3/4] Update src/dspbase.jl Co-authored-by: Dehann Fourie <6412556+dehann@users.noreply.github.com> --- src/dspbase.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dspbase.jl b/src/dspbase.jl index dde9cd6fa..73395c054 100644 --- a/src/dspbase.jl +++ b/src/dspbase.jl @@ -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 AbstractFloats = Union{<:AbstractFloat,Complex{T} where T<:AbstractFloat} # May switch argument order """ From 52bb89d84c3fc224889c23fa9313039999171591 Mon Sep 17 00:00:00 2001 From: Mikael Slevinsky Date: Wed, 10 Aug 2022 01:11:31 -0600 Subject: [PATCH 4/4] rename AbstractFloats to RealOrComplexFloat --- src/dspbase.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dspbase.jl b/src/dspbase.jl index 73395c054..0c4334946 100644 --- a/src/dspbase.jl +++ b/src/dspbase.jl @@ -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 """ @@ -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) @@ -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 @@ -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