Skip to content

Commit 866e74b

Browse files
committed
Remove nnz_colors in sparsity_pattern.jl
1 parent 1a5dd72 commit 866e74b

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/sparsity_pattern.jl

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,3 @@ function compute_hessian_sparsity(
5151
S = ADTypes.hessian_sparsity(lagrangian, x0, detector)
5252
return S
5353
end
54-
55-
"""
56-
dcolors = nnz_colors(trilH, star_set, colors, ncolors)
57-
58-
Determine the coefficients in `trilH` that will be computed by a given color.
59-
60-
Arguments:
61-
- `trilH::SparseMatrixCSC`: The lower triangular part of a symmetric matrix in CSC format.
62-
- `star_set::StarSet`: A structure `StarSet` returned by the function `symmetric_coloring_detailed` of SparseMatrixColorings.jl.
63-
- `colors::Vector{Int}`: A vector where the i-th entry represents the color assigned to the i-th column of the matrix.
64-
- `ncolors::Int`: The number of distinct colors used in the coloring.
65-
66-
Output:
67-
- `dcolors::Dict{Int, Vector{Tuple{Int, Int}}}`: A dictionary where the keys are the color indices (from 1 to `ncolors`),
68-
and the values are vectors of tuples. Each tuple contains two integers: the first integer is the row index, and the
69-
second integer is the index in `trilH.nzval` where the non-zero coefficient can be found.
70-
"""
71-
function nnz_colors(trilH, star_set, colors, ncolors)
72-
# We want to determine the coefficients in `trilH` that will be computed by a given color.
73-
# Because we exploit the symmetry, we also need to store the row index for a given coefficient
74-
# in the "compressed column".
75-
dcolors = Dict(i => Tuple{Int, Int}[] for i = 1:ncolors)
76-
77-
n = LinearAlgebra.checksquare(trilH)
78-
for j = 1:n
79-
for k = trilH.colptr[j]:(trilH.colptr[j + 1] - 1)
80-
i = trilH.rowval[k]
81-
l, c = symmetric_coefficient(i, j, colors, star_set)
82-
push!(dcolors[c], (l, k))
83-
end
84-
end
85-
86-
return dcolors
87-
end

0 commit comments

Comments
 (0)