Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/active_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/iscover.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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β)
Expand Down
3 changes: 2 additions & 1 deletion src/minimal_covers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 8 additions & 4 deletions src/powermean_newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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])
Expand Down
Loading