MOI.VectorAffineFunction type is used to define linear vector valued functions in MathOptInterface. I am trying to extract a row of such an object itself with type
VectorAffineFunction, for example with
f = MOI.VectorAffineFunction( [MOI.VectorAffineTerm(1, MOI.ScalarAffineTerm(1, y)), MOI.VectorAffineTerm(2, MOI.ScalarAffineTerm(1, x1)), MOI.VectorAffineTerm(2, MOI.ScalarAffineTerm(10, x2)), ], [0.0, 0.0], ) Is there a good way of doing this? I am trying to avoid messing around too much with loops over the output index for each term.
Loops over the output index are the way to go.
f is a
i is an integer between
MOI.Utilities.eachscalar(f)[i] gives a
MOI.Utilities.eachscalar(f)[[i]] gives a
Ah, I keep forgetting about