Skip to content

Commit c13976d

Browse files
committed
Fix format
1 parent 4ed6d49 commit c13976d

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

src/coloring.jl

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Use of this source code is governed by an MIT-style license that can be found
55
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
66

7-
87
"""
98
struct ColoringResult
109
result::SMC.AbstractColoringResult
@@ -76,13 +75,17 @@ function _hessian_color_preprocess(
7675
# Build full symmetric matrix: both (i,j) and (j,i) for off-diagonal, plus diagonal
7776
I_full, J_full = Int[], Int[]
7877
for k in eachindex(I_off)
79-
push!(I_full, I_off[k]); push!(J_full, J_off[k]) # lower
80-
push!(I_full, J_off[k]); push!(J_full, I_off[k]) # upper (transpose)
78+
push!(I_full, I_off[k]);
79+
push!(J_full, J_off[k]) # lower
80+
push!(I_full, J_off[k]);
81+
push!(J_full, I_off[k]) # upper (transpose)
8182
end
8283
for k in 1:n
83-
push!(I_full, k); push!(J_full, k) # diagonal
84+
push!(I_full, k);
85+
push!(J_full, k) # diagonal
8486
end
85-
mat_sym = SparseArrays.sparse(I_full, J_full, trues(length(I_full)), n, n, |)
87+
mat_sym =
88+
SparseArrays.sparse(I_full, J_full, trues(length(I_full)), n, n, |)
8689

8790
# Perform coloring on full symmetric matrix
8891
S = SMC.SparsityPatternCSC(mat_sym)
@@ -104,7 +107,14 @@ function _hessian_color_preprocess(
104107
J_global = [local_indices[j] for j in J_low_csc]
105108

106109
# Build lower-triangular sparse matrix to obtain its colptr
107-
mat_low = SparseArrays.sparse(I_low_csc, J_low_csc, trues(length(I_low_csc)), n, n, |)
110+
mat_low = SparseArrays.sparse(
111+
I_low_csc,
112+
J_low_csc,
113+
trues(length(I_low_csc)),
114+
n,
115+
n,
116+
|,
117+
)
108118

109119
full_buffer = Vector{Float64}(undef, SparseArrays.nnz(mat_sym))
110120

@@ -170,7 +180,13 @@ function _recover_from_matmat!(
170180
stored_values::AbstractVector{T},
171181
) where {T}
172182
# Decompress into the full symmetric buffer, then extract lower-triangular values.
173-
SMC.decompress_csc!(result.full_buffer, result.full_colptr, R, result.result, :F)
183+
SMC.decompress_csc!(
184+
result.full_buffer,
185+
result.full_colptr,
186+
R,
187+
result.result,
188+
:F,
189+
)
174190
for k in eachindex(V)
175191
V[k] = result.full_buffer[result.lower_pos[k]]
176192
end

0 commit comments

Comments
 (0)