Open blegat opened 3 years ago
So we would represent the quadratic part with an abstract matrix right?
The objective would be an MOI.AbstractScalarFunction
. The plan is to have matrix forms be parametrization of MOIU.GenericModel
(see https://github.com/jump-dev/MathOptInterface.jl/issues/1261).
It would be parametrized by
1) the objective type
2) the container for variable constraints
3) the container for other constraints
Currently, in MOIU.GenericModel
, the objective type is hardcoded as Union{MOI.SingleVariable, MOI.ScalarAffineFunction{T}, MOI.ScalarQuadraticFunction{T}
however, this type should be a parameter of MOIU.GenericModel
instead.
Then, similarly to how https://github.com/jump-dev/MathOptInterface.jl/pull/1238
got ScalarAffineFunction
generalized with the AbstactVector
of terms, we could generalize ScalarQuadraticFunction
with an AbstractMatrix
of terms. One option could be to store the coefficients in a sparse matrix.
Given that in MatOI we take and store the elements of the optimization problem directly as matrices and vectors, I would be for the second option of having an abstract matrix
See https://github.com/oxfordcontrol/COSMO.jl/issues/126 This might be breaking as it changes the type