Skip to content

Commit

Permalink
Force include diagonal in aggregate sparsity (#187)
Browse files Browse the repository at this point in the history
Attempts to resolve issue #183
  • Loading branch information
goulart-paul committed May 4, 2024
1 parent dd6a6fd commit f97da25
Showing 1 changed file with 11 additions and 2 deletions.
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

0 comments on commit f97da25

Please sign in to comment.