Skip to content

Commit

Permalink
exchange BLAS.BlasFloat for Union{AbstractFloat, Complex{<:AbstractFl… (
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelSlevinsky authored Aug 23, 2022
1 parent 58bfad1 commit 13265f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
14 changes: 8 additions & 6 deletions src/dspbase.jl
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 RealOrComplexFloat = Union{AbstractFloat, Complex{T} where T<:AbstractFloat}

# May switch argument order
"""
conv(u,v)
Expand All @@ -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<:RealOrComplexFloat, N}
su = size(u)
sv = size(v)
if prod(su) >= prod(sv)
Expand All @@ -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{<:RealOrComplexFloat, N},
v::AbstractArray{<:RealOrComplexFloat, N}) where N
fu, fv = promote(u, v)
conv(fu, fv)
end
Expand All @@ -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{<:RealOrComplexFloat, N}) where N
conv(float(u), v)
end

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

2 comments on commit 13265f5

@martinholters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/66817

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.7 -m "<description of version>" 13265f57db0f7964fc5850660668f0f2a099589f
git push origin v0.7.7

Please sign in to comment.