Skip to content

Commit

Permalink
Also rename LAPACK version
Browse files Browse the repository at this point in the history
  • Loading branch information
musm committed Aug 23, 2017
1 parent ae761e5 commit 6b44b78
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
7 changes: 4 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------
Expand Down
9 changes: 5 additions & 4 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions base/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions base/linalg/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6b44b78

Please sign in to comment.