The OPTMODEL Procedure |
The SAVE QPS statement saves the structure and coefficients for a quadratic programming model into a SAS data set. This data set can be used as input data for the OPTQP procedure.
Note: The OPTMODEL presolver (see the section "Presolver") is automatically bypassed so that the statement saves the original model without eliminating fixed variables, tightening bounds, etc.
The SAS-data-set argument specifies the output data set name and options. The output data set uses the QPS format described in Chapter 14. The generated data set contains observations that define different parts of the quadratic program.
Variables, constraints, and objectives are referenced in the data set by using label text based on the model name. For example, a model variable x[1] would be labeled "x[1]" in the data set. Labels are limited by default to 32 characters and are abbreviated to fit. You can change the maximum length for labels by using the MAXLABLEN= option. When needed, a programmatically generated number is added to labels to avoid duplication. Only the most recent objective, which was specified in a MIN or MAX declaration or specified in a SOLVE statement, is included in the output data set. The coefficients of the objective function appear in the QSECTION section.
The following code shows an example of the SAVE QPS statement. The model is specified using the OPTMODEL procedure. Then it is saved as the QPS data set QPSData, as shown in Output 6.27. Next, PROC OPTQP is used to solve the resulting quadratic program.
proc optmodel; var x{1..2} >= 0; min z = 2*x[1] + 3 * x[2] + x[1]**2 + 10*x[2]**2 + 2.5*x[1]*x[2]; con c1: x[1] - x[2] <= 1; con c2: x[1] + 2*x[2] >= 100; save qps QPSData; quit; proc optqp data=QPSData pout=PrimalOut dout=DualOut; run;
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.