Skip to content

Conversation

@blegat
Copy link
Member

@blegat blegat commented Dec 9, 2025

We allow the users to create the model without using the MOI interface which might seem scary.
But this will probably only be used either by advanced users or using something like jump-dev/MatrixOptInterface.jl#35

Needed for jump-dev/MatrixOptInterface.jl#35

@odow
Copy link
Member

odow commented Dec 15, 2025

Tests please

@blegat
Copy link
Member Author

blegat commented Dec 19, 2025

I'll first make jump-dev/MatrixOptInterface.jl#35 and then take a miniature version of jump-dev/MatrixOptInterface.jl#35 as test here

v.caches =
[Tuple{_affine_function_type(T, S),S}[] for S in set_types(v.sets)]
v.are_indices_mapped = [BitSet() for _ in eachindex(v.caches)]
_reset_caches!(v)
Copy link
Member Author

@blegat blegat Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These caches actually only make sense for MutableSparseMatrixCSC, it doesn't make sense for a SparseMatrixCSC nor for a MutableSparseMatrixCSR but let's not complicate this PR too much


function extract_function(
A::MutableSparseMatrixCSC{T},
A::_SparseMatrixCSC{T},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can either implement it for SparseMatrixCSC here or implement it in MatrixOptInterface.
The issue of the second option is that it's type piracy and it's just a copy-paste.
One might then ask for exctract_function for Base.Matrix or Transpose{SparseMatrixCSC{Tv,Ti}} etc... But let's keep this PR simple. I think, implementing Matrix, SparseMatrixCSC and their adjoint/transpose should be good enough for 99% of the cases of this use case which is already niche ^^

@blegat
Copy link
Member Author

blegat commented Dec 21, 2025

I don't understand the codecov missing lines, it's reporting the signature of function as not covered but then its body is covered...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants