QuadraticObjective¶
- class QuadraticObjective(quadratic_program, constant=0.0, linear=None, quadratic=None, sense=ObjSense.MINIMIZE)[fuente]¶
Bases:
QuadraticProgramElement
Representation of quadratic objective function of the form: constant + linear * x + x * quadratic * x.
Constructs a quadratic objective function.
- Parámetros:
quadratic_program (Any) – The parent quadratic program.
constant (float) – The constant offset of the objective.
linear (ndarray | spmatrix | List[float] | Dict[int | str, float] | None) – The coefficients of the linear part of the objective.
quadratic (ndarray | spmatrix | List[List[float]] | Dict[Tuple[int | str, int | str], float] | None) – The coefficients of the quadratic part of the objective.
sense (ObjSense) – The optimization sense of the objective.
Attributes
Returns the constant part of the objective function.
Returns the linear part of the objective function.
Returns the quadratic part of the objective function.
Returns the parent QuadraticProgram.
Returns the sense of the objective function.
Methods
evaluate
(x)Evaluate the quadratic objective for given variable values.
Evaluate the gradient of the quadratic objective for given variable values.