-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
convert Integer in Cholesky constructors to BlasInt #29732
convert Integer in Cholesky constructors to BlasInt #29732
Conversation
Can you add a test? That would have caught this when building distro packages. |
stdlib/LinearAlgebra/src/cholesky.jl
Outdated
CholeskyPivoted{T,typeof(A)}(A, uplo, piv, rank, tol, info) | ||
function CholeskyPivoted(A::AbstractMatrix{T}, uplo::AbstractChar, piv::Vector{<:Integer}, | ||
rank::Integer, tol::Real, info::Integer) where T | ||
CholeskyPivoted{T,typeof(A)}(A, uplo, Vector{BlasInt}(piv), BlasInt(rank), tol, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, I missed this, but it's going to make a copy even when not needed. Better use convert
.
stdlib/LinearAlgebra/src/cholesky.jl
Outdated
Cholesky(A::AbstractMatrix{T}, uplo::AbstractChar, info::BlasInt) where {T} = | ||
Cholesky{T,typeof(A)}(A, uplo, info) | ||
Cholesky(A::AbstractMatrix{T}, uplo::Symbol, info::Integer) where {T} = | ||
Cholesky{T,typeof(A)}(A, char_uplo(uplo), BlasInt(info)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I shouldn't even be necessary to convert explicitly to BlasInt
. The conversion will happen implicitly if you just pass info
and it is slightly cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that true of the Vector
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It should also be the case for `Vector.
Okay I've removed all the conversions so the only change is broadening the methods to accept |
(cherry picked from commit 53563cd)
(cherry picked from commit 53563cd)
(cherry picked from commit 53563cd)
As discussed on slack with @nalimilan and @mbauman, this loosens the constructors for
Cholesky
to allowInteger
info
arguments, which are converted toBlasInt
.Fixes JuliaStats/MixedModels.jl#143 (which is caused by
BlasInt=Int32
on builds with non-ILP64 BLAS, like arch linux).