79550522

Date: 2025-04-02 11:49:48
Score: 1
Natty:
Report link

The QuadraticSum constructor takes in a heterogeneous list of numbers, linear expresisons and quadratic expressions, and adds them up. So objective_2 is just x+y in your code.

Generally, you do not need to invoke that constructor/use that type directly, just use operator overloads, QuadraticExpression(), and mathopt.fast_sum()

https://github.com/google/or-tools/blob/stable/ortools/math_opt/python/expressions.py#L27

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Ross Anderson