QuadraticObjective

class QuadraticObjective(quadratic_program, constant=0.0, linear=None, quadratic=None, sense=ObjSense.MINIMIZE)[source]

Representation of quadratic objective function of the form: constant + linear * x + x * quadratic * x.

Constructs a quadratic objective function.

Parameters
  • quadratic_program (Any) – The parent quadratic program.

  • constant (float) – The constant offset of the objective.

  • linear (Union[ndarray, spmatrix, List[float], Dict[Union[int, str], float], None]) – The coefficients of the linear part of the objective.

  • quadratic (Union[ndarray, spmatrix, List[List[float]], Dict[Tuple[Union[int, str], Union[int, str]], float], None]) – The coefficients of the quadratic part of the objective.

  • sense (ObjSense) – The optimization sense of the objective.

Attributes

QuadraticObjective.constant

Returns the constant part of the objective function.

QuadraticObjective.linear

Returns the linear part of the objective function.

QuadraticObjective.quadratic

Returns the quadratic part of the objective function.

QuadraticObjective.quadratic_program

Returns the parent QuadraticProgram.

QuadraticObjective.sense

Returns the sense of the objective function.

Methods

QuadraticObjective.evaluate(x)

Evaluate the quadratic objective for given variable values.