File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ struct MatrixVectorAffineFunction{AT,VT} <: MOI.AbstractVectorFunction
239
239
terms:: AT
240
240
constants:: VT
241
241
end
242
+
242
243
MOI. constant (func:: MatrixVectorAffineFunction ) = func. constants
243
244
function Base. convert (
244
245
:: Type{MOI.VectorAffineFunction{T}} ,
@@ -269,14 +270,22 @@ function MOIU.isapprox_zero(
269
270
return MOIU. isapprox_zero (standard_form (func), tol)
270
271
end
271
272
272
- _scalar (:: Type{<:MatrixVectorAffineFunction} ) = VectorScalarAffineFunction
273
- _scalar (:: Type{<:SparseVectorAffineFunction} ) = SparseScalarAffineFunction
273
+ function MOI. Utilities. scalar_type (:: Type{<:MatrixVectorAffineFunction} )
274
+ return VectorScalarAffineFunction
275
+ end
276
+
277
+ function MOI. Utilities. scalar_type (:: Type{<:SparseVectorAffineFunction} )
278
+ return SparseScalarAffineFunction
279
+ end
274
280
275
281
function Base. getindex (
276
282
it:: MOI.Utilities.ScalarFunctionIterator{F} ,
277
283
output_index:: Integer ,
278
284
) where {F<: Union{MatrixVectorAffineFunction,SparseVectorAffineFunction} }
279
- return _scalar (F)(it. f. terms[output_index, :], it. f. constants[output_index])
285
+ return MOI. Utilities. scalar_type (F)(
286
+ it. f. terms[output_index, :],
287
+ it. f. constants[output_index],
288
+ )
280
289
end
281
290
282
291
function _index_map_to_oneto! (index_map, v:: MOI.VariableIndex )
You can’t perform that action at this time.
0 commit comments