jump-dev / MatrixOptInterface.jl

An interface to pass matrix form problems
MIT License
11 stars 4 forks source link

MOI to MatOI #7

Closed akshay326 closed 3 years ago

akshay326 commented 4 years ago

My bad. Took a whole week. But generates matrices!

akshay326 commented 4 years ago

Almost the same code as https://github.com/jump-dev/SCS.jl/blob/master/src/MOI_wrapper.jl tested and works on COSMO, ProxSDP too

codecov[bot] commented 4 years ago

Codecov Report

Merging #7 into master will decrease coverage by 3.22%. The diff coverage is 79.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
- Coverage   86.14%   82.91%   -3.23%     
==========================================
  Files           3        5       +2     
  Lines         166      281     +115     
==========================================
+ Hits          143      233      +90     
- Misses         23       48      +25     
Impacted Files Coverage Δ
src/MatrixOptInterface.jl 88.00% <ø> (ø)
src/conic_form.jl 79.00% <79.00%> (ø)
src/sparse_matrix.jl 80.00% <80.00%> (ø)
src/matrix_input.jl 98.41% <0.00%> (-0.12%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f42e602...0544031. Read the comment docs.

blegat commented 4 years ago

Nice, could you adapt it to be closer to the matrix.jl and geometric.jl files in https://github.com/jump-dev/SCS.jl/pull/192 ?

akshay326 commented 4 years ago

Thanks for this contribution! I have just an overall question: is there some plan to add a function getLinearForm, similar in spirit as getConicForm but for linear problems? If so, how hard it would be to adapt the function getConicForm to the linear case?

we did'nt plan getting the linear case. although it shudn't be much difficult - i tried extracting the matrices given LessThan, EqualTo, GreaterThan constraints

matbesancon commented 4 years ago

is there a specific convention on using double underscore for functions? It doesn't read that well

akshay326 commented 4 years ago

is there a specific convention on using double underscore for functions? It doesn't read that well

yep removed them now

akshay326 commented 4 years ago

having a hard time moving from get_conic_form to MOI.copy_to. @blegat can u share some example using MOI.copy_to on GeometricConicForm in action

blegat commented 4 years ago

If I understand correctly, you need something close to get_conic_form for DiffOpt. If copy_to is given, you can do something like:

function get_conic_form(::Type{T}, src::MOI.ModelLike, con_idx)
    dest = ConicForm{T, ...}()
    idxmap = MOI.copy_to(dest, src)
    return dest
end

except that you only need the constraints in con_idx, is that right ? Do you need to filter the constraints for DiffOpt or is a matrix with all constraints sufficient ?

akshay326 commented 4 years ago

took a lot of time but using MOI.copy_to now! finally I understand that I was using a lot of SCS specific code