Skip to content
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

Fix crash for PSD cones without diagonal entries in problem data #187

Merged
merged 1 commit into from
May 4, 2024
Merged
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
13 changes: 11 additions & 2 deletions src/chordal_decomposition/chordal_decomposition.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function nz_rows(a::SparseMatrixCSC{T}, ind::UnitRange{Int}, DROP_ZEROS_FLAG::Bo
active[r - ind.start + 1] = true
end
end
return findall(active)
active
end

function number_of_overlaps_in_rows(A::SparseMatrixCSC{T}) where {T <: AbstractFloat}
Expand All @@ -97,7 +97,16 @@ end


function find_aggregate_sparsity(A::SparseMatrixCSC{T}, b::AbstractVector{T}, ind::UnitRange{Int}, C::DecomposableCones{T}) where {T <: AbstractFloat}
AInd = nz_rows(A, ind, false)

AInd_logical = nz_rows(A, ind, false)

# explicitly flag all the terms corresonding to the cone diagonal
for i = 1:C.sqrt_dim
AInd_logical[vec_dim(i, C)] = true
end

AInd = findall(AInd_logical)

# commonZeros = AInd[find(x->x==0,b[AInd])]
bInd = findall(x -> x != 0, view(b, ind))
commonNZeros = union(AInd, bInd)
Expand Down
Loading