Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex<2N> to ComplexF<N> rename #431

Merged
merged 1 commit into from
Dec 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ Currently, the `@compat` macro supports the following syntaxes:

* `strwidth` and `charwidth` are now merged into `textwidth` ([#23667]).

* `Complex32`, `Complex64`, and `Complex128` are now `ComplexF16`, `ComplexF32`, and
`ComplexF64`, respectively ([#24647]).

## New macros

* `@__DIR__` has been added ([#18380])
Expand Down Expand Up @@ -382,6 +385,7 @@ includes this fix. Find the minimum version from there.
[#24372]: https://github.com/JuliaLang/julia/issues/24372
[#24459]: https://github.com/JuliaLang/julia/issues/24459
[#24605]: https://github.com/JuliaLang/julia/issues/24605
[#24647]: https://github.com/JuliaLang/julia/issues/24647
[#24652]: https://github.com/JuliaLang/julia/issues/24652
[#24657]: https://github.com/JuliaLang/julia/issues/24657
[#24785]: https://github.com/JuliaLang/julia/issues/24785
14 changes: 14 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,20 @@ if VERSION < v"0.7.0-DEV.1499"
end
end

# 0.7.0-DEV.2919
@static if !isdefined(Base, :ComplexF16)
const ComplexF16 = Complex{Float16}
export ComplexF16
end
@static if !isdefined(Base, :ComplexF32)
const ComplexF32 = Complex{Float32}
export ComplexF32
end
@static if !isdefined(Base, :ComplexF64)
const ComplexF64 = Complex{Float64}
export ComplexF64
end

include("deprecated.jl")

end # module Compat
13 changes: 9 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ end
let 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
Expand Down Expand Up @@ -701,7 +701,7 @@ end
@test logdet(0.5) == log(det(0.5))

# PR 22633
for T in (Float64, Complex64, BigFloat, Int)
for T in (Float64, ComplexF32, BigFloat, Int)
λ = T(4)
@test chol(λ*I).λ ≈ √λ
@test_throws Union{ArgumentError,LinAlg.PosDefException} chol(-λ*I)
Expand Down Expand Up @@ -909,7 +909,7 @@ let a = [1 0 0; 0 1 0; 0 0 1]
@test SparseMatrixCSC{Int}(I, 3, 3)::SparseMatrixCSC{Int,Int} == a
@test SparseMatrixCSC{Float64}(I, (3, 2))::SparseMatrixCSC{Float64,Int} == a[:,1:2]
@test SparseMatrixCSC{Bool,Int16}(I, (3, 3))::SparseMatrixCSC{Bool,Int16} == a
@test SparseMatrixCSC{Complex128,Int8}(I, 3, 2)::SparseMatrixCSC{Complex128,Int8} == a[:,1:2]
@test SparseMatrixCSC{ComplexF64,Int8}(I, 3, 2)::SparseMatrixCSC{ComplexF64,Int8} == a[:,1:2]
end

# 0.7.0-DEV.2581
Expand Down Expand Up @@ -952,6 +952,11 @@ let key = "TEST_23412"
@test get(() -> "default", ENV, key) == "default"
end

# 0.7.0-DEV.2919
@test ComplexF16 === Complex{Float16}
@test ComplexF32 === Complex{Float32}
@test ComplexF64 === Complex{Float64}

if VERSION < v"0.6.0"
include("deprecated.jl")
end
Expand Down