diff --git a/NEWS.md b/NEWS.md index 672f6d4021048..0972e8b8eaddf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -748,6 +748,10 @@ Deprecated or removed in favor of `isassigned` and `normalize_string` in favor of `normalize`, all three in the new `Unicode` standard library module ([#25021]). + * The aliases `Complex32`, `Complex64` and `Complex128` have been deprecated in favor of `ComplexF16`, + `ComplexF32` and `ComplexF64` respectively (#24647). + + Command-line option changes --------------------------- @@ -1721,4 +1725,4 @@ Command-line option changes [#24413]: https://github.com/JuliaLang/julia/issues/24413 [#24653]: https://github.com/JuliaLang/julia/issues/24653 [#24869]: https://github.com/JuliaLang/julia/issues/24869 -[#25021]: https://github.com/JuliaLang/julia/issues/25021 \ No newline at end of file +[#25021]: https://github.com/JuliaLang/julia/issues/25021 diff --git a/base/array.jl b/base/array.jl index 083e4a4323f7f..38e5aa0df7d84 100644 --- a/base/array.jl +++ b/base/array.jl @@ -365,7 +365,7 @@ julia> ones(1,2) 1×2 Array{Float64,2}: 1.0 1.0 -julia> ones(Complex128, 2, 3) +julia> ones(ComplexF64, 2, 3) 2×3 Array{Complex{Float64},2}: 1.0+0.0im 1.0+0.0im 1.0+0.0im 1.0+0.0im 1.0+0.0im 1.0+0.0im diff --git a/base/complex.jl b/base/complex.jl index a56b9423ec7b6..168361073c23c 100644 --- a/base/complex.jl +++ b/base/complex.jl @@ -5,7 +5,7 @@ Complex number type with real and imaginary part of type `T`. -`Complex32`, `Complex64` and `Complex128` are aliases for +`ComplexF16`, `ComplexF32` and `ComplexF64` are aliases for `Complex{Float16}`, `Complex{Float32}` and `Complex{Float64}` respectively. """ struct Complex{T<:Real} <: Number @@ -28,9 +28,9 @@ julia> im * im """ const im = Complex(false, true) -const Complex128 = Complex{Float64} -const Complex64 = Complex{Float32} -const Complex32 = Complex{Float16} +const ComplexF64 = Complex{Float64} +const ComplexF32 = Complex{Float32} +const ComplexF16 = Complex{Float16} convert(::Type{Complex{T}}, x::Real) where {T<:Real} = Complex{T}(x,0) convert(::Type{Complex{T}}, z::Complex) where {T<:Real} = Complex{T}(real(z),imag(z)) @@ -353,7 +353,7 @@ inv(z::Complex{<:Union{Float16,Float32}}) = # a + i*b # p + i*q = --------- # c + i*d -function /(z::Complex128, w::Complex128) +function /(z::ComplexF64, w::ComplexF64) a, b = reim(z); c, d = reim(w) half = 0.5 two = 2.0 @@ -369,7 +369,7 @@ function /(z::Complex128, w::Complex128) ab <= un*two/ϵ && (a=a*bs; b=b*bs; s=s/bs ) # scale up a,b cd <= un*two/ϵ && (c=c*bs; d=d*bs; s=s*bs ) # scale up c,d abs(d)<=abs(c) ? ((p,q)=robust_cdiv1(a,b,c,d) ) : ((p,q)=robust_cdiv1(b,a,d,c); q=-q) - return Complex128(p*s,q*s) # undo scaling + return ComplexF64(p*s,q*s) # undo scaling end function robust_cdiv1(a::Float64, b::Float64, c::Float64, d::Float64) r = d/c @@ -387,7 +387,7 @@ function robust_cdiv2(a::Float64, b::Float64, c::Float64, d::Float64, r::Float64 end end -function inv(w::Complex128) +function inv(w::ComplexF64) c, d = reim(w) half = 0.5 two = 2.0 @@ -411,7 +411,7 @@ function inv(w::Complex128) p = r * t q = -t end - return Complex128(p*s,q*s) # undo scaling + return ComplexF64(p*s,q*s) # undo scaling end function ssqs(x::T, y::T) where T<:AbstractFloat diff --git a/base/deprecated.jl b/base/deprecated.jl index 9e4b11d545e36..2980f3ff14155 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -2987,6 +2987,11 @@ end @deprecate_moved lcfirst "Unicode" true true @deprecate_moved ucfirst "Unicode" true true +# PR #24647 +@deprecate_binding Complex32 ComplexF16 +@deprecate_binding Complex64 ComplexF32 +@deprecate_binding Complex128 ComplexF64 + # END 0.7 deprecations # BEGIN 1.0 deprecations diff --git a/base/essentials.jl b/base/essentials.jl index 8271e315c5fae..169bb89476c38 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -364,7 +364,7 @@ Size, in bytes, of the canonical binary representation of the given DataType `T` julia> sizeof(Float32) 4 -julia> sizeof(Complex128) +julia> sizeof(ComplexF64) 16 ``` diff --git a/base/exports.jl b/base/exports.jl index 7fe632fff0ada..0c4d66372bd12 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -44,9 +44,9 @@ export Cmd, Colon, Complex, - Complex128, - Complex64, - Complex32, + ComplexF64, + ComplexF32, + ComplexF16, ConjArray, ConjVector, ConjMatrix, diff --git a/base/fastmath.jl b/base/fastmath.jl index c183b6e00eeef..f152aaa1e342b 100644 --- a/base/fastmath.jl +++ b/base/fastmath.jl @@ -187,7 +187,7 @@ issubnormal_fast(x) = false # complex numbers -ComplexTypes = Union{Complex64, Complex128} +ComplexTypes = Union{ComplexF32, ComplexF64} @fastmath begin abs_fast(x::ComplexTypes) = hypot(real(x), imag(x)) diff --git a/base/inference.jl b/base/inference.jl index 0870f053143db..f81292295d574 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -2626,7 +2626,7 @@ function abstract_call(@nospecialize(f), fargs::Union{Tuple{},Vector{Any}}, argt length(argtypes) == 3 && (argtypes[3] ⊑ Int32 || argtypes[3] ⊑ Int64) a1 = argtypes[2] - basenumtype = Union{corenumtype, Main.Base.Complex64, Main.Base.Complex128, Main.Base.Rational} + basenumtype = Union{corenumtype, Main.Base.ComplexF32, Main.Base.ComplexF64, Main.Base.Rational} if a1 ⊑ basenumtype ftimes = Main.Base.:* ta1 = widenconst(a1) @@ -5320,7 +5320,7 @@ function inline_call(e::Expr, sv::OptimizationState, stmts::Vector{Any}, boundsc triple = (a2 === Int32(3) || a2 === Int64(3)) if square || triple a1 = e.args[2] - basenumtype = Union{corenumtype, Main.Base.Complex64, Main.Base.Complex128, Main.Base.Rational} + basenumtype = Union{corenumtype, Main.Base.ComplexF32, Main.Base.ComplexF64, Main.Base.Rational} if isa(a1, basenumtype) || ((isa(a1, Symbol) || isa(a1, Slot) || isa(a1, SSAValue)) && exprtype(a1, sv.src, sv.mod) ⊑ basenumtype) if square diff --git a/base/linalg/blas.jl b/base/linalg/blas.jl index d24431357323c..fc797260fb1a2 100644 --- a/base/linalg/blas.jl +++ b/base/linalg/blas.jl @@ -171,8 +171,8 @@ function blascopy! end for (fname, elty) in ((:dcopy_,:Float64), (:scopy_,:Float32), - (:zcopy_,:Complex128), - (:ccopy_,:Complex64)) + (:zcopy_,:ComplexF64), + (:ccopy_,:ComplexF32)) @eval begin # SUBROUTINE DCOPY(N,DX,INCX,DY,INCY) function blascopy!(n::Integer, DX::Union{Ptr{$elty},StridedArray{$elty}}, incx::Integer, DY::Union{Ptr{$elty},StridedArray{$elty}}, incy::Integer) @@ -202,8 +202,8 @@ function scal end for (fname, elty) in ((:dscal_,:Float64), (:sscal_,:Float32), - (:zscal_,:Complex128), - (:cscal_,:Complex64)) + (:zscal_,:ComplexF64), + (:cscal_,:ComplexF32)) @eval begin # SUBROUTINE DSCAL(N,DA,DX,INCX) function scal!(n::Integer, DA::$elty, DX::Union{Ptr{$elty},DenseArray{$elty}}, incx::Integer) @@ -277,8 +277,8 @@ for (fname, elty) in ((:ddot_,:Float64), end end end -for (fname, elty) in ((:cblas_zdotc_sub,:Complex128), - (:cblas_cdotc_sub,:Complex64)) +for (fname, elty) in ((:cblas_zdotc_sub,:ComplexF64), + (:cblas_cdotc_sub,:ComplexF32)) @eval begin # DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX,DY,INCY) # * .. Scalar Arguments .. @@ -295,8 +295,8 @@ for (fname, elty) in ((:cblas_zdotc_sub,:Complex128), end end end -for (fname, elty) in ((:cblas_zdotu_sub,:Complex128), - (:cblas_cdotu_sub,:Complex64)) +for (fname, elty) in ((:cblas_zdotu_sub,:ComplexF64), + (:cblas_cdotu_sub,:ComplexF32)) @eval begin # DOUBLE PRECISION FUNCTION DDOT(N,DX,INCX,DY,INCY) # * .. Scalar Arguments .. @@ -358,8 +358,8 @@ function nrm2 end for (fname, elty, ret_type) in ((:dnrm2_,:Float64,:Float64), (:snrm2_,:Float32,:Float32), - (:dznrm2_,:Complex128,:Float64), - (:scnrm2_,:Complex64,:Float32)) + (:dznrm2_,:ComplexF64,:Float64), + (:scnrm2_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE DNRM2(N,X,INCX) function nrm2(n::Integer, X::Union{Ptr{$elty},DenseArray{$elty}}, incx::Integer) @@ -391,8 +391,8 @@ function asum end for (fname, elty, ret_type) in ((:dasum_,:Float64,:Float64), (:sasum_,:Float32,:Float32), - (:dzasum_,:Complex128,:Float64), - (:scasum_,:Complex64,:Float32)) + (:dzasum_,:ComplexF64,:Float64), + (:scasum_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ASUM(N, X, INCX) function asum(n::Integer, X::Union{Ptr{$elty},DenseArray{$elty}}, incx::Integer) @@ -428,8 +428,8 @@ function axpy! end for (fname, elty) in ((:daxpy_,:Float64), (:saxpy_,:Float32), - (:zaxpy_,:Complex128), - (:caxpy_,:Complex64)) + (:zaxpy_,:ComplexF64), + (:caxpy_,:ComplexF32)) @eval begin # SUBROUTINE DAXPY(N,DA,DX,INCX,DY,INCY) # DY <- DA*DX + DY @@ -490,7 +490,7 @@ julia> Base.BLAS.axpby!(2., x, 3., y) function axpby! end for (fname, elty) in ((:daxpby_,:Float64), (:saxpby_,:Float32), - (:zaxpby_,:Complex128), (:caxpby_,:Complex64)) + (:zaxpby_,:ComplexF64), (:caxpby_,:ComplexF32)) @eval begin # SUBROUTINE DAXPBY(N,DA,DX,INCX,DB,DY,INCY) # DY <- DA*DX + DB*DY @@ -521,8 +521,8 @@ end ## iamax for (fname, elty) in ((:idamax_,:Float64), (:isamax_,:Float32), - (:izamax_,:Complex128), - (:icamax_,:Complex64)) + (:izamax_,:ComplexF64), + (:icamax_,:ComplexF32)) @eval begin function iamax(n::Integer, dx::Union{Ptr{$elty}, DenseArray{$elty}}, incx::Integer) ccall((@blasfunc($fname), libblas),BlasInt, @@ -538,8 +538,8 @@ iamax(dx::Union{StridedVector,Array}) = Base.@gc_preserve dx iamax(length(dx), p ### gemv for (fname, elty) in ((:dgemv_,:Float64), (:sgemv_,:Float32), - (:zgemv_,:Complex128), - (:cgemv_,:Complex64)) + (:zgemv_,:ComplexF64), + (:cgemv_,:ComplexF32)) @eval begin #SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) #* .. Scalar Arguments .. @@ -621,8 +621,8 @@ function gbmv end for (fname, elty) in ((:dgbmv_,:Float64), (:sgbmv_,:Float32), - (:zgbmv_,:Complex128), - (:cgbmv_,:Complex64)) + (:zgbmv_,:ComplexF64), + (:cgbmv_,:ComplexF32)) @eval begin # SUBROUTINE DGBMV(TRANS,M,N,KL,KU,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) # * .. Scalar Arguments .. @@ -666,8 +666,8 @@ function symv! end for (fname, elty, lib) in ((:dsymv_,:Float64,libblas), (:ssymv_,:Float32,libblas), - (:zsymv_,:Complex128,liblapack), - (:csymv_,:Complex64,liblapack)) + (:zsymv_,:ComplexF64,liblapack), + (:csymv_,:ComplexF32,liblapack)) # Note that the complex symv are not BLAS but auiliary functions in LAPACK @eval begin # SUBROUTINE DSYMV(UPLO,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) @@ -724,8 +724,8 @@ Only the [`ul`](@ref stdlib-blas-uplo) triangle of `A` is used. symv(ul, A, x) ### hemv -for (fname, elty) in ((:zhemv_,:Complex128), - (:chemv_,:Complex64)) +for (fname, elty) in ((:zhemv_,:ComplexF64), + (:chemv_,:ComplexF32)) @eval begin function hemv!(uplo::Char, α::$elty, A::StridedMatrix{$elty}, x::StridedVector{$elty}, β::$elty, y::StridedVector{$elty}) m, n = size(A) @@ -822,8 +822,8 @@ Return the updated `y`. sbmv! ### hbmv, (HB) Hermitian banded matrix-vector multiplication -for (fname, elty) in ((:zhbmv_,:Complex128), - (:chbmv_,:Complex64)) +for (fname, elty) in ((:zhbmv_,:ComplexF64), + (:chbmv_,:ComplexF32)) @eval begin # SUBROUTINE ZHBMV(UPLO,N,K,ALPHA,A,LDA,X,INCX,BETA,Y,INCY) # * .. Scalar Arguments .. @@ -877,8 +877,8 @@ function trmv! end for (fname, elty) in ((:dtrmv_,:Float64), (:strmv_,:Float32), - (:ztrmv_,:Complex128), - (:ctrmv_,:Complex64)) + (:ztrmv_,:ComplexF64), + (:ctrmv_,:ComplexF32)) @eval begin # SUBROUTINE DTRMV(UPLO,TRANS,DIAG,N,A,LDA,X,INCX) # * .. Scalar Arguments .. @@ -929,8 +929,8 @@ function trsv end for (fname, elty) in ((:dtrsv_,:Float64), (:strsv_,:Float32), - (:ztrsv_,:Complex128), - (:ctrsv_,:Complex64)) + (:ztrsv_,:ComplexF64), + (:ctrsv_,:ComplexF32)) @eval begin # SUBROUTINE DTRSV(UPLO,TRANS,DIAG,N,A,LDA,X,INCX) # .. Scalar Arguments .. @@ -967,8 +967,8 @@ function ger! end for (fname, elty) in ((:dger_,:Float64), (:sger_,:Float32), - (:zgerc_,:Complex128), - (:cgerc_,:Complex64)) + (:zgerc_,:ComplexF64), + (:cgerc_,:ComplexF32)) @eval begin function ger!(α::$elty, x::StridedVector{$elty}, y::StridedVector{$elty}, A::StridedMatrix{$elty}) m, n = size(A) @@ -999,8 +999,8 @@ function syr! end for (fname, elty, lib) in ((:dsyr_,:Float64,libblas), (:ssyr_,:Float32,libblas), - (:zsyr_,:Complex128,liblapack), - (:csyr_,:Complex64,liblapack)) + (:zsyr_,:ComplexF64,liblapack), + (:csyr_,:ComplexF32,liblapack)) @eval begin function syr!(uplo::Char, α::$elty, x::StridedVector{$elty}, A::StridedMatrix{$elty}) n = checksquare(A) @@ -1028,8 +1028,8 @@ as `alpha*x*x' + A`. """ function her! end -for (fname, elty, relty) in ((:zher_,:Complex128, :Float64), - (:cher_,:Complex64, :Float32)) +for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64), + (:cher_,:ComplexF32, :Float32)) @eval begin function her!(uplo::Char, α::$relty, x::StridedVector{$elty}, A::StridedMatrix{$elty}) n = checksquare(A) @@ -1060,8 +1060,8 @@ function gemm! end for (gemm, elty) in ((:dgemm_,:Float64), (:sgemm_,:Float32), - (:zgemm_,:Complex128), - (:cgemm_,:Complex64)) + (:zgemm_,:ComplexF64), + (:cgemm_,:ComplexF32)) @eval begin # SUBROUTINE DGEMM(TRANSA,TRANSB,M,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # * .. Scalar Arguments .. @@ -1119,8 +1119,8 @@ gemm(tA, tB, A, B) ## (SY) symmetric matrix-matrix and matrix-vector multiplication for (mfname, elty) in ((:dsymm_,:Float64), (:ssymm_,:Float32), - (:zsymm_,:Complex128), - (:csymm_,:Complex64)) + (:zsymm_,:ComplexF64), + (:csymm_,:ComplexF32)) @eval begin # SUBROUTINE DSYMM(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # .. Scalar Arguments .. @@ -1184,8 +1184,8 @@ Update `C` as `alpha*A*B + beta*C` or `alpha*B*A + beta*C` according to [`side`] symm! ## (HE) Hermitian matrix-matrix and matrix-vector multiplication -for (mfname, elty) in ((:zhemm_,:Complex128), - (:chemm_,:Complex64)) +for (mfname, elty) in ((:zhemm_,:ComplexF64), + (:chemm_,:ComplexF32)) @eval begin # SUBROUTINE DHEMM(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # .. Scalar Arguments .. @@ -1244,8 +1244,8 @@ function syrk end for (fname, elty) in ((:dsyrk_,:Float64), (:ssyrk_,:Float32), - (:zsyrk_,:Complex128), - (:csyrk_,:Complex64)) + (:zsyrk_,:ComplexF64), + (:csyrk_,:ComplexF32)) @eval begin # SUBROUTINE DSYRK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC) # * .. Scalar Arguments .. @@ -1298,8 +1298,8 @@ according to [`trans`](@ref stdlib-blas-trans). """ function herk end -for (fname, elty, relty) in ((:zherk_, :Complex128, :Float64), - (:cherk_, :Complex64, :Float32)) +for (fname, elty, relty) in ((:zherk_, :ComplexF64, :Float64), + (:cherk_, :ComplexF32, :Float32)) @eval begin # SUBROUTINE CHERK(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC) # * .. Scalar Arguments .. @@ -1337,8 +1337,8 @@ end ## syr2k for (fname, elty) in ((:dsyr2k_,:Float64), (:ssyr2k_,:Float32), - (:zsyr2k_,:Complex128), - (:csyr2k_,:Complex64)) + (:zsyr2k_,:ComplexF64), + (:csyr2k_,:ComplexF32)) @eval begin # SUBROUTINE DSYR2K(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # @@ -1374,7 +1374,7 @@ function syr2k(uplo::Char, trans::Char, alpha::Number, A::StridedVecOrMat, B::St end syr2k(uplo::Char, trans::Char, A::StridedVecOrMat, B::StridedVecOrMat) = syr2k(uplo, trans, one(eltype(A)), A, B) -for (fname, elty1, elty2) in ((:zher2k_,:Complex128,:Float64), (:cher2k_,:Complex64,:Float32)) +for (fname, elty1, elty2) in ((:zher2k_,:ComplexF64,:Float64), (:cher2k_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE CHER2K(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC) # @@ -1461,8 +1461,8 @@ function trsm end for (mmname, smname, elty) in ((:dtrmm_,:dtrsm_,:Float64), (:strmm_,:strsm_,:Float32), - (:ztrmm_,:ztrsm_,:Complex128), - (:ctrmm_,:ctrsm_,:Complex64)) + (:ztrmm_,:ztrsm_,:ComplexF64), + (:ctrmm_,:ctrsm_,:ComplexF32)) @eval begin # SUBROUTINE DTRMM(SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB) # * .. Scalar Arguments .. diff --git a/base/linalg/lapack.jl b/base/linalg/lapack.jl index 3f19c4285d3ed..54a705caf18b6 100644 --- a/base/linalg/lapack.jl +++ b/base/linalg/lapack.jl @@ -108,8 +108,8 @@ end for (gbtrf, gbtrs, elty) in ((:dgbtrf_,:dgbtrs_,:Float64), (:sgbtrf_,:sgbtrs_,:Float32), - (:zgbtrf_,:zgbtrs_,:Complex128), - (:cgbtrf_,:cgbtrs_,:Complex64)) + (:zgbtrf_,:zgbtrs_,:ComplexF64), + (:cgbtrf_,:cgbtrs_,:ComplexF32)) @eval begin # SUBROUTINE DGBTRF( M, N, KL, KU, AB, LDAB, IPIV, INFO ) # * .. Scalar Arguments .. @@ -185,8 +185,8 @@ gbtrs!(trans::Char, kl::Integer, ku::Integer, m::Integer, AB::StridedMatrix, ipi for (gebal, gebak, elty, relty) in ((:dgebal_, :dgebak_, :Float64, :Float64), (:sgebal_, :sgebak_, :Float32, :Float32), - (:zgebal_, :zgebak_, :Complex128, :Float64), - (:cgebal_, :cgebak_, :Complex64, :Float32)) + (:zgebal_, :zgebak_, :ComplexF64, :Float64), + (:cgebal_, :cgebak_, :ComplexF32, :Float32)) @eval begin # SUBROUTINE DGEBAL( JOB, N, A, LDA, ILO, IHI, SCALE, INFO ) #* .. Scalar Arguments .. @@ -266,8 +266,8 @@ gebak!(job::Char, side::Char, ilo::BlasInt, ihi::BlasInt, scale::StridedVector, for (gebrd, gelqf, geqlf, geqrf, geqp3, geqrt, geqrt3, gerqf, getrf, elty, relty) in ((:dgebrd_,:dgelqf_,:dgeqlf_,:dgeqrf_,:dgeqp3_,:dgeqrt_,:dgeqrt3_,:dgerqf_,:dgetrf_,:Float64,:Float64), (:sgebrd_,:sgelqf_,:sgeqlf_,:sgeqrf_,:sgeqp3_,:sgeqrt_,:sgeqrt3_,:sgerqf_,:sgetrf_,:Float32,:Float32), - (:zgebrd_,:zgelqf_,:zgeqlf_,:zgeqrf_,:zgeqp3_,:zgeqrt_,:zgeqrt3_,:zgerqf_,:zgetrf_,:Complex128,:Float64), - (:cgebrd_,:cgelqf_,:cgeqlf_,:cgeqrf_,:cgeqp3_,:cgeqrt_,:cgeqrt3_,:cgerqf_,:cgetrf_,:Complex64,:Float32)) + (:zgebrd_,:zgelqf_,:zgeqlf_,:zgeqrf_,:zgeqp3_,:zgeqrt_,:zgeqrt3_,:zgerqf_,:zgetrf_,:ComplexF64,:Float64), + (:cgebrd_,:cgelqf_,:cgeqlf_,:cgeqrf_,:cgeqp3_,:cgeqrt_,:cgeqrt3_,:cgerqf_,:cgetrf_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE DGEBRD( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK, # INFO ) @@ -743,8 +743,8 @@ end for (tzrzf, ormrz, elty) in ((:dtzrzf_,:dormrz_,:Float64), (:stzrzf_,:sormrz_,:Float32), - (:ztzrzf_,:zunmrz_,:Complex128), - (:ctzrzf_,:cunmrz_,:Complex64)) + (:ztzrzf_,:zunmrz_,:ComplexF64), + (:ctzrzf_,:cunmrz_,:ComplexF32)) @eval begin # SUBROUTINE ZTZRZF( M, N, A, LDA, TAU, WORK, LWORK, INFO ) # @@ -846,8 +846,8 @@ tzrzf!(A::StridedMatrix) for (gels, gesv, getrs, getri, elty) in ((:dgels_,:dgesv_,:dgetrs_,:dgetri_,:Float64), (:sgels_,:sgesv_,:sgetrs_,:sgetri_,:Float32), - (:zgels_,:zgesv_,:zgetrs_,:zgetri_,:Complex128), - (:cgels_,:cgesv_,:cgetrs_,:cgetri_,:Complex64)) + (:zgels_,:zgesv_,:zgetrs_,:zgetri_,:ComplexF64), + (:cgels_,:cgesv_,:cgetrs_,:cgetri_,:ComplexF32)) @eval begin # SUBROUTINE DGELS( TRANS, M, N, NRHS, A, LDA, B, LDB, WORK, LWORK,INFO) # * .. Scalar Arguments .. @@ -1082,8 +1082,8 @@ for (gesvx, elty) in end end for (gesvx, elty, relty) in - ((:zgesvx_,:Complex128,:Float64), - (:cgesvx_,:Complex64 ,:Float32)) + ((:zgesvx_,:ComplexF64,:Float64), + (:cgesvx_,:ComplexF32 ,:Float32)) @eval begin # SUBROUTINE ZGESVX( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, # EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR, @@ -1279,8 +1279,8 @@ for (gelsd, gelsy, elty) in end for (gelsd, gelsy, elty, relty) in - ((:zgelsd_,:zgelsy_,:Complex128,:Float64), - (:cgelsd_,:cgelsy_,:Complex64,:Float32)) + ((:zgelsd_,:zgelsy_,:ComplexF64,:Float64), + (:cgelsd_,:cgelsy_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ZGELSD( M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, # $ WORK, LWORK, RWORK, IWORK, INFO ) @@ -1398,8 +1398,8 @@ gelsy!(A::StridedMatrix, B::StridedVecOrMat, rcond::Real) for (gglse, elty) in ((:dgglse_, :Float64), (:sgglse_, :Float32), - (:zgglse_, :Complex128), - (:cgglse_, :Complex64)) + (:zgglse_, :ComplexF64), + (:cgglse_, :ComplexF32)) @eval begin # SUBROUTINE DGGLSE( M, N, P, A, LDA, B, LDB, C, D, X, WORK, LWORK, # $ INFO ) @@ -1459,8 +1459,8 @@ gglse!(A::StridedMatrix, c::StridedVector, B::StridedMatrix, d::StridedVector) for (geev, gesvd, gesdd, ggsvd, elty, relty) in ((:dgeev_,:dgesvd_,:dgesdd_,:dggsvd_,:Float64,:Float64), (:sgeev_,:sgesvd_,:sgesdd_,:sggsvd_,:Float32,:Float32), - (:zgeev_,:zgesvd_,:zgesdd_,:zggsvd_,:Complex128,:Float64), - (:cgeev_,:cgesvd_,:cgesdd_,:cggsvd_,:Complex64,:Float32)) + (:zgeev_,:zgesvd_,:zgesdd_,:zggsvd_,:ComplexF64,:Float64), + (:cgeev_,:cgesvd_,:cgesdd_,:cggsvd_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE DGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, # $ LDVR, WORK, LWORK, INFO ) @@ -1849,8 +1849,8 @@ for (f, elty) in ((:dggsvd3_, :Float64), end end -for (f, elty, relty) in ((:zggsvd3_, :Complex128, :Float64), - (:cggsvd3_, :Complex64, :Float32)) +for (f, elty, relty) in ((:zggsvd3_, :ComplexF64, :Float64), + (:cggsvd3_, :ComplexF32, :Float32)) @eval begin function ggsvd3!(jobu::Char, jobv::Char, jobq::Char, A::StridedMatrix{$elty}, B::StridedMatrix{$elty}) chkstride1(A, B) @@ -2073,8 +2073,8 @@ for (geevx, ggev, elty) in end for (geevx, ggev, elty, relty) in - ((:zgeevx_,:zggev_,:Complex128,:Float64), - (:cgeevx_,:cggev_,:Complex64,:Float32)) + ((:zgeevx_,:zggev_,:ComplexF64,:Float64), + (:cgeevx_,:cggev_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ZGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, # LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, @@ -2281,8 +2281,8 @@ for (laic1, elty) in end end for (laic1, elty, relty) in - ((:zlaic1_,:Complex128,:Float64), - (:claic1_,:Complex64,:Float32)) + ((:zlaic1_,:ComplexF64,:Float64), + (:claic1_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ZLAIC1( JOB, J, X, SEST, W, GAMMA, SESTPR, S, C ) # @@ -2318,8 +2318,8 @@ end for (gtsv, gttrf, gttrs, elty) in ((:dgtsv_,:dgttrf_,:dgttrs_,:Float64), (:sgtsv_,:sgttrf_,:sgttrs_,:Float32), - (:zgtsv_,:zgttrf_,:zgttrs_,:Complex128), - (:cgtsv_,:cgttrf_,:cgttrs_,:Complex64)) + (:zgtsv_,:zgttrf_,:zgttrs_,:ComplexF64), + (:cgtsv_,:cgttrf_,:cgttrs_,:ComplexF32)) @eval begin # SUBROUTINE DGTSV( N, NRHS, DL, D, DU, B, LDB, INFO ) # .. Scalar Arguments .. @@ -2447,8 +2447,8 @@ gttrs!(trans::Char, dl::StridedVector, d::StridedVector, du::StridedVector, du2: for (orglq, orgqr, orgql, orgrq, ormlq, ormqr, ormql, ormrq, gemqrt, elty) in ((:dorglq_,:dorgqr_,:dorgql_,:dorgrq_,:dormlq_,:dormqr_,:dormql_,:dormrq_,:dgemqrt_,:Float64), (:sorglq_,:sorgqr_,:sorgql_,:sorgrq_,:sormlq_,:sormqr_,:sormql_,:sormrq_,:sgemqrt_,:Float32), - (:zunglq_,:zungqr_,:zungql_,:zungrq_,:zunmlq_,:zunmqr_,:zunmql_,:zunmrq_,:zgemqrt_,:Complex128), - (:cunglq_,:cungqr_,:cungql_,:cungrq_,:cunmlq_,:cunmqr_,:cunmql_,:cunmrq_,:cgemqrt_,:Complex64)) + (:zunglq_,:zungqr_,:zungql_,:zungrq_,:zunmlq_,:zunmqr_,:zunmql_,:zunmrq_,:zgemqrt_,:ComplexF64), + (:cunglq_,:cungqr_,:cungql_,:cungrq_,:cunmlq_,:cunmqr_,:cunmql_,:cunmrq_,:cgemqrt_,:ComplexF32)) @eval begin # SUBROUTINE DORGLQ( M, N, K, A, LDA, TAU, WORK, LWORK, INFO ) # * .. Scalar Arguments .. @@ -2917,8 +2917,8 @@ gemqrt!(side::Char, trans::Char, V::StridedMatrix, T::StridedMatrix, C::StridedV for (posv, potrf, potri, potrs, pstrf, elty, rtyp) in ((:dposv_,:dpotrf_,:dpotri_,:dpotrs_,:dpstrf_,:Float64,:Float64), (:sposv_,:spotrf_,:spotri_,:spotrs_,:spstrf_,:Float32,:Float32), - (:zposv_,:zpotrf_,:zpotri_,:zpotrs_,:zpstrf_,:Complex128,:Float64), - (:cposv_,:cpotrf_,:cpotri_,:cpotrs_,:cpstrf_,:Complex64,:Float32)) + (:zposv_,:zpotrf_,:zpotri_,:zpotrs_,:zpstrf_,:ComplexF64,:Float64), + (:cposv_,:cpotrf_,:cpotri_,:cpotrs_,:cpstrf_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE DPOSV( UPLO, N, NRHS, A, LDA, B, LDB, INFO ) #* .. Scalar Arguments .. @@ -3101,8 +3101,8 @@ pstrf!(uplo::Char, A::StridedMatrix, tol::Real) for (ptsv, pttrf, elty, relty) in ((:dptsv_,:dpttrf_,:Float64,:Float64), (:sptsv_,:spttrf_,:Float32,:Float32), - (:zptsv_,:zpttrf_,:Complex128,:Float64), - (:cptsv_,:cpttrf_,:Complex64,:Float32)) + (:zptsv_,:zpttrf_,:ComplexF64,:Float64), + (:cptsv_,:cpttrf_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE DPTSV( N, NRHS, D, E, B, LDB, INFO ) # .. Scalar Arguments .. @@ -3196,8 +3196,8 @@ for (pttrs, elty, relty) in end for (pttrs, elty, relty) in - ((:zpttrs_,:Complex128,:Float64), - (:cpttrs_,:Complex64,:Float32)) + ((:zpttrs_,:ComplexF64,:Float64), + (:cpttrs_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ZPTTRS( UPLO, N, NRHS, D, E, B, LDB, INFO ) # * .. Scalar Arguments .. @@ -3241,8 +3241,8 @@ pttrs!(D::StridedVector, E::StridedVector, B::StridedVecOrMat) for (trtri, trtrs, elty) in ((:dtrtri_,:dtrtrs_,:Float64), (:strtri_,:strtrs_,:Float32), - (:ztrtri_,:ztrtrs_,:Complex128), - (:ctrtri_,:ctrtrs_,:Complex64)) + (:ztrtri_,:ztrtrs_,:ComplexF64), + (:ctrtri_,:ctrtrs_,:ComplexF32)) @eval begin # SUBROUTINE DTRTRI( UPLO, DIAG, N, A, LDA, INFO ) #* .. Scalar Arguments .. @@ -3444,8 +3444,8 @@ for (trcon, trevc, trrfs, elty) in end for (trcon, trevc, trrfs, elty, relty) in - ((:ztrcon_,:ztrevc_,:ztrrfs_,:Complex128,:Float64), - (:ctrcon_,:ctrevc_,:ctrrfs_,:Complex64, :Float32)) + ((:ztrcon_,:ztrevc_,:ztrrfs_,:ComplexF64,:Float64), + (:ctrcon_,:ctrevc_,:ctrrfs_,:ComplexF32, :Float32)) @eval begin # SUBROUTINE ZTRCON( NORM, UPLO, DIAG, N, A, LDA, RCOND, WORK, # RWORK, INFO ) @@ -3616,8 +3616,8 @@ trrfs!(uplo::Char, trans::Char, diag::Char, A::StridedMatrix, B::StridedVecOrMat for (stev, stebz, stegr, stein, elty) in ((:dstev_,:dstebz_,:dstegr_,:dstein_,:Float64), (:sstev_,:sstebz_,:sstegr_,:sstein_,:Float32) -# , (:zstev_,:Complex128) Need to rewrite for ZHEEV, rwork, etc. -# , (:cstev_,:Complex64) +# , (:zstev_,:ComplexF64) Need to rewrite for ZHEEV, rwork, etc. +# , (:cstev_,:ComplexF32) ) @eval begin function stev!(job::Char, dv::StridedVector{$elty}, ev::StridedVector{$elty}) @@ -4153,8 +4153,8 @@ end ## (SY) hermitian matrices - eigendecomposition, Bunch-Kaufman decomposition, ## solvers (direct and factored) and inverse. for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in - ((:zsyconv_,:zhesv_,:zhetrf_,:zhetri_,:zhetrs_,:Complex128, :Float64), - (:csyconv_,:chesv_,:chetrf_,:chetri_,:chetrs_,:Complex64, :Float32)) + ((:zsyconv_,:zhesv_,:zhetrf_,:zhetri_,:zhetrs_,:ComplexF64, :Float64), + (:csyconv_,:chesv_,:chetrf_,:chetri_,:chetrs_,:ComplexF32, :Float32)) @eval begin # SUBROUTINE ZSYCONV( UPLO, WAY, N, A, LDA, IPIV, WORK, INFO ) # @@ -4322,8 +4322,8 @@ for (syconv, hesv, hetrf, hetri, hetrs, elty, relty) in end for (hesv, hetrf, hetri, hetrs, elty, relty) in - ((:zhesv_rook_,:zhetrf_rook_,:zhetri_rook_,:zhetrs_rook_,:Complex128, :Float64), - (:chesv_rook_,:chetrf_rook_,:chetri_rook_,:chetrs_rook_,:Complex64, :Float32)) + ((:zhesv_rook_,:zhetrf_rook_,:zhetri_rook_,:zhetrs_rook_,:ComplexF64, :Float64), + (:chesv_rook_,:chetrf_rook_,:chetri_rook_,:chetrs_rook_,:ComplexF32, :Float32)) @eval begin # SUBROUTINE ZHESV_ROOK( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, # * .. Scalar Arguments .. @@ -4438,8 +4438,8 @@ for (hesv, hetrf, hetri, hetrs, elty, relty) in end for (sysv, sytrf, sytri, sytrs, elty, relty) in - ((:zsysv_,:zsytrf_,:zsytri_,:zsytrs_,:Complex128, :Float64), - (:csysv_,:csytrf_,:csytri_,:csytrs_,:Complex64, :Float32)) + ((:zsysv_,:zsytrf_,:zsytri_,:zsytrs_,:ComplexF64, :Float64), + (:csysv_,:csytrf_,:csytri_,:csytrs_,:ComplexF32, :Float32)) @eval begin # SUBROUTINE ZSYSV( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, # $ LWORK, INFO ) @@ -4589,8 +4589,8 @@ for (sysv, sytrf, sytri, sytrs, elty, relty) in end for (sysv, sytrf, sytri, sytrs, syconvf, elty, relty) in - ((:zsysv_rook_,:zsytrf_rook_,:zsytri_rook_,:zsytrs_rook_,:zsyconvf_rook_,:Complex128, :Float64), - (:csysv_rook_,:csytrf_rook_,:csytri_rook_,:csytrs_rook_,:csyconvf_rook_,:Complex64, :Float32)) + ((:zsysv_rook_,:zsytrf_rook_,:zsytri_rook_,:zsytrs_rook_,:zsyconvf_rook_,:ComplexF64, :Float64), + (:csysv_rook_,:csytrf_rook_,:csytri_rook_,:csytrs_rook_,:csyconvf_rook_,:ComplexF32, :Float32)) @eval begin # SUBROUTINE ZSYSV_ROOK(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, # $ LWORK, INFO ) @@ -4995,8 +4995,8 @@ for (syev, syevr, sygvd, elty) in end # Hermitian eigensolvers for (syev, syevr, sygvd, elty, relty) in - ((:zheev_,:zheevr_,:zhegvd_,:Complex128,:Float64), - (:cheev_,:cheevr_,:chegvd_,:Complex64,:Float32)) + ((:zheev_,:zheevr_,:zhegvd_,:ComplexF64,:Float64), + (:cheev_,:cheevr_,:chegvd_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ZHEEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, INFO ) # * .. Scalar Arguments .. @@ -5193,8 +5193,8 @@ sygvd!(itype::Integer, jobz::Char, uplo::Char, A::StridedMatrix, B::StridedMatri for (bdsqr, relty, elty) in ((:dbdsqr_,:Float64,:Float64), (:sbdsqr_,:Float32,:Float32), - (:zbdsqr_,:Float64,:Complex128), - (:cbdsqr_,:Float32,:Complex64)) + (:zbdsqr_,:Float64,:ComplexF64), + (:cbdsqr_,:Float32,:ComplexF32)) @eval begin function bdsqr!(uplo::Char, d::StridedVector{$relty}, e_::StridedVector{$relty}, Vt::StridedMatrix{$elty}, U::StridedMatrix{$elty}, C::StridedMatrix{$elty}) @@ -5356,8 +5356,8 @@ for (gecon, elty) in end for (gecon, elty, relty) in - ((:zgecon_,:Complex128,:Float64), - (:cgecon_,:Complex64, :Float32)) + ((:zgecon_,:ComplexF64,:Float64), + (:cgecon_,:ComplexF32,:Float32)) @eval begin # SUBROUTINE ZGECON( NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK, # $ INFO ) @@ -5402,8 +5402,8 @@ gecon!(normtype::Char, A::StridedMatrix, anorm) for (gehrd, elty) in ((:dgehrd_,:Float64), (:sgehrd_,:Float32), - (:zgehrd_,:Complex128), - (:cgehrd_,:Complex64)) + (:zgehrd_,:ComplexF64), + (:cgehrd_,:ComplexF32)) @eval begin # .. Scalar Arguments .. @@ -5452,8 +5452,8 @@ gehrd!(ilo::Integer, ihi::Integer, A::StridedMatrix) for (orghr, elty) in ((:dorghr_,:Float64), (:sorghr_,:Float32), - (:zunghr_,:Complex128), - (:cunghr_,:Complex64)) + (:zunghr_,:ComplexF64), + (:cunghr_,:ComplexF32)) @eval begin # * .. Scalar Arguments .. # INTEGER IHI, ILO, INFO, LDA, LWORK, N @@ -5499,8 +5499,8 @@ orghr!(ilo::Integer, ihi::Integer, A::StridedMatrix, tau::StridedVector) for (ormhr, elty) in ((:dormhr_,:Float64), (:sormhr_,:Float32), - (:zunmhr_,:Complex128), - (:cunmhr_,:Complex64)) + (:zunmhr_,:ComplexF64), + (:cunmhr_,:ComplexF32)) @eval begin # .. Scalar Arguments .. # CHARACTER side, trans @@ -5640,8 +5640,8 @@ for (gees, gges, elty) in end for (gees, gges, elty, relty) in - ((:zgees_,:zgges_,:Complex128,:Float64), - (:cgees_,:cgges_,:Complex64,:Float32)) + ((:zgees_,:zgges_,:ComplexF64,:Float64), + (:cgees_,:cgges_,:ComplexF32,:Float32)) @eval begin # * .. Scalar Arguments .. # CHARACTER JOBVS, SORT @@ -5911,8 +5911,8 @@ for (trexc, trsen, tgsen, elty) in end for (trexc, trsen, tgsen, elty, relty) in - ((:ztrexc_, :ztrsen_, :ztgsen_, :Complex128, :Float64), - (:ctrexc_, :ctrsen_, :ctgsen_, :Complex64, :Float32)) + ((:ztrexc_, :ztrsen_, :ztgsen_, :ComplexF64, :Float64), + (:ctrexc_, :ctrsen_, :ctgsen_, :ComplexF32, :Float32)) @eval begin # .. Scalar Arguments .. # CHARACTER COMPQ @@ -6091,8 +6091,8 @@ tgsen!(select::StridedVector{BlasInt}, S::StridedMatrix, T::StridedMatrix, Q::St for (fn, elty, relty) in ((:dtrsyl_, :Float64, :Float64), (:strsyl_, :Float32, :Float32), - (:ztrsyl_, :Complex128, :Float64), - (:ctrsyl_, :Complex64, :Float32)) + (:ztrsyl_, :ComplexF64, :Float64), + (:ctrsyl_, :ComplexF32, :Float32)) @eval begin function trsyl!(transa::Char, transb::Char, A::StridedMatrix{$elty}, B::StridedMatrix{$elty}, C::StridedMatrix{$elty}, isgn::Int=1) diff --git a/base/linalg/linalg.jl b/base/linalg/linalg.jl index 8c21dd2076191..cf926063bdb1b 100644 --- a/base/linalg/linalg.jl +++ b/base/linalg/linalg.jl @@ -200,9 +200,9 @@ export # Constants I -const BlasFloat = Union{Float64,Float32,Complex128,Complex64} +const BlasFloat = Union{Float64,Float32,ComplexF64,ComplexF32} const BlasReal = Union{Float64,Float32} -const BlasComplex = Union{Complex128,Complex64} +const BlasComplex = Union{ComplexF64,ComplexF32} if USE_BLAS64 const BlasInt = Int64 diff --git a/base/linalg/qr.jl b/base/linalg/qr.jl index db28f03980f52..0d9027d5ca0d9 100644 --- a/base/linalg/qr.jl +++ b/base/linalg/qr.jl @@ -252,7 +252,7 @@ The returned object `F` stores the factorization in a packed format: - if `pivot == Val(true)` then `F` is a [`QRPivoted`](@ref) object, - otherwise if the element type of `A` is a BLAS type ([`Float32`](@ref), [`Float64`](@ref), - `Complex64` or `Complex128`), then `F` is a [`QRCompactWY`](@ref) object, + `ComplexF32` or `ComplexF64`), then `F` is a [`QRCompactWY`](@ref) object, - otherwise `F` is a [`QR`](@ref) object. diff --git a/base/math.jl b/base/math.jl index 068dd5d0e0ffa..5c14f49624338 100644 --- a/base/math.jl +++ b/base/math.jl @@ -969,7 +969,7 @@ for func in (:sin,:cos,:tan,:asin,:acos,:atan,:sinh,:cosh,:tanh,:asinh,:acosh, :atanh,:exp,:exp2,:exp10,:log,:log2,:log10,:sqrt,:lgamma,:log1p) @eval begin $func(a::Float16) = Float16($func(Float32(a))) - $func(a::Complex32) = Complex32($func(Complex64(a))) + $func(a::ComplexF16) = ComplexF16($func(ComplexF32(a))) end end diff --git a/base/random/normal.jl b/base/random/normal.jl index e09ca1ec8952d..d1d6540be6d6c 100644 --- a/base/random/normal.jl +++ b/base/random/normal.jl @@ -24,10 +24,10 @@ from the circularly symmetric complex normal distribution. ```jldoctest julia> rng = MersenneTwister(1234); -julia> randn(rng, Complex128) +julia> randn(rng, ComplexF64) 0.6133070881429037 - 0.6376291670853887im -julia> randn(rng, Complex64, (2, 3)) +julia> randn(rng, ComplexF32, (2, 3)) 2×3 Array{Complex{Float32},2}: -0.349649-0.638457im 0.376756-0.192146im -0.396334-0.0136413im 0.611224+1.56403im 0.355204-0.365563im 0.0905552+1.31012im diff --git a/doc/src/manual/calling-c-and-fortran-code.md b/doc/src/manual/calling-c-and-fortran-code.md index a0ef7744c4b06..ce7bbb2889b06 100644 --- a/doc/src/manual/calling-c-and-fortran-code.md +++ b/doc/src/manual/calling-c-and-fortran-code.md @@ -275,7 +275,7 @@ First, a review of some relevant Julia type terminology: | | | "TypeVar" :: The `T` in the type parameter declaration is referred to as a TypeVar (short for type variable). | | `primitive type` | `Int`, `Float64` | "Primitive Type" :: A type with no fields, but a size. It is stored and defined by-value. | | `struct` | `Pair{Int, Int}` | "Struct" :: A type with all fields defined to be constant. It is defined by-value, and may be stored with a type-tag. | -| | `Complex128` (`isbits`) | "Is-Bits" :: A `primitive type`, or a `struct` type where all fields are other `isbits` types. It is defined by-value, and is stored without a type-tag. | +| | `ComplexF64` (`isbits`) | "Is-Bits" :: A `primitive type`, or a `struct` type where all fields are other `isbits` types. It is defined by-value, and is stored without a type-tag. | | `struct ...; end` | `nothing` | "Singleton" :: a Leaf Type or Struct with no fields. | | `(...)` or `tuple(...)` | `(1, 2, 3)` | "Tuple" :: an immutable data-structure similar to an anonymous struct type, or a constant array. Represented as either an array or a struct. | @@ -292,11 +292,11 @@ same: Exactly corresponds to the `double` type in C (or `REAL*8` in Fortran). - * `Complex64` + * `ComplexF32` Exactly corresponds to the `complex float` type in C (or `COMPLEX*8` in Fortran). - * `Complex128` + * `ComplexF64` Exactly corresponds to the `complex double` type in C (or `COMPLEX*16` in Fortran). @@ -350,8 +350,8 @@ an `Int` in Julia). | `uintmax_t` |   | `Cuintmax_t` | `UInt64` | | `float` | `REAL*4i` | `Cfloat` | `Float32` | | `double` | `REAL*8` | `Cdouble` | `Float64` | -| `complex float` | `COMPLEX*8` | `Complex64` | `Complex{Float32}` | -| `complex double` | `COMPLEX*16` | `Complex128` | `Complex{Float64}` | +| `complex float` | `COMPLEX*8` | `ComplexF32` | `Complex{Float32}` | +| `complex double` | `COMPLEX*16` | `ComplexF64` | `Complex{Float64}` | | `ptrdiff_t` |   | `Cptrdiff_t` | `Int` | | `ssize_t` |   | `Cssize_t` | `Int` | | `size_t` |   | `Csize_t` | `UInt` | diff --git a/doc/src/stdlib/linalg.md b/doc/src/stdlib/linalg.md index 977b5f6f3240d..571a039e30753 100644 --- a/doc/src/stdlib/linalg.md +++ b/doc/src/stdlib/linalg.md @@ -187,7 +187,7 @@ linear algebra routines it is useful to call the BLAS functions directly. `Base.LinAlg.BLAS` provides wrappers for some of the BLAS functions. Those BLAS functions that overwrite one of the input arrays have names ending in `'!'`. Usually, a BLAS function has -four methods defined, for [`Float64`](@ref), [`Float32`](@ref), `Complex128`, and `Complex64` arrays. +four methods defined, for [`Float64`](@ref), [`Float32`](@ref), `ComplexF64`, and `ComplexF32` arrays. ### [BLAS Character Arguments](@id stdlib-blas-chars) Many BLAS functions accept arguments that determine whether to transpose an argument (`trans`), @@ -272,7 +272,7 @@ Base.LinAlg.I Those functions that overwrite one of the input arrays have names ending in `'!'`. Usually a function has 4 methods defined, one each for [`Float64`](@ref), [`Float32`](@ref), -`Complex128` and `Complex64` arrays. +`ComplexF64` and `ComplexF32` arrays. Note that the LAPACK API provided by Julia can and will change in the future. Since this API is not user-facing, there is no commitment to support/deprecate this specific set of functions in diff --git a/src/abi_win32.cpp b/src/abi_win32.cpp index 9f64a0a0df8fc..af16a0310b124 100644 --- a/src/abi_win32.cpp +++ b/src/abi_win32.cpp @@ -42,7 +42,7 @@ struct ABI_Win32Layout : AbiLayout { bool use_sret(jl_datatype_t *dt) override { // Use sret if the size of the argument is not one of 1, 2, 4, 8 bytes - // This covers the special case of Complex64 + // This covers the special case of ComplexF32 size_t size = jl_datatype_size(dt); if (size == 1 || size == 2 || size == 4 || size == 8) return false; diff --git a/src/common_symbols2.inc b/src/common_symbols2.inc index 9fd6d0c8aac4c..f1da5896034aa 100644 --- a/src/common_symbols2.inc +++ b/src/common_symbols2.inc @@ -36,8 +36,8 @@ jl_symbol("name"), jl_symbol("<="), jl_symbol("or_int"), jl_symbol("similar"), -jl_symbol("Complex64"), -jl_symbol("Complex128"), +jl_symbol("ComplexF32"), +jl_symbol("ComplexF64"), jl_symbol("isempty"), jl_symbol("#print_to_string#227"), jl_symbol("pointer"), diff --git a/stdlib/IterativeEigenSolvers/src/arpack.jl b/stdlib/IterativeEigenSolvers/src/arpack.jl index 1aceb7b4b6e26..33e3686806ec3 100644 --- a/stdlib/IterativeEigenSolvers/src/arpack.jl +++ b/stdlib/IterativeEigenSolvers/src/arpack.jl @@ -255,8 +255,8 @@ for (T, saupd_name, seupd_name, naupd_name, neupd_name) in end for (T, TR, naupd_name, neupd_name) in - ((:Complex128, :Float64, :znaupd_, :zneupd_), - (:Complex64, :Float32, :cnaupd_, :cneupd_)) + ((:ComplexF64, :Float64, :znaupd_, :zneupd_), + (:ComplexF32, :Float32, :cnaupd_, :cneupd_)) @eval begin function naupd(ido, bmat, n, evtype, nev, TOL::Ref{$TR}, resid::Vector{$T}, ncv, v::Matrix{$T}, ldv, iparam, ipntr, workd::Vector{$T}, workl::Vector{$T}, lworkl, diff --git a/stdlib/IterativeEigenSolvers/test/runtests.jl b/stdlib/IterativeEigenSolvers/test/runtests.jl index 52b8e197a7079..d98dab458d87a 100644 --- a/stdlib/IterativeEigenSolvers/test/runtests.jl +++ b/stdlib/IterativeEigenSolvers/test/runtests.jl @@ -13,8 +13,8 @@ using Test testtol = 1e-6 - @testset for elty in (Float64, Complex128) - if elty == Complex64 || elty == Complex128 + @testset for elty in (Float64, ComplexF64) + if elty == ComplexF32 || elty == ComplexF64 a = acmplx b = bcmplx else @@ -90,7 +90,7 @@ using Test if elty == Float64 @test_throws ArgumentError eigs(a+a.',which=:SI) @test_throws ArgumentError eigs(a+a.',which=:LI) - @test_throws ArgumentError eigs(a,sigma=rand(Complex64)) + @test_throws ArgumentError eigs(a,sigma=rand(ComplexF32)) end end end diff --git a/stdlib/SharedArrays/test/runtests.jl b/stdlib/SharedArrays/test/runtests.jl index b42ecc61bc57f..965516e68a3be 100644 --- a/stdlib/SharedArrays/test/runtests.jl +++ b/stdlib/SharedArrays/test/runtests.jl @@ -186,7 +186,7 @@ d = SharedArrays.shmem_fill(1.0, dims) # similar d = SharedArrays.shmem_rand(dims) -@test size(similar(d, Complex128)) == dims +@test size(similar(d, ComplexF64)) == dims @test size(similar(d, dims)) == dims # issue #6362 diff --git a/stdlib/SuiteSparse/src/cholmod.jl b/stdlib/SuiteSparse/src/cholmod.jl index 10835150145b9..20257c927dea5 100644 --- a/stdlib/SuiteSparse/src/cholmod.jl +++ b/stdlib/SuiteSparse/src/cholmod.jl @@ -702,7 +702,7 @@ function sdmult!(A::Sparse{Tv}, transpose::Bool, end @isok ccall((@cholmod_name("sdmult", SuiteSparse_long),:libcholmod), Cint, (Ptr{C_Sparse{Tv}}, Cint, - Ref{Complex128}, Ref{Complex128}, + Ref{ComplexF64}, Ref{ComplexF64}, Ptr{C_Dense{Tv}}, Ptr{C_Dense{Tv}}, Ptr{UInt8}), A, transpose, α, β, X, Y, common_struct) Y @@ -756,7 +756,7 @@ function factorize_p!(A::Sparse{Tv}, β::Real, F::Factor{Tv}, cmmn::Vector{UInt8 # note that β is passed as a complex number (double beta[2]), # but the CHOLMOD manual says that only beta[0] (real part) is used @isok ccall((@cholmod_name("factorize_p", SuiteSparse_long),:libcholmod), Cint, - (Ptr{C_Sparse{Tv}}, Ref{Complex128}, Ptr{SuiteSparse_long}, Csize_t, + (Ptr{C_Sparse{Tv}}, Ref{ComplexF64}, Ptr{SuiteSparse_long}, Csize_t, Ptr{C_Factor{Tv}}, Ptr{UInt8}), A, β, C_NULL, 0, F, cmmn) F @@ -1379,7 +1379,7 @@ See also [`cholfact`](@ref). !!! note This method uses the CHOLMOD library from SuiteSparse, which only supports doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{Complex128}` + be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. """ cholfact!(F::Factor, A::Union{SparseMatrixCSC{T}, @@ -1432,7 +1432,7 @@ it should be a permutation of `1:size(A,1)` giving the ordering to use !!! note This method uses the CHOLMOD library from SuiteSparse, which only supports doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{Complex128}` + be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. Many other functions from CHOLMOD are wrapped but not exported from the @@ -1471,7 +1471,7 @@ See also [`ldltfact`](@ref). !!! note This method uses the CHOLMOD library from SuiteSparse, which only supports doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{Complex128}` + be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. """ ldltfact!(F::Factor, A::Union{SparseMatrixCSC{T}, @@ -1530,7 +1530,7 @@ it should be a permutation of `1:size(A,1)` giving the ordering to use !!! note This method uses the CHOLMOD library from SuiteSparse, which only supports doubles or complex doubles. Input matrices not of those element types will - be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{Complex128}` + be converted to `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. Many other functions from CHOLMOD are wrapped but not exported from the diff --git a/stdlib/SuiteSparse/src/cholmod_h.jl b/stdlib/SuiteSparse/src/cholmod_h.jl index ef772bb2f1cef..bd249e2fe5bb3 100644 --- a/stdlib/SuiteSparse/src/cholmod_h.jl +++ b/stdlib/SuiteSparse/src/cholmod_h.jl @@ -16,8 +16,8 @@ const DOUBLE = Int32(0) # all numerical values are double const SINGLE = Int32(1) # all numerical values are float dtyp(::Type{Float32}) = SINGLE dtyp(::Type{Float64}) = DOUBLE -dtyp(::Type{Complex64}) = SINGLE -dtyp(::Type{Complex128}) = DOUBLE +dtyp(::Type{ComplexF32}) = SINGLE +dtyp(::Type{ComplexF64}) = DOUBLE ## xtype defines the kind of numerical values used: const PATTERN = Int32(0) # pattern only, no numerical values @@ -26,8 +26,8 @@ const COMPLEX = Int32(2) # a complex matrix (ANSI C99 compatible) const ZOMPLEX = Int32(3) # a complex matrix (MATLAB compatible) xtyp(::Type{Float32}) = REAL xtyp(::Type{Float64}) = REAL -xtyp(::Type{Complex64}) = COMPLEX -xtyp(::Type{Complex128}) = COMPLEX +xtyp(::Type{ComplexF32}) = COMPLEX +xtyp(::Type{ComplexF64}) = COMPLEX ## Scaling modes, selected by the scale input parameter: const SCALAR = Int32(0) # A = s*A @@ -67,7 +67,7 @@ else const ITypes = Union{Int32, Int64} end -const VTypes = Union{Complex128, Float64} +const VTypes = Union{ComplexF64, Float64} const VRealTypes = Union{Float64} struct CHOLMODException <: Exception diff --git a/stdlib/SuiteSparse/src/umfpack.jl b/stdlib/SuiteSparse/src/umfpack.jl index 0749ddcf2f3f9..cd54d8ff6be75 100644 --- a/stdlib/SuiteSparse/src/umfpack.jl +++ b/stdlib/SuiteSparse/src/umfpack.jl @@ -69,7 +69,7 @@ else const UMFITypes = Union{Int32, Int64} end -const UMFVTypes = Union{Float64,Complex128} +const UMFVTypes = Union{Float64,ComplexF64} ## UMFPACK @@ -110,7 +110,7 @@ end Compute the LU factorization of a sparse matrix `A`. For sparse `A` with real or complex element type, the return type of `F` is -`UmfpackLU{Tv, Ti}`, with `Tv` = [`Float64`](@ref) or `Complex128` respectively and +`UmfpackLU{Tv, Ti}`, with `Tv` = [`Float64`](@ref) or `ComplexF64` respectively and `Ti` is an integer type ([`Int32`](@ref) or [`Int64`](@ref)). The individual components of the factorization `F` can be accessed by indexing: @@ -137,8 +137,8 @@ The relation between `F` and `A` is !!! note `lufact(A::SparseMatrixCSC)` uses the UMFPACK library that is part of SuiteSparse. As this library only supports sparse matrices with [`Float64`](@ref) or - `Complex128` elements, `lufact` converts `A` into a copy that is of type - `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{Complex128}` as appropriate. + `ComplexF64` elements, `lufact` converts `A` into a copy that is of type + `SparseMatrixCSC{Float64}` or `SparseMatrixCSC{ComplexF64}` as appropriate. """ function lufact(S::SparseMatrixCSC{<:UMFVTypes,<:UMFITypes}) zerobased = S.colptr[1] == 0 @@ -151,11 +151,11 @@ function lufact(S::SparseMatrixCSC{<:UMFVTypes,<:UMFITypes}) end lufact(A::SparseMatrixCSC{<:Union{Float16,Float32},Ti}) where {Ti<:UMFITypes} = lufact(convert(SparseMatrixCSC{Float64,Ti}, A)) -lufact(A::SparseMatrixCSC{<:Union{Complex32,Complex64},Ti}) where {Ti<:UMFITypes} = - lufact(convert(SparseMatrixCSC{Complex128,Ti}, A)) +lufact(A::SparseMatrixCSC{<:Union{ComplexF16,ComplexF32},Ti}) where {Ti<:UMFITypes} = + lufact(convert(SparseMatrixCSC{ComplexF64,Ti}, A)) lufact(A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}}}) where {T<:AbstractFloat} = throw(ArgumentError(string("matrix type ", typeof(A), "not supported. ", - "Try lufact(convert(SparseMatrixCSC{Float64/Complex128,Int}, A)) for ", + "Try lufact(convert(SparseMatrixCSC{Float64/ComplexF64,Int}, A)) for ", "sparse floating point LU using UMFPACK or lufact(Array(A)) for generic ", "dense LU."))) lufact(A::SparseMatrixCSC) = lufact(float(A)) @@ -186,17 +186,17 @@ umf_nm(nm,Tv,Ti) = "umfpack_" * (Tv == :Float64 ? "d" : "z") * (Ti == :Int64 ? " for itype in UmfpackIndexTypes sym_r = umf_nm("symbolic", :Float64, itype) - sym_c = umf_nm("symbolic", :Complex128, itype) + sym_c = umf_nm("symbolic", :ComplexF64, itype) num_r = umf_nm("numeric", :Float64, itype) - num_c = umf_nm("numeric", :Complex128, itype) + num_c = umf_nm("numeric", :ComplexF64, itype) sol_r = umf_nm("solve", :Float64, itype) - sol_c = umf_nm("solve", :Complex128, itype) + sol_c = umf_nm("solve", :ComplexF64, itype) det_r = umf_nm("get_determinant", :Float64, itype) - det_z = umf_nm("get_determinant", :Complex128, itype) + det_z = umf_nm("get_determinant", :ComplexF64, itype) lunz_r = umf_nm("get_lunz", :Float64, itype) - lunz_z = umf_nm("get_lunz", :Complex128, itype) + lunz_z = umf_nm("get_lunz", :ComplexF64, itype) get_num_r = umf_nm("get_numeric", :Float64, itype) - get_num_z = umf_nm("get_numeric", :Complex128, itype) + get_num_z = umf_nm("get_numeric", :ComplexF64, itype) @eval begin function umfpack_symbolic!(U::UmfpackLU{Float64,$itype}) if U.symbolic != C_NULL return U end @@ -209,7 +209,7 @@ for itype in UmfpackIndexTypes U.symbolic = tmp[1] return U end - function umfpack_symbolic!(U::UmfpackLU{Complex128,$itype}) + function umfpack_symbolic!(U::UmfpackLU{ComplexF64,$itype}) if U.symbolic != C_NULL return U end tmp = Vector{Ptr{Void}}(uninitialized, 1) @isok ccall(($sym_c, :libumfpack), $itype, @@ -235,7 +235,7 @@ for itype in UmfpackIndexTypes U.numeric = tmp[1] return U end - function umfpack_numeric!(U::UmfpackLU{Complex128,$itype}) + function umfpack_numeric!(U::UmfpackLU{ComplexF64,$itype}) if U.numeric != C_NULL return U end if U.symbolic == C_NULL umfpack_symbolic!(U) end tmp = Vector{Ptr{Void}}(uninitialized, 1) @@ -268,7 +268,7 @@ for itype in UmfpackIndexTypes umf_info) return x end - function solve!(x::StridedVector{Complex128}, lu::UmfpackLU{Complex128,$itype}, b::StridedVector{Complex128}, typ::Integer) + function solve!(x::StridedVector{ComplexF64}, lu::UmfpackLU{ComplexF64,$itype}, b::StridedVector{ComplexF64}, typ::Integer) if x === b throw(ArgumentError("output array must not be aliased with input array")) end @@ -294,7 +294,7 @@ for itype in UmfpackIndexTypes mx, C_NULL, lu.numeric, umf_info) mx[] end - function det(lu::UmfpackLU{Complex128,$itype}) + function det(lu::UmfpackLU{ComplexF64,$itype}) mx = Ref{Float64}() mz = Ref{Float64}() @isok ccall(($det_z,:libumfpack), $itype, @@ -313,7 +313,7 @@ for itype in UmfpackIndexTypes lnz, unz, n_row, n_col, nz_diag, lu.numeric) (lnz[], unz[], n_row[], n_col[], nz_diag[]) end - function umf_lunz(lu::UmfpackLU{Complex128,$itype}) + function umf_lunz(lu::UmfpackLU{ComplexF64,$itype}) lnz = Ref{$itype}() unz = Ref{$itype}() n_row = Ref{$itype}() @@ -349,7 +349,7 @@ for itype in UmfpackIndexTypes SparseMatrixCSC(min(n_row, n_col), n_col, increment!(Up), increment!(Ui), Ux), increment!(P), increment!(Q), Rs) end - function umf_extract(lu::UmfpackLU{Complex128,$itype}) + function umf_extract(lu::UmfpackLU{ComplexF64,$itype}) umfpack_numeric!(lu) # ensure the numeric decomposition exists (lnz, unz, n_row, n_col, nz_diag) = umf_lunz(lu) Lp = Vector{$itype}(uninitialized, n_row + 1) @@ -466,7 +466,7 @@ function getindex(lu::UmfpackLU, d::Symbol) end end -for Tv in (:Float64, :Complex128), Ti in UmfpackIndexTypes +for Tv in (:Float64, :ComplexF64), Ti in UmfpackIndexTypes f = Symbol(umf_nm("free_symbolic", Tv, Ti)) @eval begin function ($f)(symb::Ptr{Void}) diff --git a/stdlib/SuiteSparse/test/umfpack.jl b/stdlib/SuiteSparse/test/umfpack.jl index 5f3b1a0c6c5fc..4982e4abc7db8 100644 --- a/stdlib/SuiteSparse/test/umfpack.jl +++ b/stdlib/SuiteSparse/test/umfpack.jl @@ -14,7 +14,7 @@ increment!([0,4,0,2,1,2,1,4,3,2,1,2]), [2.,1.,3.,4.,-1.,-3.,3.,6.,2.,1.,4.,2.], 5, 5) - @testset "Core functionality for $Tv elements" for Tv in (Float64, Complex128) + @testset "Core functionality for $Tv elements" for Tv in (Float64, ComplexF64) # We might be able to support two index sizes one day for Ti in Base.uniontypes(SuiteSparse.UMFPACK.UMFITypes) A = convert(SparseMatrixCSC{Tv,Ti}, A0) @@ -75,7 +75,7 @@ @testset "More tests for complex cases" begin Ac0 = complex.(A0,A0) for Ti in Base.uniontypes(SuiteSparse.UMFPACK.UMFITypes) - Ac = convert(SparseMatrixCSC{Complex128,Ti}, Ac0) + Ac = convert(SparseMatrixCSC{ComplexF64,Ti}, Ac0) x = complex.(ones(size(Ac, 1)), ones(size(Ac,1))) lua = lufact(Ac) L,U,p,q,Rs = lua[:(:)] @@ -89,7 +89,7 @@ end end - @testset "Rectangular cases" for elty in (Float64, Complex128) + @testset "Rectangular cases" for elty in (Float64, ComplexF64) for (m, n) in ((10,5), (5, 10)) A = sparse([1:min(m,n); rand(1:m, 10)], [1:min(m,n); rand(1:n, 10)], elty == Float64 ? randn(min(m, n) + 10) : complex.(randn(min(m, n) + 10), randn(min(m, n) + 10))) F = lufact(A) @@ -110,9 +110,9 @@ end @testset "Issue #15099" for (Tin, Tout) in ( - (Complex32, Complex128), - (Complex64, Complex128), - (Complex128, Complex128), + (ComplexF16, ComplexF64), + (ComplexF32, ComplexF64), + (ComplexF64, ComplexF64), (Float16, Float64), (Float32, Float64), (Float64, Float64), diff --git a/test/bitarray.jl b/test/bitarray.jl index 58bf60159588a..366e37d9f15b7 100644 --- a/test/bitarray.jl +++ b/test/bitarray.jl @@ -857,7 +857,7 @@ timesofar("unary arithmetic") for (x1,t1) = [(f1, Float64), (ci1, Complex{Int}), (cu1, Complex{UInt8}), - (cf1, Complex128)] + (cf1, ComplexF64)] @check_bit_operation broadcast(+, x1, b2) Matrix{t1} @check_bit_operation broadcast(-, x1, b2) Matrix{t1} @check_bit_operation broadcast(*, x1, b2) Matrix{t1} @@ -883,9 +883,9 @@ timesofar("unary arithmetic") @check_bit_operation broadcast(div, f1, b2) Matrix{Float64} @check_bit_operation broadcast(mod, f1, b2) Matrix{Float64} - @check_bit_operation broadcast(/, ci1, b2) Matrix{Complex128} - @check_bit_operation broadcast(/, cu1, b2) Matrix{Complex128} - @check_bit_operation broadcast(/, cf1, b2) Matrix{Complex128} + @check_bit_operation broadcast(/, ci1, b2) Matrix{ComplexF64} + @check_bit_operation broadcast(/, cu1, b2) Matrix{ComplexF64} + @check_bit_operation broadcast(/, cf1, b2) Matrix{ComplexF64} b2 = bitrand(n1, n2) @check_bit_operation broadcast(^, false, b2) BitMatrix @@ -897,8 +897,8 @@ timesofar("unary arithmetic") @check_bit_operation broadcast(^, 1, b2) Matrix{Int} @check_bit_operation broadcast(^, 0.0, b2) Matrix{Float64} @check_bit_operation broadcast(^, 1.0, b2) Matrix{Float64} - @check_bit_operation broadcast(^, 0.0im, b2) Matrix{Complex128} - @check_bit_operation broadcast(^, 1.0im, b2) Matrix{Complex128} + @check_bit_operation broadcast(^, 0.0im, b2) Matrix{ComplexF64} + @check_bit_operation broadcast(^, 1.0im, b2) Matrix{ComplexF64} @check_bit_operation broadcast(^, 0im, b2) Matrix{Complex{Int}} @check_bit_operation broadcast(^, 1im, b2) Matrix{Complex{Int}} @check_bit_operation broadcast(^, 0x0*im, b2) Matrix{Complex{UInt8}} @@ -976,17 +976,17 @@ timesofar("unary arithmetic") @check_bit_operation broadcast(+, b1, ci2) Matrix{Complex{Int}} @check_bit_operation broadcast(-, b1, ci2) Matrix{Complex{Int}} @check_bit_operation broadcast(*, b1, ci2) Matrix{Complex{Int}} - @check_bit_operation broadcast(/, b1, ci2) Matrix{Complex128} + @check_bit_operation broadcast(/, b1, ci2) Matrix{ComplexF64} @check_bit_operation broadcast(+, b1, cu2) Matrix{Complex{UInt8}} @check_bit_operation broadcast(-, b1, cu2) Matrix{Complex{UInt8}} @check_bit_operation broadcast(*, b1, cu2) Matrix{Complex{UInt8}} - @check_bit_operation broadcast(/, b1, cu2) Matrix{Complex128} + @check_bit_operation broadcast(/, b1, cu2) Matrix{ComplexF64} - @check_bit_operation broadcast(+, b1, cf2) Matrix{Complex128} - @check_bit_operation broadcast(-, b1, cf2) Matrix{Complex128} - @check_bit_operation broadcast(*, b1, cf2) Matrix{Complex128} - @check_bit_operation broadcast(/, b1, cf2) Matrix{Complex128} + @check_bit_operation broadcast(+, b1, cf2) Matrix{ComplexF64} + @check_bit_operation broadcast(-, b1, cf2) Matrix{ComplexF64} + @check_bit_operation broadcast(*, b1, cf2) Matrix{ComplexF64} + @check_bit_operation broadcast(/, b1, cf2) Matrix{ComplexF64} @check_bit_operation broadcast(^, b1, false) BitMatrix @check_bit_operation broadcast(^, b1, true) BitMatrix @@ -997,17 +997,17 @@ timesofar("unary arithmetic") @check_bit_operation broadcast(^, b1, -1.0) Matrix{Float64} @check_bit_operation broadcast(^, b1, 0.0) Matrix{Float64} @check_bit_operation broadcast(^, b1, 1.0) Matrix{Float64} - @check_bit_operation broadcast(^, b1, 0.0im) Matrix{Complex128} - @check_bit_operation broadcast(^, b1, 0x0*im) Matrix{Complex128} - @check_bit_operation broadcast(^, b1, 0im) Matrix{Complex128} + @check_bit_operation broadcast(^, b1, 0.0im) Matrix{ComplexF64} + @check_bit_operation broadcast(^, b1, 0x0*im) Matrix{ComplexF64} + @check_bit_operation broadcast(^, b1, 0im) Matrix{ComplexF64} @test_throws DomainError broadcast(^, b1, -1) b1 = trues(n1, n2) - @check_bit_operation broadcast(^, b1, -1.0im) Matrix{Complex128} - @check_bit_operation broadcast(^, b1, 1.0im) Matrix{Complex128} - @check_bit_operation broadcast(^, b1, -1im) Matrix{Complex128} - @check_bit_operation broadcast(^, b1, 1im) Matrix{Complex128} - @check_bit_operation broadcast(^, b1, 0x1*im) Matrix{Complex128} + @check_bit_operation broadcast(^, b1, -1.0im) Matrix{ComplexF64} + @check_bit_operation broadcast(^, b1, 1.0im) Matrix{ComplexF64} + @check_bit_operation broadcast(^, b1, -1im) Matrix{ComplexF64} + @check_bit_operation broadcast(^, b1, 1im) Matrix{ComplexF64} + @check_bit_operation broadcast(^, b1, 0x1*im) Matrix{ComplexF64} end end diff --git a/test/ccall.jl b/test/ccall.jl index 1b243b1dba6fd..b750b42e4416a 100644 --- a/test/ccall.jl +++ b/test/ccall.jl @@ -90,12 +90,12 @@ end let a, b, x a = 2.84 + 5.2im - x = ccall((:cgtest, libccalltest), Complex128, (Complex128,), a) + x = ccall((:cgtest, libccalltest), ComplexF64, (ComplexF64,), a) @test x == a + 1 - 2im b = [a] # Make sure the array is alive during unsafe_load - x = unsafe_load(ccall((:cgptest, libccalltest), Ptr{Complex128}, (Ptr{Complex128},), b)) + x = unsafe_load(ccall((:cgptest, libccalltest), Ptr{ComplexF64}, (Ptr{ComplexF64},), b)) @test x == a + 1 - 2im @test a == 2.84 + 5.2im @@ -104,12 +104,12 @@ end let a, b, x a = 3.34f0 + 53.2f0im - x = ccall((:cftest, libccalltest), Complex64, (Complex64,), a) + x = ccall((:cftest, libccalltest), ComplexF32, (ComplexF32,), a) @test x == a + 1 - 2im b = [a] # Make sure the array is alive during unsafe_load - x = unsafe_load(ccall((:cfptest, libccalltest), Ptr{Complex64}, (Ptr{Complex64},), b)) + x = unsafe_load(ccall((:cfptest, libccalltest), Ptr{ComplexF32}, (Ptr{ComplexF32},), b)) @test x == a + 1 - 2im @test a == 3.34f0 + 53.2f0im @@ -405,10 +405,10 @@ test_struct10(Struct10) test_struct10(Struct10I) mutable struct Struct11 - x::Complex64 + x::ComplexF32 end struct Struct11I - x::Complex64 + x::ComplexF32 end function test_struct11(::Type{Struct}) where {Struct} @@ -427,12 +427,12 @@ test_struct11(Struct11) test_struct11(Struct11I) mutable struct Struct12 - x::Complex64 - y::Complex64 + x::ComplexF32 + y::ComplexF32 end struct Struct12I - x::Complex64 - y::Complex64 + x::ComplexF32 + y::ComplexF32 end function test_struct12(::Type{Struct}) where {Struct} @@ -452,10 +452,10 @@ test_struct12(Struct12) test_struct12(Struct12I) mutable struct Struct13 - x::Complex128 + x::ComplexF64 end struct Struct13I - x::Complex128 + x::ComplexF64 end function test_struct13(::Type{Struct}) where {Struct} @@ -761,7 +761,7 @@ s1 = Struct1(352.39422f23, 19.287577) ==(a::Struct1,b::Struct1) = a.x == b.x && a.y == b.y for (t,v) in ((Complex{Int32},:ci32),(Complex{Int64},:ci64), - (Complex64,:cf32),(Complex128,:cf64),(Struct1,:s1)) + (ComplexF32,:cf32),(ComplexF64,:cf64),(Struct1,:s1)) fname = Symbol("foo",v) fname1 = Symbol("foo1",v) @eval begin diff --git a/test/complex.jl b/test/complex.jl index e898c1b071c03..00014f3efc34a 100644 --- a/test/complex.jl +++ b/test/complex.jl @@ -906,12 +906,12 @@ end @test round(float(Complex(π, ℯ)),3) == Complex(3.142, 2.718) end -@testset "Complex32 arithmetic, PR #10003" begin - @test Float16(1)+Float16(1)im === Complex32(1, 1) - @test Float16(1)-Float16(1)im === Float16(1)+Float16(-1)im === Complex32(1, -1) - @test Float16(1)*im === Complex32(im) - @test Float16(1)/im === Complex32(0,-1) - @test Float16(1)^im === Complex32(1) === Float16(1)+Float16(0)im +@testset "ComplexF16 arithmetic, PR #10003" begin + @test Float16(1)+Float16(1)im === ComplexF16(1, 1) + @test Float16(1)-Float16(1)im === Float16(1)+Float16(-1)im === ComplexF16(1, -1) + @test Float16(1)*im === ComplexF16(im) + @test Float16(1)/im === ComplexF16(0,-1) + @test Float16(1)^im === ComplexF16(1) === Float16(1)+Float16(0)im end # issue/PR #10148 @@ -961,9 +961,9 @@ end @testset "expm1 type stability" begin x = @inferred expm1(0.1im) - @test x isa Complex128 + @test x isa ComplexF64 x = @inferred expm1(0.1f0im) - @test x isa Complex64 + @test x isa ComplexF32 end @testset "array printing with exponent format" begin diff --git a/test/fastmath.jl b/test/fastmath.jl index 274e3c794a8e3..b4b78a2c46a66 100644 --- a/test/fastmath.jl +++ b/test/fastmath.jl @@ -72,7 +72,7 @@ fm_fast_64_upd(x) = @fastmath (r=x; r+=eps64_2; r+=eps64_2) end end - for T in (Complex64, Complex128, Complex{BigFloat}) + for T in (ComplexF32, ComplexF64, Complex{BigFloat}) zero = convert(T,0) one = convert(T,1) + im*eps(real(convert(T,1))) two = convert(T,2) + im//10 @@ -139,7 +139,7 @@ end end end @testset "complex arithmetic" begin - for T in (Complex64, Complex128, Complex{BigFloat}) + for T in (ComplexF32, ComplexF64, Complex{BigFloat}) half = (1+1im)/T(2) third = (1-1im)/T(3) diff --git a/test/inference.jl b/test/inference.jl index ed63bbd32c677..471b14337b5e0 100644 --- a/test/inference.jl +++ b/test/inference.jl @@ -917,19 +917,19 @@ let f(x) = isdefined(x, 2) ? 1 : "" @test Base.return_types(f, (Tuple{Int,},)) == Any[String] end let f(x) = isdefined(x, :re) ? 1 : "" - @test Base.return_types(f, (Complex64,)) == Any[Int] + @test Base.return_types(f, (ComplexF32,)) == Any[Int] @test Base.return_types(f, (Complex,)) == Any[Int] end let f(x) = isdefined(x, :NonExistentField) ? 1 : "" - @test Base.return_types(f, (Complex64,)) == Any[String] + @test Base.return_types(f, (ComplexF32,)) == Any[String] @test Union{Int,String} <: Base.return_types(f, (AbstractArray,))[1] end import Core.Inference: isdefined_tfunc -@test isdefined_tfunc(Complex64, Const(())) === Union{} -@test isdefined_tfunc(Complex64, Const(1)) === Const(true) -@test isdefined_tfunc(Complex64, Const(2)) === Const(true) -@test isdefined_tfunc(Complex64, Const(3)) === Const(false) -@test isdefined_tfunc(Complex64, Const(0)) === Const(false) +@test isdefined_tfunc(ComplexF32, Const(())) === Union{} +@test isdefined_tfunc(ComplexF32, Const(1)) === Const(true) +@test isdefined_tfunc(ComplexF32, Const(2)) === Const(true) +@test isdefined_tfunc(ComplexF32, Const(3)) === Const(false) +@test isdefined_tfunc(ComplexF32, Const(0)) === Const(false) mutable struct SometimesDefined x function SometimesDefined() @@ -1128,7 +1128,7 @@ end push!(constvec, 10) @test @inferred(sizeof_constvec()) == sizeof(Int) * 4 -test_const_return((x)->isdefined(x, :re), Tuple{Complex128}, true) +test_const_return((x)->isdefined(x, :re), Tuple{ComplexF64}, true) isdefined_f3(x) = isdefined(x, 3) @test @inferred(isdefined_f3(())) == false @test find_call(first(code_typed(isdefined_f3, Tuple{Tuple{Vararg{Int}}})[1]).code, isdefined, 3) diff --git a/test/linalg/bidiag.jl b/test/linalg/bidiag.jl index 94c749d6531c2..27be3e5987753 100644 --- a/test/linalg/bidiag.jl +++ b/test/linalg/bidiag.jl @@ -160,7 +160,7 @@ srand(1) b += im*convert(Matrix{elty}, rand(1:10, n, 2)) end end - condT = cond(map(Complex128,Tfull)) + condT = cond(map(ComplexF64,Tfull)) promty = typeof((zero(relty)*zero(relty) + zero(relty)*zero(relty))/one(relty)) if relty != BigFloat x = T.'\c.' @@ -237,7 +237,7 @@ srand(1) @testset "Eigensystems" begin if relty <: AbstractFloat d1, v1 = eig(T) - d2, v2 = eig(map(elty<:Complex ? Complex128 : Float64,Tfull)) + d2, v2 = eig(map(elty<:Complex ? ComplexF64 : Float64,Tfull)) @test (uplo == :U ? d1 : reverse(d1)) ≈ d2 if elty <: Real Test.test_approx_eq_modphase(v1, uplo == :U ? v2 : v2[:,n:-1:1]) diff --git a/test/linalg/blas.jl b/test/linalg/blas.jl index ef8bb83e7f395..752e896cf3ff3 100644 --- a/test/linalg/blas.jl +++ b/test/linalg/blas.jl @@ -4,11 +4,11 @@ import Base.LinAlg, Base.LinAlg.BlasReal, Base.LinAlg.BlasComplex srand(100) ## BLAS tests - testing the interface code to BLAS routines -@testset for elty in [Float32, Float64, Complex64, Complex128] +@testset for elty in [Float32, Float64, ComplexF32, ComplexF64] @testset "syr2k!" begin U = randn(5,2) V = randn(5,2) - if elty == Complex64 || elty == Complex128 + if elty == ComplexF32 || elty == ComplexF64 U = complex.(U, U) V = complex.(V, V) end @@ -20,7 +20,7 @@ srand(100) @test triu(LinAlg.BLAS.syr2k('U','T',U,V)) ≈ triu(U.'*V + V.'*U) end - if elty in (Complex64, Complex128) + if elty in (ComplexF32, ComplexF64) @testset "her2k!" begin U = randn(5,2) V = randn(5,2) diff --git a/test/linalg/bunchkaufman.jl b/test/linalg/bunchkaufman.jl index 0e9b866918b4e..4d24e6dbbcf07 100644 --- a/test/linalg/bunchkaufman.jl +++ b/test/linalg/bunchkaufman.jl @@ -19,7 +19,7 @@ a2img = randn(n,n)/2 breal = randn(n,2)/2 bimg = randn(n,2)/2 -@testset "$eltya argument A" for eltya in (Float32, Float64, Complex64, Complex128, Int) +@testset "$eltya argument A" for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int) a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) asym = a.'+ a # symmetric indefinite @@ -71,7 +71,7 @@ bimg = randn(n,2)/2 end end - @testset "$eltyb argument B" for eltyb in (Float32, Float64, Complex64, Complex128, Int) + @testset "$eltyb argument B" for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int) b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal) for b in (b, view(b, 1:n, 1:2)) εb = eps(abs(float(one(eltyb)))) @@ -130,7 +130,7 @@ end @testset "test example due to @timholy in PR 15354" begin A = rand(6,5); A = complex(A'*A) # to avoid calling the real-lhs-complex-rhs method F = cholfact(A); - v6 = rand(Complex128, 6) + v6 = rand(ComplexF64, 6) v5 = view(v6, 1:5) @test F\v5 == F\v6[1:5] end diff --git a/test/linalg/cholesky.jl b/test/linalg/cholesky.jl index 8c77fb4cefe55..09d56e19f8037 100644 --- a/test/linalg/cholesky.jl +++ b/test/linalg/cholesky.jl @@ -46,7 +46,7 @@ end breal = randn(n,2)/2 bimg = randn(n,2)/2 - for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int) + for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int) a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) @@ -73,7 +73,7 @@ end #Test error bound on reconstruction of matrix: LAWNS 14, Lemma 2.1 #these tests were failing on 64-bit linux when inside the inner loop - #for eltya = Complex64 and eltyb = Int. The E[i,j] had NaN32 elements + #for eltya = ComplexF32 and eltyb = Int. The E[i,j] had NaN32 elements #but only with srand(1234321) set before the loops. E = abs.(apd - r'*r) for i=1:n, j=1:n @@ -138,7 +138,7 @@ end @test cpapd[:P]*cpapd[:L]*cpapd[:U]*cpapd[:P]' ≈ apd end - for eltyb in (Float32, Float64, Complex64, Complex128, Int) + for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int) b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal) εb = eps(abs(float(one(eltyb)))) ε = max(εa,εb) @@ -253,7 +253,7 @@ end cholfact(Hermitian(apd, :L), Val(true)) \ b r = factorize(apd)[:U] E = abs.(apd - r'*r) - ε = eps(abs(float(one(Complex64)))) + ε = eps(abs(float(one(ComplexF32)))) n = 10 for i=1:n, j=1:n @test E[i,j] <= (n+1)ε/(1-(n+1)ε)*real(sqrt(apd[i,i]*apd[j,j])) diff --git a/test/linalg/dense.jl b/test/linalg/dense.jl index 83b4e4450ab2d..d5a2101321fc3 100644 --- a/test/linalg/dense.jl +++ b/test/linalg/dense.jl @@ -18,7 +18,7 @@ srand(1234321) @testset "Matrix condition number" begin ainit = rand(n,n) - @testset "for $elty" for elty in (Float32, Float64, Complex64, Complex128) + @testset "for $elty" for elty in (Float32, Float64, ComplexF32, ComplexF64) ainit = convert(Matrix{elty}, ainit) for a in (copy(ainit), view(ainit, 1:n, 1:n)) @test cond(a,1) ≈ 4.837320054554436e+02 atol=0.01 @@ -37,7 +37,7 @@ a2img = randn(n,n)/2 breal = randn(n,2)/2 bimg = randn(n,2)/2 -@testset "For A containing $eltya" for eltya in (Float32, Float64, Complex64, Complex128, Int) +@testset "For A containing $eltya" for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int) ainit = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) ainit2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) ε = εa = eps(abs(float(one(eltya)))) @@ -51,7 +51,7 @@ bimg = randn(n,2)/2 @test isposdef!(copy(apd)) end end - @testset "For b containing $eltyb" for eltyb in (Float32, Float64, Complex64, Complex128, Int) + @testset "For b containing $eltyb" for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int) binit = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal) εb = eps(abs(float(one(eltyb)))) ε = max(εa,εb) @@ -347,7 +347,7 @@ end end @testset "Matrix exponential" begin - @testset "Tests for $elty" for elty in (Float32, Float64, Complex64, Complex128) + @testset "Tests for $elty" for elty in (Float32, Float64, ComplexF32, ComplexF64) A1 = convert(Matrix{elty}, [4 2 0; 1 4 1; 1 1 4]) eA1 = convert(Matrix{elty}, [147.866622446369 127.781085523181 127.781085523182; 183.765138646367 183.765138646366 163.679601723179; @@ -415,7 +415,7 @@ end end @testset "Matrix trigonometry" begin - @testset "Tests for $elty" for elty in (Float32, Float64, Complex64, Complex128) + @testset "Tests for $elty" for elty in (Float32, Float64, ComplexF32, ComplexF64) A1 = convert(Matrix{elty}, [3 2 0; 1 3 1; 1 1 3]) A2 = convert(Matrix{elty}, [3.975884257819758 0.15631501695814318 -0.4579038628067864; @@ -484,7 +484,7 @@ end end end - @testset "Additional tests for $elty" for elty in (Complex64, Complex128) + @testset "Additional tests for $elty" for elty in (ComplexF32, ComplexF64) A5 = convert(Matrix{elty}, [1im 2; 0.02+0.5im 3]) @test sincos(A5) == (sin(A5), cos(A5)) @@ -746,7 +746,7 @@ end @testset "Least squares solutions" begin a = [ones(20) 1:20 1:20] b = reshape(Matrix(1.0I, 8, 5), 20, 2) - @testset "Tests for type $elty" for elty in (Float32, Float64, Complex64, Complex128) + @testset "Tests for type $elty" for elty in (Float32, Float64, ComplexF32, ComplexF64) a = convert(Matrix{elty}, a) b = convert(Matrix{elty}, b) @@ -788,7 +788,7 @@ function test_div_pinv_consistency(a, b) end @testset "/ and \\ consistency with pinv for vectors" begin - @testset "Tests for type $elty" for elty in (Float32, Float64, Complex64, Complex128) + @testset "Tests for type $elty" for elty in (Float32, Float64, ComplexF32, ComplexF64) c = rand(elty, 5) r = rand(elty, 5)' cm = rand(elty, 5, 1) @@ -811,7 +811,7 @@ end end end -@testset "test ops on Numbers for $elty" for elty in [Float32,Float64,Complex64,Complex128] +@testset "test ops on Numbers for $elty" for elty in [Float32,Float64,ComplexF32,ComplexF64] a = rand(elty) @test isposdef(one(elty)) @test lyap(one(elty),a) == -a/2 diff --git a/test/linalg/diagonal.jl b/test/linalg/diagonal.jl index 289f5f1228c33..014f89bbbf251 100644 --- a/test/linalg/diagonal.jl +++ b/test/linalg/diagonal.jl @@ -30,8 +30,8 @@ srand(1) @testset "Basic properties" begin @test_throws ArgumentError size(D,0) - @test typeof(convert(Diagonal{Complex64},D)) <: Diagonal{Complex64} - @test typeof(convert(AbstractMatrix{Complex64},D)) <: Diagonal{Complex64} + @test typeof(convert(Diagonal{ComplexF32},D)) <: Diagonal{ComplexF32} + @test typeof(convert(AbstractMatrix{ComplexF32},D)) <: Diagonal{ComplexF32} @test Array(real(D)) == real(DM) @test Array(abs.(D)) == abs.(DM) @@ -389,7 +389,7 @@ end end @testset "multiplication with Symmetric/Hermitian" begin - for T in (Float64, Complex128) + for T in (Float64, ComplexF64) D = Diagonal(randn(T, n)) A = randn(T, n, n); A = A'A S = Symmetric(A) diff --git a/test/linalg/eigen.jl b/test/linalg/eigen.jl index e2edaf8acd5e5..a5c224f9f1489 100644 --- a/test/linalg/eigen.jl +++ b/test/linalg/eigen.jl @@ -15,7 +15,7 @@ srand(1234321) areal = randn(n,n)/2 aimg = randn(n,n)/2 -@testset for eltya in (Float32, Float64, Complex64, Complex128, Int) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int) aa = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) asym = aa'+aa # symmetric indefinite apd = aa'*aa # symmetric positive-definite diff --git a/test/linalg/generic.jl b/test/linalg/generic.jl index a53168789395e..638a3c8d88478 100644 --- a/test/linalg/generic.jl +++ b/test/linalg/generic.jl @@ -244,7 +244,7 @@ end @test q\qmat ≉ qmat/q end @testset "ops on Numbers" begin - @testset for elty in [Float32,Float64,Complex64,Complex128] + @testset for elty in [Float32,Float64,ComplexF32,ComplexF64] a = rand(elty) @test trace(a) == a @test rank(zero(elty)) == 0 @@ -336,7 +336,7 @@ end @testset "Issue 19035" begin @test Base.LinAlg.promote_leaf_eltypes([1, 2, [3.0, 4.0]]) == Float64 - @test Base.LinAlg.promote_leaf_eltypes([[1,2, [3,4]], 5.0, [6im, [7.0, 8.0]]]) == Complex128 + @test Base.LinAlg.promote_leaf_eltypes([[1,2, [3,4]], 5.0, [6im, [7.0, 8.0]]]) == ComplexF64 @test [1, 2, 3] ≈ [1, 2, 3] @test [[1, 2], [3, 4]] ≈ [[1, 2], [3, 4]] @test [[1, 2], [3, 4]] ≈ [[1.0-eps(), 2.0+eps()], [3.0+2eps(), 4.0-1e8eps()]] diff --git a/test/linalg/givens.jl b/test/linalg/givens.jl index 355eab97c69ef..daa7ef1723318 100644 --- a/test/linalg/givens.jl +++ b/test/linalg/givens.jl @@ -4,7 +4,7 @@ using Test using Base.LinAlg: mul!, Adjoint, Transpose # Test givens rotations -@testset for elty in (Float32, Float64, Complex64, Complex128) +@testset for elty in (Float32, Float64, ComplexF32, ComplexF64) if elty <: Real raw_A = convert(Matrix{elty}, randn(10,10)) else diff --git a/test/linalg/hessenberg.jl b/test/linalg/hessenberg.jl index fad8036024e29..6f0ff890f4ff2 100644 --- a/test/linalg/hessenberg.jl +++ b/test/linalg/hessenberg.jl @@ -10,7 +10,7 @@ let n = 10 Areal = randn(n,n)/2 Aimg = randn(n,n)/2 - @testset for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int) + @testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int) A = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? diff --git a/test/linalg/lapack.jl b/test/linalg/lapack.jl index dd82179febb15..889841935671a 100644 --- a/test/linalg/lapack.jl +++ b/test/linalg/lapack.jl @@ -12,8 +12,8 @@ import Base.LinAlg.BlasInt @testset "syevr" begin guardsrand(123) do Ainit = randn(5,5) - @testset for elty in (Float32, Float64, Complex64, Complex128) - if elty == Complex64 || elty == Complex128 + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) + if elty == ComplexF32 || elty == ComplexF64 A = complex.(Ainit, Ainit) else A = Ainit @@ -34,7 +34,7 @@ end @testset "gglse" begin let - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = convert(Array{elty, 2}, [1 1 1 1; 1 3 1 1; 1 -1 3 1; 1 1 1 3; 1 1 1 -1]) c = convert(Array{elty, 1}, [2, 1, 6, 3, 1]) B = convert(Array{elty, 2}, [1 1 1 -1; 1 -1 1 1; 1 1 -1 1]) @@ -80,7 +80,7 @@ end end @testset "geqrt(3)" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) B = copy(A) C,T = LAPACK.geqrt!(A,zeros(elty,10,10)) @@ -90,7 +90,7 @@ end end @testset "gbtrf and gbtrs" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) d = rand(elty,6) dl = rand(elty,5) du = rand(elty,5) @@ -113,7 +113,7 @@ end @testset "geqp3, geqrt error handling" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) @test_throws DimensionMismatch LAPACK.geqlf!(A,zeros(elty,11)) @test_throws DimensionMismatch LAPACK.gelqf!(A,zeros(elty,11)) @@ -128,7 +128,7 @@ end end @testset "gels, gesv, getrs, getri error handling" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) B = rand(elty,11,11) @test_throws DimensionMismatch LAPACK.gels!('N',A,B) @@ -141,7 +141,7 @@ end end @testset "gelsy, gelsd" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) B = rand(elty,10,10) C, j = LAPACK.gelsd!(copy(A),copy(B)) @@ -153,7 +153,7 @@ end end @testset "gglse errors" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) @test_throws DimensionMismatch LAPACK.gglse!(A,zeros(elty,10),rand(elty,12,11),zeros(elty,12)) @test_throws DimensionMismatch LAPACK.gglse!(A,zeros(elty,11),rand(elty,10,10),zeros(elty,10)) @@ -162,7 +162,7 @@ end end @testset "gesvd, ggsvd" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,5) U,S,V = svd(A) lU,lS,lVt = LAPACK.gesvd!('S','S',A) @@ -180,7 +180,7 @@ end end @testset "geevx, ggev errors" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) B = rand(elty,10,10) @test_throws ArgumentError LAPACK.geevx!('M','N','N','N',A) @@ -194,7 +194,7 @@ end end @testset "gebal/gebak" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) * Diagonal(exp10.(linspace(-10,10,10))) B = copy(A) ilo, ihi, scale = LAPACK.gebal!('S',B) @@ -206,7 +206,7 @@ end end @testset "gels" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) guardsrand(913) do A = rand(elty,10,10) X = rand(elty,10) @@ -217,7 +217,7 @@ end end @testset "getrf/getri" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) iA = inv(A) A, ipiv = LAPACK.getrf!(A) @@ -228,7 +228,7 @@ end @testset "geev" begin # complex is easier for now - @testset for elty in (Complex64, Complex128) + @testset for elty in (ComplexF32, ComplexF64) A = rand(elty,10,10) Aw, Avl, Avr = LAPACK.geev!('N','V',copy(A)) fA = eigfact(A) @@ -238,7 +238,7 @@ end end @testset "gtsv" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) du = rand(elty,9) d = rand(elty,10) dl = rand(elty,9) @@ -254,7 +254,7 @@ end end @testset "gttrs,gttrf errors" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) du = rand(elty,9) d = rand(elty,10) dl = rand(elty,9) @@ -274,7 +274,7 @@ end end @testset "orglq and friends errors" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) A,tau = LAPACK.gelqf!(A) @test_throws DimensionMismatch LAPACK.orglq!(A,tau,11) @@ -352,7 +352,7 @@ end end @testset "sytri, sytrs, and sytrf" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) A = A + A.' #symmetric! B = copy(A) @@ -363,7 +363,7 @@ end end # Rook-pivoting variants - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) A = A + A.' #symmetric! B = copy(A) @@ -390,7 +390,7 @@ end end @testset "hetrf, hetrs" begin - @testset for elty in (Complex64, Complex128) + @testset for elty in (ComplexF32, ComplexF64) A = rand(elty,10,10) A = A + A' #hermitian! B = copy(A) @@ -413,7 +413,7 @@ end end @testset "trtri & trtrs" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) A = triu(A) B = copy(A) @@ -423,7 +423,7 @@ end end @testset "tgsen, tzrzf, & trsyl" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) Z = zeros(elty,10,10) @test_throws DimensionMismatch LAPACK.tgsen!(zeros(BlasInt,10),Z,zeros(elty,11,11),Z,Z) @test_throws DimensionMismatch LAPACK.tgsen!(zeros(BlasInt,10),Z,Z,zeros(elty,11,11),Z) @@ -434,7 +434,7 @@ end end @testset "sysv" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) guardsrand(123) do A = rand(elty,10,10) A = A + A.' #symmetric! @@ -448,7 +448,7 @@ end end @testset "hesv" begin - @testset for elty in (Complex64, Complex128) + @testset for elty in (ComplexF32, ComplexF64) guardsrand(935) do A = rand(elty,10,10) A = A + A' #hermitian! @@ -469,7 +469,7 @@ end end @testset "ptsv" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) dv = ones(elty,10) ev = zeros(elty,9) rdv = real(dv) @@ -486,7 +486,7 @@ end end @testset "pttrf and pttrs" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) dv = ones(elty,10) ev = zeros(elty,9) rdv = real(dv) @@ -511,7 +511,7 @@ end end @testset "posv and some errors for friends" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10)/100 A += real(diagm(0 => 10*real(rand(elty,10)))) if elty <: Complex @@ -532,7 +532,7 @@ end end @testset "gesvx" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) B = rand(elty,10,5) C = copy(A) @@ -543,7 +543,7 @@ end end @testset "gees, gges error throwing" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) A = rand(elty,10,10) B = rand(elty,11,11) @test_throws DimensionMismatch LAPACK.gges!('V','V',A,B) @@ -551,7 +551,7 @@ end end @testset "trrfs & trevc" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) T = triu(rand(elty,10,10)) S = copy(T) select = zeros(Base.LinAlg.BlasInt,10) @@ -572,13 +572,13 @@ end end @testset "laic1" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) @test_throws DimensionMismatch LAPACK.laic1!(1,rand(elty,10),real(rand(elty)),rand(elty,11),rand(elty)) end end @testset "trsen" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) for job in ('N', 'E', 'V', 'B') for c in ('V', 'N') A = convert(Matrix{elty}, [7 2 2 1; 1 5 2 0; 0 3 9 4; 1 1 1 4]) @@ -605,7 +605,7 @@ end end @testset "trexc" begin - @testset for elty in (Float32, Float64, Complex64, Complex128) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64) for c in ('V', 'N') A = convert(Matrix{elty}, [7 2 2 1; 1 5 2 0; 0 3 9 4; 1 1 1 4]) T,Q,d = schur(A) diff --git a/test/linalg/lq.jl b/test/linalg/lq.jl index 37211bab29a51..7371e47e55d80 100644 --- a/test/linalg/lq.jl +++ b/test/linalg/lq.jl @@ -24,14 +24,14 @@ bimg = randn(n,2)/2 squareQ(Q::LinAlg.LQPackedQ) = (n = size(Q.factors, 2); mul!(Q, Matrix{eltype(Q)}(I, n, n))) rectangularQ(Q::LinAlg.LQPackedQ) = convert(Array, Q) -@testset for eltya in (Float32, Float64, Complex64, Complex128) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64) a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) asym = a'+a # symmetric indefinite apd = a'*a # symmetric positive-definite ε = εa = eps(abs(float(one(eltya)))) - @testset for eltyb in (Float32, Float64, Complex64, Complex128, Int) + @testset for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int) b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal) εb = eps(abs(float(one(eltyb)))) ε = max(εa,εb) diff --git a/test/linalg/lu.jl b/test/linalg/lu.jl index e396fff01d95e..da0949491a32d 100644 --- a/test/linalg/lu.jl +++ b/test/linalg/lu.jl @@ -25,7 +25,7 @@ dlimg = randn(n-1)/2 dreal = randn(n)/2 dimg = randn(n)/2 -@testset for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int) a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) d = if eltya == Int @@ -93,7 +93,7 @@ dimg = randn(n)/2 @test lud[:L]*lud[:U] ≈ Array(d)[lud[:p],:] @test AbstractArray(lud) ≈ d end - @testset for eltyb in (Float32, Float64, Complex64, Complex128, Int) + @testset for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int) b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal) c = eltyb == Int ? rand(1:5, n) : @@ -236,7 +236,7 @@ end end @testset "logdet" begin - @test @inferred(logdet(Complex64[1.0f0 0.5f0; 0.5f0 -1.0f0])) === 0.22314355f0 + 3.1415927f0im + @test @inferred(logdet(ComplexF32[1.0f0 0.5f0; 0.5f0 -1.0f0])) === 0.22314355f0 + 3.1415927f0im @test_throws DomainError logdet([1 1; 1 -1]) end diff --git a/test/linalg/matmul.jl b/test/linalg/matmul.jl index 429d05810401b..1a019db76a7af 100644 --- a/test/linalg/matmul.jl +++ b/test/linalg/matmul.jl @@ -16,8 +16,8 @@ using Base.LinAlg: mul!, Adjoint, Transpose @test ones(0,0)*ones(0,0) == zeros(0,0) @test Matrix{Float64}(uninitialized, 5, 0) |> t -> t't == zeros(0,0) @test Matrix{Float64}(uninitialized, 5, 0) |> t -> t*t' == zeros(5,5) - @test Matrix{Complex128}(uninitialized, 5, 0) |> t -> t't == zeros(0,0) - @test Matrix{Complex128}(uninitialized, 5, 0) |> t -> t*t' == zeros(5,5) + @test Matrix{ComplexF64}(uninitialized, 5, 0) |> t -> t't == zeros(0,0) + @test Matrix{ComplexF64}(uninitialized, 5, 0) |> t -> t*t' == zeros(5,5) end @testset "2x2 matmul" begin AA = [1 2; 3 4] @@ -167,7 +167,7 @@ end @test mul!(sC, Transpose(A), B) == A'*B Aim = A .- im - C = zeros(Complex128,8,8) + C = zeros(ComplexF64,8,8) sC = view(C, 1:2:8, 1:2:8) B = reshape(map(Float64,-9:10),5,4) .+ im @test mul!(sC, Adjoint(Aim), Aim) == Aim'*Aim @@ -215,7 +215,7 @@ end # issue #6450 @test dot(Any[1.0,2.0], Any[3.5,4.5]) === 12.5 -@testset "dot" for elty in (Float32, Float64, Complex64, Complex128) +@testset "dot" for elty in (Float32, Float64, ComplexF32, ComplexF64) x = convert(Vector{elty},[1.0, 2.0, 3.0]) y = convert(Vector{elty},[3.5, 4.5, 5.5]) @test_throws DimensionMismatch dot(x, 1:2, y, 1:3) @@ -262,7 +262,7 @@ end @test_throws ArgumentError Base.LinAlg.copytri!(ones(10,10),'Z') -@testset "gemv! and gemm_wrapper for $elty" for elty in [Float32,Float64,Complex128,Complex64] +@testset "gemv! and gemm_wrapper for $elty" for elty in [Float32,Float64,ComplexF64,ComplexF32] @test_throws DimensionMismatch Base.LinAlg.gemv!(ones(elty,10),'N',rand(elty,10,10),ones(elty,11)) @test_throws DimensionMismatch Base.LinAlg.gemv!(ones(elty,11),'N',rand(elty,10,10),ones(elty,10)) @test Base.LinAlg.gemv!(ones(elty,0),'N',rand(elty,0,0),rand(elty,0)) == ones(elty,0) diff --git a/test/linalg/pinv.jl b/test/linalg/pinv.jl index ba0dbb88415d9..2c20e9f54bb12 100644 --- a/test/linalg/pinv.jl +++ b/test/linalg/pinv.jl @@ -101,7 +101,7 @@ function test_pinv(a,m,n,tol1,tol2,tol3) @test vecnorm(a*x-b)/vecnorm(b) ≈ 0 atol=tol2 end -@testset for eltya in (Float32, Float64, Complex64, Complex128) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64) @testset for (m, n) in [(1000, 100), (100, 100), (100, 1000)] default_tol = (real(one(eltya))) * max(m,n) * 10 tol1 = 1e-2 diff --git a/test/linalg/qr.jl b/test/linalg/qr.jl index 0c6c1a1c70e10..3a4611481a994 100644 --- a/test/linalg/qr.jl +++ b/test/linalg/qr.jl @@ -23,14 +23,14 @@ bimg = randn(n,2)/2 squareQ(Q::LinAlg.AbstractQ) = (sq = size(Q.factors, 1); mul!(Q, Matrix{eltype(Q)}(I, sq, sq))) rectangularQ(Q::LinAlg.AbstractQ) = convert(Array, Q) -@testset for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int) raw_a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) raw_a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) asym = raw_a' + raw_a # symmetric indefinite apd = raw_a' * raw_a # symmetric positive-definite ε = εa = eps(abs(float(one(eltya)))) - @testset for eltyb in (Float32, Float64, Complex64, Complex128, Int) + @testset for eltyb in (Float32, Float64, ComplexF32, ComplexF64, Int) raw_b = eltyb == Int ? rand(1:5, n, 2) : convert(Matrix{eltyb}, eltyb <: Complex ? complex.(breal, bimg) : breal) εb = eps(abs(float(one(eltyb)))) ε = max(εa, εb) diff --git a/test/linalg/rowvector.jl b/test/linalg/rowvector.jl index 652f33861022c..96a9915a1be49 100644 --- a/test/linalg/rowvector.jl +++ b/test/linalg/rowvector.jl @@ -267,7 +267,7 @@ end @test (f20979.(v))[1] == f20979(v[1]) @test f20979.(v) == f20979.(collect(v)) - w = rand(Complex128, 3) + w = rand(ComplexF64, 3) @test f20979.(v') == f20979.(collect(v')) == (f20979.(v))' g20979(x, y) = [x[2,1] x[1,2]; y[1,2] y[2,1]] diff --git a/test/linalg/schur.jl b/test/linalg/schur.jl index a5a7b1b2ecc12..34980cad97ebc 100644 --- a/test/linalg/schur.jl +++ b/test/linalg/schur.jl @@ -15,7 +15,7 @@ srand(1234321) areal = randn(n,n)/2 aimg = randn(n,n)/2 -@testset for eltya in (Float32, Float64, Complex64, Complex128, Int) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int) a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) asym = a'+a # symmetric indefinite apd = a'*a # symmetric positive-definite diff --git a/test/linalg/svd.jl b/test/linalg/svd.jl index 389a25f1cc7bf..28e1b8d4159a3 100644 --- a/test/linalg/svd.jl +++ b/test/linalg/svd.jl @@ -43,7 +43,7 @@ aimg = randn(n,n)/2 a2real = randn(n,n)/2 a2img = randn(n,n)/2 -@testset for eltya in (Float32, Float64, Complex64, Complex128, Int) +@testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, Int) aa = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) aa2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) asym = aa'+aa # symmetric indefinite diff --git a/test/linalg/symmetric.jl b/test/linalg/symmetric.jl index 63421bd140cfe..4737084f621e7 100644 --- a/test/linalg/symmetric.jl +++ b/test/linalg/symmetric.jl @@ -30,7 +30,7 @@ end n = 10 areal = randn(n,n)/2 aimg = randn(n,n)/2 - @testset for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int) + @testset for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int) a = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(areal, aimg) : areal) asym = a.'+a # symmetric indefinite aherm = a'+a # Hermitian indefinite @@ -104,7 +104,7 @@ end end end if eltya <: Complex - typs = [Complex64,Complex128] + typs = [ComplexF32,ComplexF64] for typ in typs @test Symmetric(convert(Matrix{typ},asym)) == convert(Symmetric{typ,Matrix{typ}},Symmetric(asym)) @test Hermitian(convert(Matrix{typ},aherm)) == convert(Hermitian{typ,Matrix{typ}},Hermitian(aherm)) @@ -195,7 +195,7 @@ end if eltya <: Base.LinAlg.BlasComplex @testset "inverse edge case with complex Hermitian" begin # Hermitian matrix, where inv(lufact(A)) generates non-real diagonal elements - for T in (Complex64, Complex128) + for T in (ComplexF32, ComplexF64) A = T[0.650488+0.0im 0.826686+0.667447im; 0.826686-0.667447im 1.81707+0.0im] H = Hermitian(A) @test inv(H) ≈ inv(A) @@ -435,7 +435,7 @@ end @testset "$HS solver with $RHS RHS - $T" for HS in (Hermitian, Symmetric), RHS in (Hermitian, Symmetric, Diagonal, UpperTriangular, LowerTriangular), - T in (Float64, Complex128) + T in (Float64, ComplexF64) D = rand(T, 10, 10); D = D'D A = HS(D) B = RHS(D) @@ -443,7 +443,7 @@ end end @testset "inversion of Hilbert matrix" begin - for T in (Float64, Complex128) + for T in (Float64, ComplexF64) H = T[1/(i + j - 1) for i in 1:8, j in 1:8] @test norm(inv(Symmetric(H))*(H*ones(8)) .- 1) ≈ 0 atol = 1e-5 @test norm(inv(Hermitian(H))*(H*ones(8)) .- 1) ≈ 0 atol = 1e-5 diff --git a/test/linalg/triangular.jl b/test/linalg/triangular.jl index 6badb09afab71..3655883fd3b8e 100644 --- a/test/linalg/triangular.jl +++ b/test/linalg/triangular.jl @@ -16,7 +16,7 @@ debug && println("Test basic type functionality") @test LowerTriangular(randn(3, 3)) |> t -> [size(t, i) for i = 1:3] == [size(Matrix(t), i) for i = 1:3] # The following test block tries to call all methods in base/linalg/triangular.jl in order for a combination of input element types. Keep the ordering when adding code. -for elty1 in (Float32, Float64, BigFloat, Complex64, Complex128, Complex{BigFloat}, Int) +for elty1 in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int) # Begin loop for first Triangular matrix for (t1, uplo1) in ((UpperTriangular, :U), (UnitUpperTriangular, :U), @@ -178,7 +178,7 @@ for elty1 in (Float32, Float64, BigFloat, Complex64, Complex128, Complex{BigFloa end #exp/log - if (elty1 == Float64 || elty1 == Complex128) && (t1 == UpperTriangular || t1 == LowerTriangular) + if (elty1 == Float64 || elty1 == ComplexF64) && (t1 == UpperTriangular || t1 == LowerTriangular) @test exp(Matrix(log(A1))) ≈ A1 end @@ -269,7 +269,7 @@ for elty1 in (Float32, Float64, BigFloat, Complex64, Complex128, Complex{BigFloa end # Begin loop for second Triangular matrix - for elty2 in (Float32, Float64, BigFloat, Complex64, Complex128, Complex{BigFloat}, Int) + for elty2 in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int) for (t2, uplo2) in ((UpperTriangular, :U), (UnitUpperTriangular, :U), (LowerTriangular, :L), @@ -313,7 +313,7 @@ for elty1 in (Float32, Float64, BigFloat, Complex64, Complex128, Complex{BigFloa end end - for eltyB in (Float32, Float64, BigFloat, Complex64, Complex128, Complex{BigFloat}) + for eltyB in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}) B = convert(Matrix{eltyB}, elty1 <: Complex ? real(A1)*ones(n, n) : A1*ones(n, n)) debug && println("elty1: $elty1, A1: $t1, B: $eltyB") @@ -409,12 +409,12 @@ Aimg = randn(n, n)/2 A2real = randn(n, n)/2 A2img = randn(n, n)/2 -for eltya in (Float32, Float64, Complex64, Complex128, BigFloat, Int) +for eltya in (Float32, Float64, ComplexF32, ComplexF64, BigFloat, Int) A = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(Areal, Aimg) : Areal) # a2 = eltya == Int ? rand(1:7, n, n) : convert(Matrix{eltya}, eltya <: Complex ? complex.(a2real, a2img) : a2real) εa = eps(abs(float(one(eltya)))) - for eltyb in (Float32, Float64, Complex64, Complex128) + for eltyb in (Float32, Float64, ComplexF32, ComplexF64) εb = eps(abs(float(one(eltyb)))) ε = max(εa,εb) diff --git a/test/linalg/tridiag.jl b/test/linalg/tridiag.jl index 8cf9d39532aa9..7d9adea08ed93 100644 --- a/test/linalg/tridiag.jl +++ b/test/linalg/tridiag.jl @@ -16,7 +16,7 @@ end guardsrand(123) do n = 12 #Size of matrix problem to test - @testset for elty in (Float32, Float64, Complex64, Complex128, Int) + @testset for elty in (Float32, Float64, ComplexF32, ComplexF64, Int) if elty == Int srand(61516384) d = rand(1:100, n) @@ -78,7 +78,7 @@ guardsrand(123) do @test Tridiagonal(dl, d, du) + Tridiagonal(du, d, dl) == SymTridiagonal(2d, dl+du) @test SymTridiagonal(d, dl) + Tridiagonal(dl, d, du) == Tridiagonal(dl + dl, d+d, dl+du) @test convert(SymTridiagonal,Tridiagonal(SymTridiagonal(d, dl))) == SymTridiagonal(d, dl) - @test Array(convert(SymTridiagonal{Complex64},Tridiagonal(SymTridiagonal(d, dl)))) == convert(Matrix{Complex64}, SymTridiagonal(d, dl)) + @test Array(convert(SymTridiagonal{ComplexF32},Tridiagonal(SymTridiagonal(d, dl)))) == convert(Matrix{ComplexF32}, SymTridiagonal(d, dl)) end @testset "tril/triu" begin zerosd = fill!(similar(d), 0) @@ -118,7 +118,7 @@ guardsrand(123) do @testset for mat_type in (Tridiagonal, SymTridiagonal) A = mat_type == Tridiagonal ? mat_type(dl, d, du) : mat_type(d, dl) - fA = map(elty <: Complex ? Complex128 : Float64, Array(A)) + fA = map(elty <: Complex ? ComplexF64 : Float64, Array(A)) @testset "similar, size, and copy!" begin B = similar(A) @test size(B) == size(A) @@ -199,7 +199,7 @@ guardsrand(123) do end @testset "Binary operations" begin B = mat_type == Tridiagonal ? mat_type(a, b, c) : mat_type(b, a) - fB = map(elty <: Complex ? Complex128 : Float64, Array(B)) + fB = map(elty <: Complex ? ComplexF64 : Float64, Array(B)) for op in (+, -, *) @test Array(op(A, B)) ≈ op(fA, fB) end diff --git a/test/linalg/uniformscaling.jl b/test/linalg/uniformscaling.jl index 14cc00a9e9d63..2f5460893debe 100644 --- a/test/linalg/uniformscaling.jl +++ b/test/linalg/uniformscaling.jl @@ -12,9 +12,9 @@ srand(123) @test one(UniformScaling{Float32}) == UniformScaling(one(Float32)) @test zero(UniformScaling{Float32}) == UniformScaling(zero(Float32)) @test eltype(one(UniformScaling{Float32})) == Float32 - @test zero(UniformScaling(rand(Complex128))) == zero(UniformScaling{Complex128}) - @test one(UniformScaling(rand(Complex128))) == one(UniformScaling{Complex128}) - @test eltype(one(UniformScaling(rand(Complex128)))) == Complex128 + @test zero(UniformScaling(rand(ComplexF64))) == zero(UniformScaling{ComplexF64}) + @test one(UniformScaling(rand(ComplexF64))) == one(UniformScaling{ComplexF64}) + @test eltype(one(UniformScaling(rand(ComplexF64)))) == ComplexF64 @test -one(UniformScaling(2)) == UniformScaling(-1) @test sparse(3I,4,5) == sparse(1:4, 1:4, 3, 4, 5) @test sparse(3I,5,4) == sparse(1:4, 1:4, 3, 5, 4) @@ -60,7 +60,7 @@ end end @test copy(UniformScaling(one(Float64))) == UniformScaling(one(Float64)) -@test sprint(show,UniformScaling(one(Complex128))) == "UniformScaling{Complex{Float64}}\n(1.0 + 0.0im)*I" +@test sprint(show,UniformScaling(one(ComplexF64))) == "UniformScaling{Complex{Float64}}\n(1.0 + 0.0im)*I" @test sprint(show,UniformScaling(one(Float32))) == "UniformScaling{Float32}\n1.0*I" let @@ -184,7 +184,7 @@ end end @testset "chol" begin - for T in (Float64, Complex64, BigFloat, Int) + for T in (Float64, ComplexF32, BigFloat, Int) λ = T(4) @test chol(λ*I) ≈ √λ*I @test_throws LinAlg.PosDefException chol(-λ*I) diff --git a/test/numbers.jl b/test/numbers.jl index 729c17d27f7c0..19f85623459f9 100644 --- a/test/numbers.jl +++ b/test/numbers.jl @@ -2421,8 +2421,8 @@ end @testset "issue #12832" begin @test_throws ErrorException reinterpret(Float64, Complex{Int64}(1)) - @test_throws ErrorException reinterpret(Float64, Complex64(1)) - @test_throws ErrorException reinterpret(Complex64, Float64(1)) + @test_throws ErrorException reinterpret(Float64, ComplexF32(1)) + @test_throws ErrorException reinterpret(ComplexF32, Float64(1)) @test_throws ErrorException reinterpret(Int32, false) end # issue #41 @@ -2504,8 +2504,8 @@ end zbuf = IOBuffer([0xbf, 0xc0, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00, 0x40, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) - z1 = read(zbuf, Complex64) - z2 = read(zbuf, Complex128) + z1 = read(zbuf, ComplexF32) + z2 = read(zbuf, ComplexF64) @test bswap(z1) === -1.5f0 + 2.5f0im @test bswap(z2) === 3.5 - 4.5im end @@ -2842,7 +2842,7 @@ end let types = (Base.BitInteger_types..., BigInt, Bool, Rational{Int}, Rational{BigInt}, Float16, Float32, Float64, BigFloat, - Complex{Int}, Complex{UInt}, Complex32, Complex64, Complex128) + Complex{Int}, Complex{UInt}, ComplexF16, ComplexF32, ComplexF64) for S in types for op in (+, -) T = @inferred Base.promote_op(op, S) diff --git a/test/perf/shootout/mandelbrot.jl b/test/perf/shootout/mandelbrot.jl index 62e76de8a89e0..ccefdc340b38d 100644 --- a/test/perf/shootout/mandelbrot.jl +++ b/test/perf/shootout/mandelbrot.jl @@ -7,7 +7,7 @@ const ITER = 50 -function ismandel(z::Complex128) +function ismandel(z::ComplexF64) c = z for n = 1:ITER if abs2(z) > 4 diff --git a/test/random.jl b/test/random.jl index 8105228e12e4a..2904be9dc80ba 100644 --- a/test/random.jl +++ b/test/random.jl @@ -21,7 +21,7 @@ end @test typeof(rand(false:true)) === Bool @test typeof(rand(Char)) === Char @test length(randn(4, 5)) == 20 -@test length(randn(Complex128, 4, 5)) == 20 +@test length(randn(ComplexF64, 4, 5)) == 20 @test length(bitrand(4, 5)) == 20 @test rand(MersenneTwister(0)) == 0.8236475079774124 @@ -69,10 +69,10 @@ let A = zeros(2, 2) -0.444383357109696 -0.29948409035891055] end -let B = zeros(Complex128, 2) +let B = zeros(ComplexF64, 2) randn!(MersenneTwister(42), B) - @test B == [Complex128(-0.5560268761463861,-0.444383357109696), - Complex128(0.027155338009193845,-0.29948409035891055)] * 0.7071067811865475244008 + @test B == [ComplexF64(-0.5560268761463861,-0.444383357109696), + ComplexF64(0.027155338009193845,-0.29948409035891055)] * 0.7071067811865475244008 end for T in (Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, BigInt, @@ -321,7 +321,7 @@ end # test all rand APIs for rng in ([], [MersenneTwister(0)], [RandomDevice()]) ftypes = [Float16, Float32, Float64] - cftypes = [Complex32, Complex64, Complex128, ftypes...] + cftypes = [ComplexF16, ComplexF32, ComplexF64, ftypes...] types = [Bool, Char, BigFloat, Base.BitInteger_types..., ftypes...] randset = Set(rand(Int, 20)) randdict = Dict(zip(rand(Int,10), rand(Int, 10))) diff --git a/test/reducedim.jl b/test/reducedim.jl index 91263d00e1086..fbed7da08db6f 100644 --- a/test/reducedim.jl +++ b/test/reducedim.jl @@ -98,10 +98,10 @@ end @test @inferred(sum(UInt8[1], 1)) == [1] # Complex types -@test typeof(@inferred(sum([1.0+1.0im], 1))) == Vector{Complex128} +@test typeof(@inferred(sum([1.0+1.0im], 1))) == Vector{ComplexF64} @test typeof(@inferred(Base.sum(abs, [1.0+1.0im], 1))) == Vector{Float64} @test typeof(@inferred(Base.sum(abs2, [1.0+1.0im], 1))) == Vector{Float64} -@test typeof(@inferred(prod([1.0+1.0im], 1))) == Vector{Complex128} +@test typeof(@inferred(prod([1.0+1.0im], 1))) == Vector{ComplexF64} @test typeof(@inferred(Base.prod(abs, [1.0+1.0im], 1))) == Vector{Float64} @test typeof(@inferred(Base.prod(abs2, [1.0+1.0im], 1))) == Vector{Float64} diff --git a/test/reflection.jl b/test/reflection.jl index 0af98d038865d..882063917a63c 100644 --- a/test/reflection.jl +++ b/test/reflection.jl @@ -548,7 +548,7 @@ for i = 1:100; @eval fLargeTable(::Any, ::Val{$i}) = 2; end fLargeTable(::Any...) = 3 @test length(methods(fLargeTable, Tuple{})) == 1 fLargeTable(::Complex, ::Complex) = 4 -fLargeTable(::Union{Complex64, Complex128}...) = 5 +fLargeTable(::Union{ComplexF32, ComplexF64}...) = 5 @test length(methods(fLargeTable, Tuple{})) == 1 fLargeTable() = 4 @test length(methods(fLargeTable)) == 204 @@ -707,7 +707,7 @@ struct B20086{T,N} <: A20086{T,N} end # sizeof and nfields @test sizeof(Int16) == 2 -@test sizeof(Complex128) == 16 +@test sizeof(ComplexF64) == 16 primitive type ParameterizedByte__{A,B} 8 end @test sizeof(ParameterizedByte__) == 1 @test sizeof(nothing) == 0 @@ -721,7 +721,7 @@ end @test sizeof(Symbol("")) == 0 @test_throws(ErrorException("argument is an abstract type; size is indeterminate"), sizeof(Real)) -@test sizeof(Union{Complex64,Complex128}) == 16 +@test sizeof(Union{ComplexF32,ComplexF64}) == 16 @test sizeof(Union{Int8,UInt8}) == 1 @test_throws ErrorException sizeof(AbstractArray) @test_throws ErrorException sizeof(Tuple) @@ -737,8 +737,8 @@ end @test nfields(1) == 0 @test fieldcount(Union{}) == 0 @test fieldcount(Tuple{Any,Any,T} where T) == 3 -@test fieldcount(Complex) == fieldcount(Complex64) == 2 -@test fieldcount(Union{Complex64,Complex128}) == 2 +@test fieldcount(Complex) == fieldcount(ComplexF32) == 2 +@test fieldcount(Union{ComplexF32,ComplexF64}) == 2 @test fieldcount(Int) == 0 @test_throws(ErrorException("type does not have a definite number of fields"), fieldcount(Union{Complex,Pair})) diff --git a/test/sparse/sparse.jl b/test/sparse/sparse.jl index 427585d7f9f8a..c3b32de0c8bc5 100644 --- a/test/sparse/sparse.jl +++ b/test/sparse/sparse.jl @@ -190,8 +190,8 @@ end b = randn(5,3) + im*randn(5,3) c = randn(5) + im*randn(5) d = randn(5) + im*randn(5) - α = rand(Complex128) - β = rand(Complex128) + α = rand(ComplexF64) + β = rand(ComplexF64) @test (maximum(abs.(a*b - Array(a)*b)) < 100*eps()) @test (maximum(abs.(mul!(similar(b), a, b) - Array(a)*b)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. @test (maximum(abs.(mul!(similar(c), a, c) - Array(a)*c)) < 100*eps()) # for compatibility with present matmul API. Should go away eventually. @@ -1465,7 +1465,7 @@ end end @testset "diag" begin - for T in (Float64, Complex128) + for T in (Float64, ComplexF64) S1 = sprand(T, 5, 5, 0.5) S2 = sprand(T, 10, 5, 0.5) S3 = sprand(T, 5, 10, 0.5) @@ -1545,7 +1545,7 @@ end @test ishermitian(A) == false @test issymmetric(A) == false - A = sparse(Complex128(1)I, 5, 5) + A = sparse(ComplexF64(1)I, 5, 5) A[3,2] = 1.0 + im @test ishermitian(A) == false @test issymmetric(A) == false @@ -1558,7 +1558,7 @@ end @test issymmetric(A) == true # explicit zeros - A = sparse(Complex128(1)I, 5, 5) + A = sparse(ComplexF64(1)I, 5, 5) A[3,1] = 2 A.nzval[2] = 0.0 @test ishermitian(A) == true @@ -2089,11 +2089,11 @@ end @testset "similar with type conversion" begin local A = sparse(1.0I, 5, 5) - @test size(similar(A, Complex128, Int)) == (5, 5) - @test typeof(similar(A, Complex128, Int)) == SparseMatrixCSC{Complex128, Int} - @test size(similar(A, Complex128, Int8)) == (5, 5) - @test typeof(similar(A, Complex128, Int8)) == SparseMatrixCSC{Complex128, Int8} - @test similar(A, Complex128,(6, 6)) == spzeros(Complex128, 6, 6) + @test size(similar(A, ComplexF64, Int)) == (5, 5) + @test typeof(similar(A, ComplexF64, Int)) == SparseMatrixCSC{ComplexF64, Int} + @test size(similar(A, ComplexF64, Int8)) == (5, 5) + @test typeof(similar(A, ComplexF64, Int8)) == SparseMatrixCSC{ComplexF64, Int8} + @test similar(A, ComplexF64,(6, 6)) == spzeros(ComplexF64, 6, 6) @test convert(Matrix, A) == Array(A) # lolwut, are you lost, test? end diff --git a/test/sparse/sparsevector.jl b/test/sparse/sparsevector.jl index 6ba9df7f83b09..be73dd551d482 100644 --- a/test/sparse/sparsevector.jl +++ b/test/sparse/sparsevector.jl @@ -391,7 +391,7 @@ end # complex acp = complex(af) @test complex(acp) == acp - @test isa(acp, SparseVector{Complex128,Int}) + @test isa(acp, SparseVector{ComplexF64,Int}) @test exact_equal(acp, SparseVector(8, [2, 5, 6], complex([12., 35., 72.]))) @test sparsevec(adjoint(adjoint(acp))) == acp end @@ -804,8 +804,8 @@ end let x = complex.(sprand(32, 0.6), sprand(32, 0.6)), y = complex.(sprand(32, 0.6), sprand(32, 0.6)) - xf = Array(x)::Vector{Complex128} - yf = Array(y)::Vector{Complex128} + xf = Array(x)::Vector{ComplexF64} + yf = Array(y)::Vector{ComplexF64} @test dot(x, x) ≈ dot(xf, xf) @test dot(x, y) ≈ dot(xf, yf) end @@ -905,15 +905,15 @@ end x2f = Array(x2) y = A*x - @test isa(y, SparseVector{Complex128,Int}) + @test isa(y, SparseVector{ComplexF64,Int}) @test Array(y) ≈ Af * xf y = *(Transpose(A), x2) - @test isa(y, SparseVector{Complex128,Int}) + @test isa(y, SparseVector{ComplexF64,Int}) @test Array(y) ≈ Af.' * x2f y = *(Adjoint(A), x2) - @test isa(y, SparseVector{Complex128,Int}) + @test isa(y, SparseVector{ComplexF64,Int}) @test Array(y) ≈ Af'x2f end end @@ -1129,7 +1129,7 @@ end end end @testset "fill!" begin - for Tv in [Float32, Float64, Int64, Int32, Complex128] + for Tv in [Float32, Float64, Int64, Int32, ComplexF64] for Ti in [Int16, Int32, Int64, BigInt] sptypes = (SparseMatrixCSC{Tv, Ti}, SparseVector{Tv, Ti}) sizes = [(3, 4), (3,)] diff --git a/test/specificity.jl b/test/specificity.jl index 223ca9d8c1090..ba58adb53bf7c 100644 --- a/test/specificity.jl +++ b/test/specificity.jl @@ -45,7 +45,7 @@ _z_z_z_(::Int, c...) = 3 @test args_morespecific(Tuple{T,Vararg{T}} where T<:Number, Tuple{Number,Number,Vararg{Number}}) @test !args_morespecific(Tuple{Number,Number,Vararg{Number}}, Tuple{T,Vararg{T}} where T<:Number) -@test args_morespecific(Tuple{Array{T} where T<:Union{Float32,Float64,Complex64,Complex128}, Any}, +@test args_morespecific(Tuple{Array{T} where T<:Union{Float32,Float64,ComplexF32,ComplexF64}, Any}, Tuple{Array{T} where T<:Real, Any}) @test args_morespecific(Tuple{1,T} where T, Tuple{Any}) diff --git a/test/statistics.jl b/test/statistics.jl index 985ff26127006..84d3ea0616ee7 100644 --- a/test/statistics.jl +++ b/test/statistics.jl @@ -155,7 +155,7 @@ end @test std([1 2 3 4 5; 6 7 8 9 10], 2) ≈ sqrt.([2.5 2.5]') @test std([1 2 3 4 5; 6 7 8 9 10], 2; corrected=false) ≈ sqrt.([2.0 2.0]') - let A = Complex128[exp(i*im) for i in 1:10^4] + let A = ComplexF64[exp(i*im) for i in 1:10^4] @test varm(A, 0.) ≈ sum(map(abs2, A)) / (length(A) - 1) @test varm(A, mean(A)) ≈ var(A) end @@ -350,7 +350,7 @@ let y = [0.40003674665581906, 0.4085630862624367, 0.41662034698690303, 0.4166203 end @testset "variance of complex arrays (#13309)" begin - z = rand(Complex128, 10) + z = rand(ComplexF64, 10) @test var(z) ≈ invoke(var, Tuple{Any}, z) ≈ cov(z) ≈ var(z,1)[1] ≈ sum(abs2, z .- mean(z))/9 @test isa(var(z), Float64) @test isa(invoke(var, Tuple{Any}, z), Float64) diff --git a/test/subtype.jl b/test/subtype.jl index a9d41836c084f..13238df1b9bdc 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -729,13 +729,13 @@ function test_intersection() @testintersect((@UnionAll T Tuple{Type{Array{T,1}},Array{T,1}}), Tuple{Type{AbstractVector},Vector{Int}}, Bottom) - @testintersect(Tuple{Type{Vector{Complex128}}, AbstractVector}, + @testintersect(Tuple{Type{Vector{ComplexF64}}, AbstractVector}, (@UnionAll T @UnionAll S @UnionAll N Tuple{Type{Array{T,N}}, Array{S,N}}), - Tuple{Type{Vector{Complex128}},Vector}) + Tuple{Type{Vector{ComplexF64}},Vector}) - @testintersect(Tuple{Type{Vector{Complex128}}, AbstractArray}, + @testintersect(Tuple{Type{Vector{ComplexF64}}, AbstractArray}, (@UnionAll T @UnionAll S @UnionAll N Tuple{Type{Array{T,N}}, Array{S,N}}), - Tuple{Type{Vector{Complex128}},Vector}) + Tuple{Type{Vector{ComplexF64}},Vector}) @testintersect(Type{Array}, Type{AbstractArray}, Bottom) diff --git a/test/threads.jl b/test/threads.jl index f89e18a1ea6c5..96d3b1dcfe803 100644 --- a/test/threads.jl +++ b/test/threads.jl @@ -173,7 +173,7 @@ end # Ensure only LLVM-supported types can be atomic @test_throws TypeError Atomic{Bool} @test_throws TypeError Atomic{BigInt} -@test_throws TypeError Atomic{Complex128} +@test_throws TypeError Atomic{ComplexF64} # Test atomic memory ordering with load/store mutable struct CommBuf