From 6b44b783eecbccfff6c479787df4b42781546997 Mon Sep 17 00:00:00 2001 From: Mus M Date: Wed, 23 Aug 2017 10:08:33 -0400 Subject: [PATCH] Also rename LAPACK version --- NEWS.md | 7 ++++--- base/deprecated.jl | 9 +++++---- base/linalg/lapack.jl | 8 ++++---- base/linalg/svd.jl | 4 ++-- test/linalg/lapack.jl | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/NEWS.md b/NEWS.md index ab2a76ed1047e..e74f110793408 100644 --- a/NEWS.md +++ b/NEWS.md @@ -332,11 +332,12 @@ Deprecated or removed * `diagm(A::SparseMatrixCSC)` has been deprecated in favor of `spdiagm(sparsevec(A))` ([#23341]). + * `diagm(A::BitMatrix)` has been deprecated, use `diagm(vec(A))` instead ([#23373]). + * `GMP.gmp_version()`, `GMP.GMP_VERSION`, `GMP.gmp_bits_per_limb()`, and `GMP.GMP_BITS_PER_LIBM` have been renamed to `GMP.version()`, `GMP.VERSION`, `GMP.bits_per_libm()`, and `GMP.BITS_PER_LIBM`, - respectively. Similarly, `MPFR.get_version()`, has been renamed to `MPFR.version()` ([#23323]). - - * `diagm(A::BitMatrix)` has been deprecated, use `diagm(vec(A))` instead ([#23373]). + respectively. Similarly, `MPFR.get_version()`, has been renamed to `MPFR.version()` ([#23323]). Also, + `LinAlg.LAPACK.laver()` has been renamed to `LinAlg.LAPACK.version()` and now returns a `VersionNumber`. Command-line option changes --------------------------- diff --git a/base/deprecated.jl b/base/deprecated.jl index aff0d1a65b990..3cd1e67261380 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1716,15 +1716,16 @@ export hex2num # PR 23341 @deprecate diagm(A::SparseMatrixCSC) spdiagm(sparsevec(A)) +# PR #23373 +@deprecate diagm(A::BitMatrix) diagm(vec(A)) + # PR 23341 @eval GMP @deprecate gmp_version() version() false @eval GMP @Base.deprecate_binding GMP_VERSION VERSION false -@eval GMP @deprecate gmp_bits_per_libm() bits_per_libm() false +@eval GMP @deprecate gmp_bits_per_limb() bits_per_limb() false @eval GMP @Base.deprecate_binding GMP_BITS_PER_LIMB BITS_PER_LIMB false @eval MPFR @deprecate get_version() version() false - -# PR #23373 -@deprecate diagm(A::BitMatrix) diagm(vec(A)) +@eval LinAlg.LAPACK @deprecate laver() version() false # END 0.7 deprecations diff --git a/base/linalg/lapack.jl b/base/linalg/lapack.jl index 847e0c13479b0..58aea6a9519e9 100644 --- a/base/linalg/lapack.jl +++ b/base/linalg/lapack.jl @@ -92,14 +92,14 @@ function chkfinite(A::StridedMatrix) end # LAPACK version number -function laver() +function version() major = Ref{BlasInt}(0) minor = Ref{BlasInt}(0) patch = Ref{BlasInt}(0) ccall((@blasfunc(ilaver_), liblapack), Void, - (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), - major, minor, patch) - return major[], minor[], patch[] + (Ptr{BlasInt}, Ptr{BlasInt}, Ptr{BlasInt}), + major, minor, patch) + return VersionNumber(major[], minor[], patch[]) end # (GB) general banded matrices, LU decomposition and solver diff --git a/base/linalg/svd.jl b/base/linalg/svd.jl index 3cb28e9a2bb23..f18faf9ded8b3 100644 --- a/base/linalg/svd.jl +++ b/base/linalg/svd.jl @@ -193,7 +193,7 @@ end """ function svdfact!(A::StridedMatrix{T}, B::StridedMatrix{T}) where T<:BlasFloat # xggsvd3 replaced xggsvd in LAPACK 3.6.0 - if LAPACK.laver() < (3, 6, 0) + if LAPACK.version() < v"3.6.0" U, V, Q, a, b, k, l, R = LAPACK.ggsvd!('U', 'V', 'Q', A, B) else U, V, Q, a, b, k, l, R = LAPACK.ggsvd3!('U', 'V', 'Q', A, B) @@ -290,7 +290,7 @@ end function svdvals!(A::StridedMatrix{T}, B::StridedMatrix{T}) where T<:BlasFloat # xggsvd3 replaced xggsvd in LAPACK 3.6.0 - if LAPACK.laver() < (3, 6, 0) + if LAPACK.version() < v"3.6.0" _, _, _, a, b, k, l, _ = LAPACK.ggsvd!('N', 'N', 'N', A, B) else _, _, _, a, b, k, l, _ = LAPACK.ggsvd3!('N', 'N', 'N', A, B) diff --git a/test/linalg/lapack.jl b/test/linalg/lapack.jl index 7d5d92b5204db..0ab3dc05a085e 100644 --- a/test/linalg/lapack.jl +++ b/test/linalg/lapack.jl @@ -172,7 +172,7 @@ end @test V' ≈ lVt B = rand(elty,10,10) # xggsvd3 replaced xggsvd in LAPACK 3.6.0 - if LAPACK.laver() < (3, 6, 0) + if LAPACK.version() < v"3.6.0" @test_throws DimensionMismatch LAPACK.ggsvd!('S','S','S',A,B) else @test_throws DimensionMismatch LAPACK.ggsvd3!('S','S','S',A,B)