File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ struct MatrixVectorAffineFunction{AT,VT} <: MOI.AbstractVectorFunction
239239 terms:: AT
240240 constants:: VT
241241end
242+
242243MOI. constant (func:: MatrixVectorAffineFunction ) = func. constants
243244function Base. convert (
244245 :: Type{MOI.VectorAffineFunction{T}} ,
@@ -269,14 +270,23 @@ function MOIU.isapprox_zero(
269270 return MOIU. isapprox_zero (standard_form (func), tol)
270271end
271272
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
280+
274281
275282function Base. getindex (
276283 it:: MOI.Utilities.ScalarFunctionIterator{F} ,
277284 output_index:: Integer ,
278285) where {F<: Union{MatrixVectorAffineFunction,SparseVectorAffineFunction} }
279- return _scalar (F)(it. f. terms[output_index, :], it. f. constants[output_index])
286+ return MOI. Utilities. scalar_type (F)(
287+ it. f. terms[output_index, :],
288+ it. f. constants[output_index],
289+ )
280290end
281291
282292function _index_map_to_oneto! (index_map, v:: MOI.VariableIndex )
You can’t perform that action at this time.
0 commit comments