substitute_dict[variables[i].name] = float(result.x[i])
substituted_qp = self._src.substitute_variables(substitute_dict)
new_result = copy.deepcopy(result)new_result.x = result.x
// Set the new function value
new_result.fval = substituted_qp.objective.constant
// Set the new status of optimization result
if substituted_qp.status == QuadraticProgramStatus.VALID:
new_result.status = OptimizationResultStatus.SUCCESS
else:
new_result.status = OptimizationResultStatus.INFEASIBLE
return new_result
@property
def penalty(self) -> Optional[float]:
Returns the penalty factor used in conversion.