diff --git a/src/active_set.jl b/src/active_set.jl index 32a98f1..db76df0 100644 --- a/src/active_set.jl +++ b/src/active_set.jl @@ -739,7 +739,9 @@ function _polish_difference_qp(supp::Union{EdgeList{T},DiffGrid{T}}, u0::Vector{ end e < 0 && break if e == 0 - certified = all(k -> λ[k] >= -dtol_eff, W) + # `dtol_eff` is reassigned in this loop; capturing it would box it. + dt = dtol_eff + certified = all(k -> λ[k] >= -dt, W) break end # Single-constraint step; bulk steps resume only when it leaves more diff --git a/src/iscover.jl b/src/iscover.jl index da31c44..9ea00eb 100644 --- a/src/iscover.jl +++ b/src/iscover.jl @@ -255,8 +255,8 @@ end # shifted by `(t, -t)` before they are exponentiated, so the test is whether # some shift fits both into range; otherwise the values must fit as given. # `hint` is appended to the error message. -function _check_representable(lα::AbstractVector, hasα, lβ, hasβ, ::Type{T}, fname::Symbol; - gauge::Bool, hint::String="") where {T} +function _check_representable(lα::AbstractVector, hasα::F, lβ, hasβ::G, ::Type{T}, fname::Symbol; + gauge::Bool, hint::String="") where {F,G,T} lo, hi = log(floatmin(T)), log(floatmax(T)) loα, hiα = _supported_extrema(lα, hasα) loβ, hiβ = lβ === nothing ? (loα, hiα) : _supported_extrema(lβ, hasβ) diff --git a/src/minimal_covers.jl b/src/minimal_covers.jl index 52c6e21..78ac62e 100644 --- a/src/minimal_covers.jl +++ b/src/minimal_covers.jl @@ -1396,7 +1396,8 @@ function _difference_solve!(sol, x, f, czero, dfull, zedges, vpairs, dκ, dmin, factorize!(F, B) out = zeros(Float64, N) solve!(out, F, CHOLMOD_A, Vector{Float64}(f)) - return out, it, true + # Both branches return a `Vector{T}`; CHOLMOD solves in `Float64`. + return convert(Vector{T}, out), it, true end # Storage for the dense normal-equation factorization of the `:dense` path. diff --git a/src/powermean_newton.jl b/src/powermean_newton.jl index b1daa95..fb37b66 100644 --- a/src/powermean_newton.jl +++ b/src/powermean_newton.jl @@ -198,7 +198,9 @@ function _powermean_linsolve(sys::PowerMeanSystem{T}, linsolve::Symbol) where {T end H = kind === :dense ? zeros(T, N, N) : zeros(T, 0, 0) epos = zeros(Int, kind === :cholesky ? length(sys.u) : 0) - dpos = kind === :cholesky ? [_nzindex(M, q, q) for q in 1:N] : Int[] + # `M` is reassigned above, so the comprehension captures a binding made once. + Mp = M + dpos = kind === :cholesky ? [_nzindex(Mp, q, q) for q in 1:N] : Int[] if kind === :cholesky for e in eachindex(sys.u, sys.v) a, b = sys.u[e], sys.v[e] @@ -286,9 +288,11 @@ function _powermean_direction!(d, ls::PowerMeanLinsolve{T}, sys::PowerMeanSystem for e in eachindex(sys.u, sys.v, W) a, b = sys.u[e], sys.v[e] h = p * sys.mult[e] * W[e] - z = h * (xx[a] + xx[b]) - y[a] += z - y[b] += z + # Not named `z`: the CG work vector `z` bound below would make a + # shared name a boxed capture. + δ = h * (xx[a] + xx[b]) + y[a] += δ + y[b] += δ end for q in eachindex(y, pinned) pinned[q] && (y[q] = xx[q])