I’m trying to solve a system of differential equations involving variational inequalities. I’m currently using the LCP solver in LCPsolve.jl. I’ve profiled my code and found that the bottleneck is in lines 216-219 here. More specifically, the profiler highlights the multiplication and sum in:
H = Jk'*Jk + μ*I
where Jk
is a sparse matrix with size that varies within the for
loop (but always smaller than 150x150) and
typeof(Jk) = SparseMatrixCSC{Float64, Int64}
typeof(μ) = Float64
It also seems that those steps also allocate memory. The other operation highlighted by the profiler is
-(cholesky(H)\Jphi)
where
typeof(H) = SparseMatrixCSC{Float64, Int64}
typeof(Jphi) = Vector{Float64}
Is there a way to improve the performance and/or memory allocation of those steps? Thank you!