QP

The QP command gives the solution to a quadratic programming problem.

In general, the format is:

  QP c Q A b / options

OR

  QP c Q / UNCONSTR options


The available options are:

Option Description
CHOLSPEC Used if the user wishes to supply the Cholesky decomposition of the objective matrix Q. In this case, the Cholesky decomposition must be contained in the lower half of the input matrix Q.
DUMP Prints information for SHAZAM consultants.
MIN Indicates that the problem is a MINimization problem.
NEGDEF Indicates that the quadratic matrix in the objective function, Q for a minimization problem, or –Q for a maximization problem, is not positive definite.
PDUAL Calculates and prints the dual solution. This is the default. Specify NOPDUAL to suppress consideration of the dual problem.
UNCONSTR Must be used if a problem is unconstrained.
CONV= As defined for the NL command. Used when solving the least squares sub-problems when METHOD=STEP. The default is CONV=10-6.
DIAGR= If NEGDEF and METHOD=POWELL are specified, the multiple of the identity matrix added to the quadratic matrix, Q for minimization, or -Q for maximization problems, will be at most the value of this option times the smallest multiple that makes the matrix positive definite.
DUAL= Saves the dual solution in the vector specified.
IFACT= Saves the indices of the final active constraints, applicable when using METHOD=POWELL.
ITER= Specifies the maximum number of iterations. The default number is ITER=40(N+M).
LAGRANGE= Saves the Lagrange multipliers of the final active constraints, applicable when using METHOD=POWELL.
LOWER= Specifies the lower bounds of the solution and should be a vector of length N.
LOWSCAL= Specifies a scalar which is applied as the lower bound on all variables. METHOD=STEP allows only LOWSCAL=0.
MEQ= Indicates the number of constraints that are equality constraints.
METHOD= Specifies the method to be used for the solution of the quadratic programming problem. The default is METHOD=POWELL, as described by Powell [1983]. The alternative is METHOD=STEP.
PRIMAL= Saves the primal solution in the vector specified.
UPPER= Specifies the upper bounds of the solution and should be a vector of length N.
UPSCAL= Specifies a scalar which is applied as the upper bound on all variables.
ZEROTOL= Used in both methods to set the threshold below which numbers are assumed to be zero.

The temporary variable $ERR stores the Error Code.

The temporary variable $VAL stores the value of the objective function.

The temporary variable $T1 stores the number of variables in the problem, N.

The temporary variable $T2 stores the number of constraints in the problem, M.

The temporary variable $T3 stores the he multiple of the identity matrix added to the objective function matrix to force it to be positive definite.