@@ -160,6 +160,10 @@ function _affine_build_change_and_up_param_func(
160160 return changes
161161end
162162
163+ # TODO
164+ # This function is currently commented out because there is no vector version
165+ # of MOI.ScalarCoefficientChange.
166+ # For the update the entire MOI.ConstraintFunction must be updated
163167# function _affine_build_change_and_up_param_func(
164168# pf::ParametricVectorQuadraticFunction{T},
165169# delta_terms,
@@ -298,6 +302,15 @@ function update_parameters!(model::Optimizer)
298302 end
299303 end
300304
305+ # Different from the above cases, it is not possible to update
306+ # vector function in-place because there is no vector version of
307+ # MOI.ScalarCoefficientChange.
308+ # Therefore, vector quadratic function must be update via
309+ # MOI.ConstraintFunction that replaces the entire function.
310+ # Consequently, this operation is much slower.
311+ # Moreover, to perform the update, it is easier to use the
312+ # current_function code, hence, this update must be executed
313+ # after the update of the parameters cache (the loop above).
301314 _update_vector_quadratic_constraints! (model)
302315
303316 return
@@ -361,23 +374,6 @@ function _delta_parametric_constant(
361374 return delta_constants
362375end
363376
364- function _quadratic_build_change_and_up_param_func! (
365- pf:: ParametricVectorQuadraticFunction{T} ,
366- delta_quad_terms:: Dict{Int, Vector{MOI.ScalarQuadraticTerm{T}}}
367- ) where {T}
368- for (output_idx, terms) in delta_quad_terms
369- if haskey (pf. quadratic_terms_with_p, output_idx)
370- for term in terms
371- # Update the current coefficient in the parametric function
372- for (vars, coeff_info) in pf. quadratic_terms_with_p[output_idx]
373- param_coeff, current_coeff = coeff_info
374- pf. quadratic_terms_with_p[output_idx][vars] = (param_coeff, current_coeff + term. coefficient)
375- end
376- end
377- end
378- end
379- end
380-
381377function _update_vector_quadratic_constraints! (
382378 model:: Optimizer ,
383379 vector_quadratic_constraint_cache_inner:: DoubleDictInner{F,S,V} ,
0 commit comments