From 4354d9637a9f2c99b176e9c45b8e90e6d523af01 Mon Sep 17 00:00:00 2001 From: Yi-Te Huang <44385685+ytdHuang@users.noreply.github.com> Date: Fri, 22 Nov 2024 18:35:06 +0900 Subject: [PATCH] extend methods for `_FType` and `_CType` --- src/utilities.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/utilities.jl b/src/utilities.jl index 5a426bd1..3e967c2d 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -162,12 +162,16 @@ _FType(::Type{Int32}) = Float32 _FType(::Type{Int64}) = Float64 _FType(::Type{Float32}) = Float32 _FType(::Type{Float64}) = Float64 -_FType(::Type{ComplexF32}) = Float32 -_FType(::Type{ComplexF64}) = Float64 +_FType(::Type{Complex{Int32}}) = Float32 +_FType(::Type{Complex{Int64}}) = Float64 +_FType(::Type{Complex{Float32}}) = Float32 +_FType(::Type{Complex{Float64}}) = Float64 _CType(::AbstractArray{T}) where {T<:Number} = _CType(T) _CType(::Type{Int32}) = ComplexF32 _CType(::Type{Int64}) = ComplexF64 _CType(::Type{Float32}) = ComplexF32 _CType(::Type{Float64}) = ComplexF64 -_CType(::Type{ComplexF32}) = ComplexF32 -_CType(::Type{ComplexF64}) = ComplexF64 +_CType(::Type{Complex{Int32}}) = ComplexF32 +_CType(::Type{Complex{Int64}}) = ComplexF64 +_CType(::Type{Complex{Float32}}) = ComplexF32 +_CType(::Type{Complex{Float64}}) = ComplexF64