Python: vector/matrix APIs for adding variables/constraints on mathopt Model
#5181
Unanswered
nardi-gradyent
asked this question in
Feature requests
Replies: 1 comment
-
|
do you need incrementality or not. Because the API usage looks likely one-shot. Which solver are you calling ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What language and solver does this apply to?
Python, all solvers (mathopt interface).
Describe the problem you are trying to solve.
I have some large LPs/QPs (say ~50000 constraints) in a matrix form in my Python code (numpy/scipy arrays). I'd like to use MathOpt as a layer between my code and the actual solver, but the APIs on
Modelbeing scalar-only makes the overhead of constructing theModelquite large, even though the final representation should be close to what I already have.Describe the solution you'd like
I see that
Elementalalready has vectorized APIs, e.g. bothadd_elementandadd_elements, so it seems logical to me thatModelcould similarly haveadd_variablesthat can be used to add a large number of variables at once, and the same for constraints.Describe alternatives you've considered
I could use
Elementaldirectly to build the proto describing the model, but at that point I'm basically building this interface myself :)Additional context
I see that this issue has been raised before (#1020), though quite long ago and in the context of pywraplp.
Beta Was this translation helpful? Give feedback.
All reactions