Skip to content

Commit

Permalink
compat fixes for Julia v1.8 (JuliaStats#459)
Browse files Browse the repository at this point in the history
* compat fixes for Julia v1.8

* bump patch version
  • Loading branch information
dkarrasch authored and ym-han committed Dec 17, 2021
1 parent 05673f2 commit d755f7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GLM"
uuid = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
version = "1.6.0"
version = "1.6.1"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
8 changes: 7 additions & 1 deletion src/GLM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module GLM
import StatsModels: hasintercept
export coef, coeftable, confint, deviance, nulldeviance, dof, dof_residual,
loglikelihood, nullloglikelihood, nobs, stderror, vcov, residuals, predict,
fitted, fit, fit!, model_response, response, modelmatrix, r2, r², adjr2, adjr²,
fitted, fit, fit!, model_response, response, modelmatrix, r2, r², adjr2, adjr²,
cooksdistance, hasintercept

export
Expand Down Expand Up @@ -81,6 +81,12 @@ module GLM
abstract type DensePred <: LinPred end # linear predictor with dense X
abstract type LinPredModel <: RegressionModel end # model based on a linear predictor

@static if VERSION < v"1.8.0-DEV.1139"
pivoted_cholesky!(A; kwargs...) = cholesky!(A, Val(true); kwargs...)
else
pivoted_cholesky!(A; kwargs...) = cholesky!(A, RowMaximum(); kwargs...)
end

include("linpred.jl")
include("lm.jl")
include("glmtools.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/linpred.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ end
function DensePredChol(X::StridedMatrix, pivot::Bool)
F = Hermitian(float(X'X))
T = eltype(F)
F = pivot ? cholesky!(F, Val(true), tol = -one(T), check = false) : cholesky!(F)
F = pivot ? pivoted_cholesky!(F, tol = -one(T), check = false) : cholesky!(F)
DensePredChol(AbstractMatrix{T}(X),
zeros(T, size(X, 2)),
zeros(T, size(X, 2)),
Expand Down

0 comments on commit d755f7b

Please sign in to comment.