Giter Club home page Giter Club logo

Comments (13)

mlubin avatar mlubin commented on June 30, 2024 4

Send everything to the solver as a VectorAffineFuntion in Nonpositives/Zeros?

No, we'll be providing the same constraints to the solver as the user provided to us.

We can try:

addconstraints!(::SolverInstance,::Vector{F},::Vector{S})

The solver can build a sparse matrix based on this and give all the constraints to the solver at once. We'd normally have to call this function three times, once for each of LessThan, GreaterThan, and EqualTo. That's better than 100,000 times for a problem with 100,000 constraints.

from mathoptinterface.jl.

mlubin avatar mlubin commented on June 30, 2024 1

Actually can we just overload the broadcast syntax to intercept addconstraint!.(...)?

from mathoptinterface.jl.

IssamT avatar IssamT commented on June 30, 2024 1

similarly to addconstraints!, deleteconstraints! would be useful too

from mathoptinterface.jl.

joaquimg avatar joaquimg commented on June 30, 2024

I posted this comment in jump-dev/CPLEX.jl#139

For Xpress there is a 10x speed and memory difference between adding variables 1 by 1 and adding them in a batch.
https://gist.github.com/joaquimg/5dbaf83e7555b94d79f4d01f8ed53119

from mathoptinterface.jl.

mlubin avatar mlubin commented on June 30, 2024

I expect we'll have to put a bit of work into efficiently moving the data from the JuMP Instance to the SolverInstance, but we can already create all of the variables at once with the current interface. Adding constraints one-by-one is potentially more of a performance issue.

from mathoptinterface.jl.

joaquimg avatar joaquimg commented on June 30, 2024

Very similar result for constraints:
https://gist.github.com/joaquimg/68c67de76eea7adea0b9ab880c667dfc

from mathoptinterface.jl.

joaquimg avatar joaquimg commented on June 30, 2024

What are you planning to do with instance?

Send everything to the solver as a VectorAffineFuntion in Nonpositives/Zeros?

Otherwise, I can only see the solver having to figure out when to add everything, and then load is very important. Moreover, load and SolverInstance become a bit complex, since they will have to do some bookkeeping.

Any ideas?

from mathoptinterface.jl.

joaquimg avatar joaquimg commented on June 30, 2024

3 (actually once per Set + Function combination) times should be fine.
I like this proposal.

from mathoptinterface.jl.

mlubin avatar mlubin commented on June 30, 2024

This can also be used to pass in all bounds, integrality constraints, etc.

from mathoptinterface.jl.

joaquimg avatar joaquimg commented on June 30, 2024

yep!

from mathoptinterface.jl.

mlubin avatar mlubin commented on June 30, 2024

No, not really (JuliaLang/julia#22053 (comment)):

Overriding broadcast for particular functions should ordinarily not be done, and at most should be done as an optimization only. Because of fusion, it will never be possible to guarantee that broadcast(::typeof(f), ...) is called for a particular f.

Seems a bit flimsy.

from mathoptinterface.jl.

mlubin avatar mlubin commented on June 30, 2024

It's just called delete!. No objection to defining a method for deleting a vector of references.

from mathoptinterface.jl.

odow avatar odow commented on June 30, 2024

Closing because we don't seem to have needed this or made progress. We have all the plural methods, it's just up to JuMP to plumb them through.

from mathoptinterface.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.