Skip to content

Commit 72ebe6e

Browse files
committed
Sparse hessian structure function.
1 parent 3a84b94 commit 72ebe6e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/models/solve_allocation_by_duality.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function hessian_structure_duality(auxdata)
127127
param = auxdata.param
128128

129129
# Create the Hessian structure
130-
H_structure = sparse(tril(repeat(I(graph.J), param.N, param.N) + kron(I(param.N), graph.adjacency)))
130+
H_structure = tril(repeat(sparse(I(graph.J)), param.N, param.N) + kron(sparse(I(param.N)), sparse(graph.adjacency)))
131131

132132
# Get the row and column indices of non-zero elements
133133
rows, cols, _ = findnz(H_structure)
@@ -136,7 +136,6 @@ end
136136

137137

138138
# Hessian computation function
139-
140139
function hessian_duality(
141140
x::Vector{Float64},
142141
rows::Vector{Int32},

0 commit comments

Comments
 (0)