The OPTMODEL Procedure

SAVE QPS Statement

SAVE QPS SAS-data-set;

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;
 


Obs FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 FIELD6
1 NAME   QPSData .   .
2 ROWS     .   .
3 N z   .   .
4 L c1   .   .
5 G c2   .   .
6 COLUMNS     .   .
7   x[1] z 2.0 c1 1
8   x[1] c2 1.0   .
9   x[2] z 3.0 c1 -1
10   x[2] c2 2.0   .
11 RHS     .   .
12   .RHS. c1 1.0   .
13   .RHS. c2 100.0   .
14 QSECTION     .   .
15   x[1] x[1] 2.0   .
16   x[1] x[2] 2.5   .
17   x[2] x[2] 20.0   .
18 ENDATA     .   .


Figure 6.27: The QPS Data Set Generated by SAVE QPS Statement

Previous Page | Next Page | Top of Page