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 Model being scalar-only makes the overhead of constructing the Model quite large, even though the final representation should be close to what I already have.
Describe the solution you'd like
I see that Elemental already has vectorized APIs, e.g. both add_element and add_elements, so it seems logical to me that Model could similarly have add_variables that 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 Elemental directly 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.
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.