NLPModels.jl
NLPModels.jl copied to clipboard
Integrate SparseMatricesCOO
Should I modify
function jprod!(
nlp::AbstractNLPModel,
rows::AbstractVector{<:Integer},
cols::AbstractVector{<:Integer},
vals::AbstractVector,
v::AbstractVector,
Jv::AbstractVector,
)
to something like
function jprod!(
nlp::AbstractNLPModel,
M::SparseMatrixCOO{T, <: Integer},
v::AbstractVector,
Jv::AbstractVector,
) where {T}
? This may break a lot of code, but otherwise I would have to use the SparseMatrixCOO constructor at each product.
We should think of a complete integration of SparseMatricesCOO. NLPModels could return sparse Jacobians and Hessians in COO format. Then we need to update methods to update the elements of those matrices. After that, I'm not sure if jprod!(nlp, rows, cols, vals, v, Jv), etc., still make much sense.
Maybe a first step along this way, would be to replace the following two functions by SparseMatrixCOO functions:
- [ ]
coo_prod!https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/3b5ec8eedf78eaa609447456f69e01f55f0209ca/src/nlp/utils.jl#L76 - [ ]
coo_sym_prod!https://github.com/JuliaSmoothOptimizers/NLPModels.jl/blob/3b5ec8eedf78eaa609447456f69e01f55f0209ca/src/nlp/utils.jl#L99