Skip to content

Commit a84c596

Browse files
authored
Compat.LinearAlgebra (#463)
1 parent 0b398b8 commit a84c596

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ Currently, the `@compat` macro supports the following syntaxes:
110110
* `using Compat.SparseArrays` is provided on versions older than 0.7, where this library is
111111
not yet part of the standard library ([#25249]).
112112

113+
* `using Compat.LinearAlgebra` is provided on versions older than 0.7, where this library is
114+
not yet part of the standard library ([#25571]).
115+
113116
* `using Compat.Random` is provided on versions older than 0.7, where this library is
114117
not yet part of the standard library ([#24874]).
115118

src/Compat.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,12 @@ else
796796
import IterativeEigensolvers
797797
end
798798

799+
@static if VERSION < v"0.7.0-DEV.3449"
800+
const LinearAlgebra = Base.LinAlg
801+
else
802+
import LinearAlgebra
803+
end
804+
799805
if VERSION < v"0.7.0-DEV.3389"
800806
const SparseArrays = Base.SparseArrays
801807
else

src/deprecated.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ end
175175
Base.@deprecate_binding AsyncCondition Base.AsyncCondition
176176
Base.@deprecate_binding promote_eltype_op Base.promote_eltype_op
177177
@eval Base.@deprecate_binding $(Symbol("@irrational")) Base.$(Symbol("@irrational"))
178-
@eval Base.@deprecate_binding $(Symbol("@blasfunc")) Base.LinAlg.BLAS.$(Symbol("@blasfunc"))
178+
@eval Base.@deprecate_binding $(Symbol("@blasfunc")) Compat.LinearAlgebra.BLAS.$(Symbol("@blasfunc"))
179179
else
180180
const KERNEL = Sys.KERNEL
181181
const UTF8String = Core.String

test/runtests.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Compat
22
using Compat.Test
3+
using Compat.LinearAlgebra
34
using Compat.SparseArrays
45

56
@test isempty(detect_ambiguities(Base, Core, Compat))
@@ -712,7 +713,7 @@ end
712713
for T in (Float64, ComplexF32, BigFloat, Int)
713714
λ = T(4)
714715
@test chol*I).λ λ
715-
@test_throws Union{ArgumentError,LinAlg.PosDefException} chol(-λ*I)
716+
@test_throws Union{ArgumentError,Compat.LinearAlgebra.PosDefException} chol(-λ*I)
716717
end
717718

718719
let
@@ -1091,6 +1092,11 @@ using Compat.Random
10911092
# 0.7
10921093
@test contains("Hello, World!", r"World")
10931094

1095+
# 0.7.0-DEV.3449
1096+
let A = [2.0 1.0; 1.0 3.0], b = [1.0, 2.0], x = [0.2, 0.6]
1097+
@test cholfact(A) \ b x
1098+
end
1099+
10941100
# 0.7.0-DEV.3173
10951101
@test invpermute!(permute!([1, 2], 2:-1:1), 2:-1:1) == [1, 2]
10961102

0 commit comments

Comments
 (0)