-
Notifications
You must be signed in to change notification settings - Fork 98
Allow creating model from parts #2902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Tests please |
|
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) |
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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 ^^
|
I don't understand the codecov missing lines, it's reporting the signature of function as not covered but then its body is covered... |
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