def set_objective(self, objective, extraobjexpr=None):
        """Set or change the objective function of the polynomial optimization
        problem.

        :param objective: Describes the objective function.
        :type objective: :class:`sympy.core.expr.Expr`
        :param extraobjexpr: Optional parameter of a string expression of a
                             linear combination of moment matrix elements to be
                             included in the objective function
        :type extraobjexpr: str.
        """
        if objective is not None and self.matrix_var_dim is not None:
            facvar = self.__get_trace_facvar(objective)
            self.obj_facvar = facvar[1:]
            self.constant_term = facvar[0]
            if self.verbose > 0 and facvar[0] != 0:
                print("Warning: The objective function has a non-zero %s "
                      "constant term. It is not included in the SDP objective."
                      % facvar[0])
        else:
            super(SteeringHierarchy, self).\
              set_objective(objective, extraobjexpr=extraobjexpr)
def set_objective ( self , objective , extraobjexpr = None ) : if objective is not None and self . matrix_var_dim is not None : facvar = self . __get_trace_facvar ( objective ) self . obj_facvar = facvar [ 1 : ] self . constant_term = facvar [ 0 ] if self . verbose > 0 and facvar [ 0 ] != 0 : print ( "Warning: The objective function has a non-zero %s " "constant term. It is not included in the SDP objective." % facvar [ 0 ] ) else : super ( SteeringHierarchy , self ) . set_objective ( objective , extraobjexpr = extraobjexpr )
Set or change the objective function of the polynomial optimization
        problem.

        :param objective: Describes the objective function.
        :type objective: :class:`sympy.core.expr.Expr`
        :param extraobjexpr: Optional parameter of a string expression of a
                             linear combination of moment matrix elements to be
                             included in the objective function
        :type extraobjexpr: str.