The Utility Subroutines


Making Copies of the Matrix for Your Use (EKKCOPY)

EKKCOPY creates a user copy of the current model's constraint matrix in high storage. Unless you call EKKPOPS, this copy will never be overwritten by a Library module. In fact, no Library modules will reference this copy itself. There are times when you may want a matrix copy that is not used by Library modules. Possible uses for such a copy might include:

For an example of the use of EKKCOPY with EKKPSHS and EKKPOPS, refer to "Saving and Restoring Model Information in Storage."


Adding, Replacing, Getting, or Deleting Columns and Rows (EKKCOL and EKKROW)

EKKCOL and EKKROW allow you to add, replace, get, or delete columns and rows, respectively, from the current model's constraint matrix. Refer to "EKKCOL - Add, Replace, Get, or Delete a Column in the Problem Matrix" and "EKKROW - Add, Replace, Get, or Delete a Row in the Problem Matrix" for details.
 

Note:

Only the last column or row can be deleted with EKKCOL and EKKROW. However, a column or row can be replaced with all zeros, which has the same effect. EKKNWMT can be called later to compress out the zeros. 

Typically, you would use EKKCOL and EKKROW to make minor modifications to an existing model. Major changes to a model's constraint matrix should probably be done by adding a block with EKKDSCB or EKKRPTB. Note that when adding a new row or column, the appropriate bounds and objective function entries must also be added. That is, you must specifically add row bounds for a newly added row, and you must specifically add column bounds and an objective function entry for a newly added column. This is done by using EKKNGET to determine the location of the bounds and objective function arrays and adding the necessary elements. The starting locations of the bounds are given by the index control variables Ncollower, Ncolupper, Nrowlower, and Nrowupper. The starting location of the objective function coefficients is given by the value of the indes control variable Nobjective.

Space must be available in order to add columns or rows. This is ensured by setting the integer control variables Imaxcols and Imaxrows as explained in the subroutine descriptions of EKKCOL and EKKROW. 


Getting and Putting Model Data (EKKGTMD and EKKPTMD)

EKKGTMD and EKKPTMD allow you to retrieve a model from a file and save a model in a file for later use. When a previously saved model is restored or saved, control variable information and the common blocks that hold other problem information as well as model data is restored or saved.
 

Note:

EKKGTMD and EKKPTMD cannot be used to retrieve and store quadratic programming models. 

Controlling EKKGTMD and EKKPTMD

The processing of EKKGTMD and EKKPTMD is primarily controlled by the value of the integer control variable Imodelmask. This variable informs these subroutines which parts of the model are to be restored from or saved in a file. The default setting of Imodelmask will inform EKKGTMD and EKKPTMD to restore or save all information.

As its name implies, Imodelmask is a mask. That is, you set one bit of the mask to get one type of processing. For example, setting Imodelmask to 4 tells EKKGTMD to restore and EKKPTMD to save just the names of the rows and columns from a file. To get more than one type of processing, set all the corresponding bits. For example, if you want to save or restore the names of the rows and columns and the status of each variable, you would set Imodelmask to 12 (12 = 4 + 8). For a list of all the settings for Imodelmask, see Appendix C. "Control Variables". For further information on masks, see "Control Variable Bit Masks".

Using EKKGTMD and EKKPTMD

Typically, you would use EKKGTMD and EKKPTMD to restore and save models between application programs. For example, your first application program may start processing a model and then detect some condition that warrants stopping the program. Before stopping the program, a call could be made to EKKPTMD to save the model in a file. Then, when the second application program is started, it could call EKKGTMD to restore the model that was saved in the file and continue processing.

You may also use EKKGTMD and EKKPTMD within a single application program to restore and save models. If you do this, then you must call EKKGTMI before you call EKKGTMD in order to restore pointer information for the model that is not saved by EKKPTMD. In addition, EKKGTMD calls EKKDSCM allowing for one block in the matrix if EKKDSCM had not been called previously for the model being restored. In most cases, it is easier to use EKKGTMI and EKKPTMI to restore and save models within a single application program.

Other Considerations

The information written by EKKPTMD contains unprintable characters and is unique to EKKPTMD/EKKGTMD. You should not attempt to edit this file. If you do, EKKGTMD may be unable to restore the information contained in the file. In addition, although branch and bound information is restored and saved by EKKGTMD and EKKPTMD, if the munit or bunit parameters in the call to EKKMSLV are nonzero, you should also restore and save the direct access files used by EKKMSLV. Restoration may be done by connecting the files to the FORTRAN unit numbers, as described in "Processing Your Program".

Before returning, both EKKGTMD and EKKPTMD issue C equivalents to the FORTRAN REWIND statement. 


Computing a Matrix Vector Product (EKKGEMV)

EKKGEMV computes (y by + aA x) or (y by + aATx). A is the current constraint matrix, which has dimension m × n, where m is the value of the integer control variable Inumrows, and n is the value of the integer control variable Inumcols. x is a vector of length n, and y is a vector of length m.

For an example, refer to the Dantzig-Wolfe decomposition sample program in Appendix B, "Sample FORTRAN Program EXDANWOL"


Solving a Basic System of Equations (EKKGES)

EKKGES solves AB x = b or ABTx = b , where b and x have length m, AB is a matrix of dimensions m × m, and m is the value of the integer control variable Inumrows. EKKGES is normally used in conjunction with EKKINVT.

For an example, refer to the sample program, "Sample FORTRAN Program EXGES"


Invert: Create the Primal and Dual Solutions Corresponding to a Given Basis (EKKINVT)

EKKINVT creates the primal and dual solutions corresponding to a given basis. This subroutine is used whenever a solution is required using a given basis. For example, this can be used after a call to EKKBASI.

This subroutine solves the system Ax = b by solving AB xB = b - AN xN , in effect inverting the matrix AB. It factors AB into the product of a lower triangular matrix, L , and an upper triangular matrix, U, so that AB = LU. It then solves for xB, where:

xB has length m,
xN has length n - m,
AB has dimension m × m,
L has dimension m × m,
U has dimension m × m,
AN has dimension m × (n - m),
m is the value of the integer control variable Inumrows, and
n is the value of the integer control variable Inumcols.

For an example, refer to the sample application program EXGES.


Creating, Changing, or Retrieving Row and Column Names (EKKNAME)

EKKNAME provides a convenient way to create, change, or retrieve the row or column names of the current matrix. You may add names, change existing names, or retrieve names for use in your application program. In any case, you may allow names to be generated for all rows and columns.

Control Variables

The processing of EKKNAME is controlled by the values of the integer control variables Imaxrows, Imaxcols, and Inumchar. Because fixed amounts of space are reserved based on the values of these variables, and because the interpretation of the data in the name arrays is based on the value of Inumchar, you should set Inumchar before your model is passed. If you are adding rows or columns, you should also set Imaxrows and Imaxcols. Once set, do not alter these values in the course of your application program. To do so may mean unpredictable results.

Using EKKNAME

If you have passed your model using EKKLMDL or EKKNMDL and you will be using row or column names, you need to call EKKNAME to create space for row and column names. EKKNAME reserves space in high storage for names, allowing for a number of row and column names equal to the current values of Imaxrows and Imaxcols, respectively. The maximum number of characters allowed for each name is equal to the current value of Inumchar. If space for names already exists (that is, if your model were entered using EKKMPS or EKKSMDL, or if EKKNAME were called previously), then this step is bypassed.

Any name you specify replaces the existing name for the particular row or column. All other row and column names remain the same, unless you specify that EKKNAME should generate the names. In that case, EKKNAME replaces all other names with a generated name.

The generated names have the form Rnnnnnnn for rows and Cnnnnnnn for columns, where nnnnnnn represents the number of the row or column, prepended with leading zeros. Unlike EKKBASO and EKKBCDO, which generate only temporary names for printing, these names are actually stored in the arrays set up for names. If the value of Inumchar is less than eight, these names will be truncated so that only the first Inumchar characters are used. In this case, the names may (almost surely will) lose their uniqueness, and duplicate names could result. It is not advisable to set Inumchar to a value less than eight, without due consideration for the consequences. If the value of Inumchar is greater than eight, then the generated names will be padded with blanks so that the length of the name matches the value of Inumchar.

You may provide more names than you specify. Only the number of row or column names you specify will be used from among the names you provide. If the number of names you specify is greater than the number of names that you provide, unpredictable results may occur.

EKKNAME checks to see if the number of row names you specify is greater than the number of rows from the starting row to Imaxrows. If the number of row names you specify exceeds the number of rows that remain, EKKNAME uses only the number of names that can fit. If this situation occurs, warning messages are issued. The case of the number of column names you specify being greater than the number of columns from the starting column to Imaxcols is analyzed and treated similarly.

When you declare the array of names that you pass to EKKNAME, you should organize it by character strings of length equal to Inumchar. Unpredictable results may occur if this is not done, since EKKNAME reads data from the array based on the value of Inumchar.

Note that if your model had no names before calling EKKNAME, and you do not create names for all rows and columns in the matrix, then the names of those rows and columns that were not created will contain unpredictable characters. Also, note that names can be specified or are generated for the maximum number of rows and columns in the matrix. This means that if you add a row or column to the matrix after calling EKKNAME, that row or column may already have a name assigned to it depending on the parameters in the call to EKKNAME.

The procedure for retrieving names is similar to that for name creation or change, except that negative values for the parameters startrow and startcol are used. This indicates to EKKNAME that you are retrieving names. The names retrieved from dspace will be placed in the rownames or colnames arrays beginning with the first element of the array. For example, if you are retrieving the row names for the fifth and sixth rows in the matrix, then the first element of the rownames array will contain the name of the fifth row, and the second element of the rownames array will contain the name of the sixth row.

Row and column names that are generated for you will be placed in the rownames and colnames arrays after the last name that was retrieved from dspace. EKKNAME will generate names for rows numbered up to and including Imaxrows, so you should make sure that there is enough space in rownames to hold the generated names. In addition, if you attempt to retrieve names for rows numbered beyond Imaxrows or columns numbered beeyond Imaxcols, EKKNAME will issue a message.

As for name specification, you should ensure that the arrays into which retrieved names will placed are organized by character strings of length equal to Inumchar, otherwise unpredictable results may occur.

Retrieving Names Directly

If you want to change the row and column names directly, you can do so by using the index control variables Nrownames and Ncolnames for rows and columns, respectively. Each of these control variables gives an Fortran index into cspace for the start of the appropriate names array. To use them, you have to declare cspace as a character array that begins at the same location as the beginning of dspace, as shown in "Storage Allocation". Refer to "Sample FORTRAN Program EXNAME" for a sample program that manipulates names directly.

Quadratic Input

If you are using EKKQMPS to pass the quadratic part of a matrix, you must make sure that the names specified in the MPS input file match the current names of the columns in the linear part of the matrix. In particular, you can use EKKNAME to change the names of the columns before calling EKKQMPS if you have a quadratic matrix that may be used with several models. 


Creating a Basis of All Logical Variables (EKKNLBS)

EKKNLBS creates a basis of all logical variables. The following is an example of the use of EKKNLBS in conjunction with EKKSTAT, EKKSCAL, EKKPRSL, EKKINVT, EKKCRSH, EKKPRSL, and EKKPSSL taken from "Sample FORTRAN Program EXPRSL".

       .                                                                        
       .                                                                        
       .                                                                        
C                                                                               
C   Pass model with matrix stored by columns.                                   
      CALL EKKLMDL(RTCOD,DSPACE,ITYPE,NROW,NCOL,NEL,DOBJ,DRLO,DRUP,             
     &             DCLO,DCUP,MROW,MCOL,DELS)                                    
       .                                                                        
       .                                                                        
       .                                                                        
C                                                                               
C Decide if CRSH will help or not.                                              
C (Simple strategy based on sum of primal infeasibilities.)                     
C (Note:  this could also be done using TYPE = 3 in EKKCRSH.)                   
C   Get solution and the sum of infeasibilities before EKKCRSH.                 
      CALL EKKINVT(RTCOD,DSPACE,1,1)                                            
C                                                                               
      CALL EKKRGET(RTCOD,DSPACE,OSLR,OSLRLN)                                    
      SINF=RSUMPINF                                                             
      WRITE(6,8000) SINF                                                        
8000  FORMAT(1X,'Sum of primal infeasibilities before CRSH: ',D12.5)            
C                                                                               
      CALL EKKCRSH(RTCOD,DSPACE,1)                                              
C                                                                               
C   Get solution and the sum of infeasibilities after EKKCRSH.                  
      CALL EKKINVT(RTCOD,DSPACE,1,1)                                            
C                                                                               
      CALL EKKRGET(RTCOD,DSPACE,OSLR,OSLRLN)                                    
      WRITE(6,9000) RSUMPINF                                                    
9000  FORMAT(1X,'Sum of primal infeasibilities after CRSH: ',D12.5)             
C                                                                               
C   If the sum of infeasibilities was better before EKKCRSH, get a null         
C   basis.  Otherwise, use the basis resulting from EKKCRSH.                    
C                                                                               
      IF (SINF.LT.RSUMPINF) CALL EKKNLBS(RTCOD,DSPACE)                          
C                                                                               
      CALL EKKNWMT(RTCOD,DSPACE,3)                                              
C                                                                               
      CALL EKKSSLV(RTCOD,DSPACE,1,2)                                            
       .                                                                        
       .                                                                        
       .


Creating a New Copy of a Matrix (EKKNWMT)

EKKNWMT creates a new copy of the current matrix. This is useful if you have set the elements of some rows or columns to zero, and you want these removed from the matrix, or if you have performed other operations on the matrix, such as adding blocks, rows, or columns and want the matrix reorganized in memory for use by library modules. It is also useful if you are running on a UNIX workstation, or an IBM mainframe with the IBM Vector Facility, because EKKNWMT can create a copy of the matrix that is optimized for use with these architectures.

One consequence of calling EKKNWMT is that all blocks of the matrix are consolidated into one block in the matrix copy. The index control variables Nblockelem , Nblockrow, and Nblockcol, are updated to reflect that the entire matrix is now considered to be one block. If you wish to save information on a particular block, you can save that information in high storage by calling EKKHIS to reserve space, and then retrieving the control variables referred to above so that the arrays they point to can be copied into the area you have reserved. Alternatively, you can save these arrays into your application program's storage.

Any zero coefficients that were explicitly specified by a call to EKKLMDL, EKKMPS, EKKNMDL, EKKDSCB, or EKKRPTB are not explicitly stored in the copy that EKKNWMT creates. 


Printing the Solution (EKKPRTS)

Controlling Output   Components of the Basic Output  

EKKPRTS provides model statistics and information about the current status of the problem, the row and column activities, the row slacks and column reduced costs, the row and column bounds, the row and column input costs (objective function coefficients), and the values and locations of the matrix elements. In particular, EKKPRTS can be called after your problem has been solved to print an optimal result, or when your model may have been found to be infeasible. EKKPRTS can also be called to get information created by LP sensitivity analysis. However, EKKPRTS does NOT provide information created by LP parametrics. This information may be obtained by calling EKKSPAR.

The information you can get from EKKPRTS is similar to the information you can get from EKKSTAT, depending on the values of the integer control variables Iprtinfomask and Isolmask. EKKSTAT provides summary problem information broken down by ranges. EKKPRTS provides detailed information about the current status of your problem.

Controlling the Output

The output of EKKPRTS is controlled by the values of the integer control variables Iprtinfomask, Isolmask and Iprintsens, and the values of the row and column selection lists, which may have been set by EKKSEL.

Control Variables

The integer control variables that control output from EKKPRTS are bit masks. That is, you set one bit of the mask to get one type of output. For example, setting Isolmask to 2 tells EKKPRTS to print only the columns of the model, while setting it to 4 tells EKKPRTS to print only the nonzero elements of the model. To get more than one type of output, set the bits corresponding to the desired outputs. For example, if you want to print only the nonzero columns of the model, set the value of Isolmask to 6 (i.e, 2 + 4).

In this document, the symbol is used to indicate that a bit is set. For example, 1, 2  Isolmask indicates that the 1 and 2 bits of the integer control variable Isolmask are set. Isolmask would then have a value of 6, which is 21 + 22. For a list of all the possible settings for Isolmask, Iprtinfomask, and Iprintsens, see Appendix C. "Control Variables".

Isolmask and Iprtinfomask control the output from EKKPRTS that is not created by LP sensitivity analysis. Iprintsens controls the output that is created by LP sensitivity analysis.

Selection Lists

The output of EKKPRTS is also controlled by the values of the row and column selection lists. If the last bit of the selection list vector corresponding to a particular row or column is not set, then the row or column is not printed, regardless of the value of Isolmask. If the bit is set, then the row or column is not excluded from printing. Whether the row or column is printed is then determined by the value of Isolmask. The default values for selection list entries allow all rows and columns to be printed.

You can modify the row and column selection list vectors based on the row and column names by using EKKSEL. See "EKKSEL - Modify Selection Lists" for more information on the use of EKKSEL. Or, you can modify the selection lists directly in dspace by using the index control variables Nsellistrow and Nsellistcol.

Components of the Basic Output

This section explains each part of the basic output from EKKPRTS.

The call to EKKPRTS in the Sample FORTRAN Program EXLMDL produces the following output:

                                Entering OSL subroutine EKKPRTS
          Description of Problem
                  Matrix has 5 rows, 8 columns and 14 entries
      Problem Status
      Iteration Number:    3;    Objective Value:     4.500000--Optimal
1     Rows Section                                    Page 2
                    Stat  ......Activity......                                  
                 1   BS             5.21428571                                  
                 2   BS              .                                          
                 3   FX             4.00000000                                  
                 4   LL             1.80000000                                  
                 5   UL            15.00000000                                  
1     Columns Section                                 Page 3
                    Stat  ......Activity......                                  
                 1   LL             2.50000000                                  
                 2   LL              .                                          
                 3   LL              .                                          
                 4   BS             0.64285714                                  
                 5   BS             1.00000000                                  
                 6   BS             4.00000000                                  
                 7   LL              .                                          
                 8   LL              .

This output, which uses the default values for Iprtinfomask and Isolmask, is the basic information provided by EKKPRTS.

Matrix Description

The following section of output from EKKPRTS provides the name of the problem and the number of rows, columns, and elements in the matrix.

 EKK0050I                                 Entering OSL subroutine EKKPRTS
 EKK0008I Description of Problem
 EKK0016I         Matrix has 5 rows, 8 columns and 14 entries

This is the same information that you get if you call EKKSTAT instead of EKKPRTS.

Problem Status

The following section of output from EKKPRTS provides the current iteration count, the current value of the objective function, and the current status of the problem (optimal answer found, infeasible, unbounded, stopped by the user, or unknown).

 EKK0009I Problem Status
 EKK0001I Iteration Number:        3; Objective Value:
          4.500000--Optimal

These values are also stored in the following control variables:

None of the problem status information identified above is provided by EKKSTAT.

Rows Section

The following section of output from EKKPRTS provides the status of each of the rows in MPS format and each of the row activities.

 EKK0010I    Rows Section                                  Page 2
 EKK0061I           Stat  ......Activity......
 EKK0062I        1   BS             5.21428571
 EKK0062I        2   BS              .
 EKK0062I        3   FX             4.00000000
 EKK0062I        4   LL             1.80000000
 EKK0062I        5   UL            15.00000000

The status codes indicate the status of the row in the following manner:

BS
The logical variable associated with the row is basic.
LL
The row activity is at its lower bound.
UL
The row activity is at its upper bound.
FX
The row activity is fixed, indicating an equality row.
FR
The logical variable associated with the row is free.
**
The constraint indicated by the row is not satisfied and may be the cause of infeasibility.

If a row activity is zero, a single decimal point is printed, as shown in the second row above. This makes it easier to scan for the nonzeros in the output.

If names have been assigned to the rows, either through MPS input or the use of EKKNAME, then those names are printed between the row number and the row status. For example, if you inserted the following fragment of code before the call to EKKPRTS.

C
C   Turn off printing of the page header (message EKK0006I).
      CALL EKKMSET(RTCOD,DSPACE,6,0,-1,0,0,6,0)
C
C   Turn off printing of all message numbers.
      CALL EKKMSET(RTCOD,DSPACE,1,0,0,0,0,9999,1)
C
C   Generate names for the model.
      CALL EKKNAME(RTCOD,DSPACE,0,0,1,0,0,1,1)
C
C   Print the solution.
      CALL EKKPRTS(RTCOD,DSPACE)
C
C   Restore the printing of the message numbers.
      CALL EKKMSET(RTCOD,DSPACE,1,0,0,0,0,9999,2)
C
C   Restore printing of the page header (message EKK0006I).
      CALL EKKMSET(RTCOD,DSPACE,6,0,256,0,0,6,0)

then the following rows section would have been printed instead:

 EKK0010I    Rows Section                                  Page 2
 EKK0061I           ..Name..  Stat  ......Activity......
 EKK0062I        1  R0000001   BS             5.21428571
 EKK0062I        2  R0000002   BS              .
 EKK0062I        3  R0000003   FX             4.00000000
 EKK0062I        4  R0000004   LL             1.80000000
 EKK0062I        5  R0000005   UL            15.00000000

Columns Section

The following section of output from EKKPRTS provides the status of each of the variables in MPS format and each of the variable activities.

 EKK0011I    Columns Section                               Page 3
 EKK0063I           Stat  ......Activity......
 EKK0064I        1   LL             2.50000000
 EKK0064I        2   LL              .
 EKK0064I        3   LL              .
 EKK0064I        4   BS             0.64285714
 EKK0064I        5   BS             1.00000000
 EKK0064I        6   BS             4.00000000
 EKK0064I        7   LL              .
 EKK0064I        8   LL              .

The status codes, which indicate the status of the variable, have the same meanings as in the rows section.

If a variable activity is zero, a single decimal point is printed, as shown for the second variable above. Again, this makes it easier to scan for the nonzeros in the output.

If names have been assigned to the variables, either through MPS input or the use of EKKNAME, then those names are printed between the variable number and the variable status. For example, if you inserted the same fragment of code as in the rows section before the call to EKKPRTS, then the following columns section would have been printed instead:

 EKK0011I    Columns Section                               Page 3
 EKK0063I           ..Name..  Stat  ......Activity......
 EKK0064I        1  C0000001   LL             2.50000000
 EKK0064I        2  C0000002   LL              .
 
 EKK0064I        3  C0000003   LL              .
 EKK0064I        4  C0000004   BS             0.64285714
 EKK0064I        5  C0000005   BS             1.00000000
 EKK0064I        6  C0000006   BS             4.00000000
 EKK0064I        7  C0000007   LL              .
 EKK0064I        8  C0000008   LL              .

Advanced Output

As noted previously, by setting the integer control variables Iprtinfomask and Isolmask, you can get more information about the rows and columns of the matrix when you call EKKPRTS. This section explains the other types of output that you get if you change the values of those control variables.

If you replace the call to EKKPRTS in "Sample FORTRAN Program EXLMDL" with the following fragment of code:

C
C   Turn off printing of the page header (message EKK0006I).
      CALL EKKMSET(RTCOD,DSPACE,6,0,-1,0,0,6,0)
C
C   Turn off printing of all message numbers.
      CALL EKKMSET(RTCOD,DSPACE,1,0,0,0,0,9999,1)
C
C   Generate names for the model.
      CALL EKKNAME(RTCOD,DSPACE,0,0,1,0,0,1,1)
C
C   Set the control variables so the maximum amount of information
C   from EKKPRTS will be printed.
      CALL EKKIGET(RTCOD,DSPACE,OSLI,OSLILN)
      IPRTINFOMASK=1023
      IPRTMTRXMASK=16
      CALL EKKISET(RTCOD,DSPACE,OSLI,OSLILN)
C
C   Print the solution.
      CALL EKKPRTS(RTCOD,DSPACE)
C
C   Restore the printing of the message numbers.
      CALL EKKMSET(RTCOD,DSPACE,1,0,0,0,0,9999,2)
C
C   Restore printing of the page header (message EKK0006I).
      CALL EKKMSET(RTCOD,DSPACE,6,0,256,0,0,6,0)

you will get the following output from EKKPRTS:

                                          Entering OSL subroutine EKKPRTS
          Description of Problem
                  Matrix has 5 rows, 8 columns and 14 entries
          Problem Status
          Iteration Number:        3; Objective Value:
          4.500000--Optimal
1            Rows Section                                  Page 2
                    ..Name..  Stat  ......Activity......  ........Dual........
          ........Lower.......  ........Upper.......
                 1  R0000001   BS             5.21428571             .
                   2.50000000            + Infinity
                 2  R0000002   BS              .                     .
                   - Infinity            2.10000000
                 3  R0000003   FX             4.00000000             .
                   4.00000000            4.00000000
                 4  R0000004   LL             1.80000000             .
                   1.80000000            5.00000000
                 5  R0000005   UL            15.00000000            2.00000000
                   3.00000000           15.00000000
1            Columns Section                               Page 3
                    ..Name..  Stat  ......Activity......  ........Dual........
          ........Lower.......  ........Upper.......
                 1  C0000001   LL             2.50000000           10.20000000
                   2.50000000            + Infinity
                 2  C0000002   LL              .                     .
                    .                    4.10000000
                 3  C0000003   LL              .                     .
                    .                    + Infinity
                 4  C0000004   BS             0.64285714             .
                    .                    + Infinity
                 5  C0000005   BS             1.00000000             .
                   0.50000000            4.00000000
                 6  C0000006   BS             4.00000000             .
                    .                    + Infinity
                 7  C0000007   LL              .                     .
                    .                    + Infinity
                 8  C0000008   LL              .                    4.80000000
                    .                    4.30000000
1            Rows Section                                  Page 4
                    ..Name..  ........Cost........
                 1  R0000001             .
                 2  R0000002             .
                 3  R0000003             .
                 4  R0000004             .
                 5  R0000005             .
1            Columns Section                               Page 5
                    ..Name..  ........Cost........
                 1  C0000001            1.00000000
                 2  C0000002             .
                 3  C0000003             .
                 4  C0000004             .
                 5  C0000005            2.00000000
                 6  C0000006             .
                 7  C0000007             .
                 8  C0000008           -1.00000000
          Matrix type 2, Column base 0, Row base 0
          Column 1, Row 1 has value 3.000000
          Column 1, Row 5 has value 5.600000
          Column 2, Row 1 has value 1.000000
          Column 2, Row 2 has value 2.000000
          Column 3, Row 2 has value 1.100000
          Column 3, Row 3 has value 1.000000
          Column 4, Row 1 has value -2.000000
          Column 4, Row 4 has value 2.800000
          Column 5, Row 1 has value -1.000000
          Column 5, Row 5 has value 1.000000
          Column 6, Row 3 has value 1.000000
          Column 7, Row 4 has value -1.200000
          Column 8, Row 1 has value -1.000000
          Column 8, Row 5 has value 1.900000

This output, which uses the maximum values for Iprtinfomask and Isolmask, illustrates all the information that can be provided by EKKPRTS.

Rows Section

In addition to the information that was discussed previously, the dual values for each row and the bounds on each row are printed.

 EKK0010I    Rows Section                                  Page 2
 EKK0061I           ..Name..  Stat  ......Activity......  ........Dual........
          ........Lower.......  ........Upper.......
 EKK0062I        1  R0000001   BS             5.21428571             .
                   2.50000000            + Infinity
 EKK0062I        2  R0000002   BS              .                     .
                   - Infinity            2.10000000
 EKK0062I        3  R0000003   FX             4.00000000             .
                   4.00000000            4.00000000
 EKK0062I        4  R0000004   LL             1.80000000             .
                   1.80000000            5.00000000
 EKK0062I        5  R0000005   UL            15.00000000            2.00000000
                   3.00000000           15.00000000

Note:

To prevent wraparound, change the value of the integer control variable Ilinelen.

 
If a dual value or a bound is zero, a single decimal point is printed.

Also, there is a second rows section after the first columns section that shows the input costs for each row:

 EKK0010I    Rows Section                                  Page 4
 EKK0061I           ..Name..  ........Cost........
 EKK0062I        1  R0000001             .
 EKK0062I        2  R0000002             .
 EKK0062I        3  R0000003             .
 EKK0062I        4  R0000004             .
 EKK0062I        5  R0000005             .

If an input cost is zero, a single decimal point is printed.

Columns Section

In addition to the information that was discussed previously, the dual values for each variable and the bounds on each variable are printed.

 EKK0011I    Columns Section                               Page 3
 EKK0063I           ..Name..  Stat  ......Activity......  ........Dual........
          ........Lower.......  ........Upper.......
 EKK0064I        1  C0000001   LL             2.50000000           10.20000000
                   2.50000000            + Infinity
 EKK0064I        2  C0000002   LL              .                     .
                    .                    4.10000000
 EKK0064I        3  C0000003   LL              .                     .
                    .                    + Infinity
 EKK0064I        4  C0000004   BS             0.64285714             .
                    .                    + Infinity
 EKK0064I        5  C0000005   BS             1.00000000             .
                   0.50000000            4.00000000
 EKK0064I        6  C0000006   BS             4.00000000             .
                    .                    + Infinity
 EKK0064I        7  C0000007   LL              .                     .
                    .                    + Infinity
 EKK0064I        8  C0000008   LL              .                    4.80000000
                    .                    4.30000000

If a dual value or a bound is zero, a single decimal point is printed.

There is also a second columns section, after the second rows section, that shows the input costs for each variable and the type, offset, and number of elements for each block of the matrix followed by a listing of the location and value of each element.

 EKK0011I    Columns Section                               Page 5
 EKK0063I           ..Name..  ........Cost........
 EKK0064I        1  C0000001            1.00000000
 EKK0064I        2  C0000002             .
 EKK0064I        3  C0000003             .
 EKK0064I        4  C0000004             .
 EKK0064I        5  C0000005            2.00000000
 EKK0064I        6  C0000006             .
 EKK0064I        7  C0000007             .
 EKK0064I        8  C0000008           -1.00000000
 EKK0007I Block storage type 2, Column base 0, Row base 0
 EKK0013I Column 1, Row 1 has value 3.000000
 EKK0013I Column 1, Row 5 has value 5.600000
 EKK0013I Column 2, Row 1 has value 1.000000
 EKK0013I Column 2, Row 2 has value 2.000000
 EKK0013I Column 3, Row 2 has value 1.100000
 EKK0013I Column 3, Row 3 has value 1.000000
 EKK0013I Column 4, Row 1 has value -2.000000
 EKK0013I Column 4, Row 4 has value 2.800000
 EKK0013I Column 5, Row 1 has value -1.000000
 EKK0013I Column 5, Row 5 has value 1.000000
 EKK0013I Column 6, Row 3 has value 1.000000
 EKK0013I Column 7, Row 4 has value -1.200000
 EKK0013I Column 8, Row 1 has value -1.000000
 EKK0013I Column 8, Row 5 has value 1.900000

If an input cost is zero, a single decimal point is printed.

The matrix element information is similar to the information you get if you call EKKSTAT, although EKKSTAT provides a breakdown of the elements by ranges, rather than listing the individual element values.

Remember that a call to EKKCOPY or EKKNWMT consolidates all blocks of the matrix in the copy, so there will be only one block of information on matrix elements from EKKPRTS if either of these subroutines is called.

Additional Output from LP Sensitivity Analysis

As noted previously, you can call EKKPRTS to get the information resulting from a call to EKKSOBJ or EKKSBND. This section explains the additional information that is provided from EKKPRTS when either EKKSOBJ or EKKSBND has been called.

If you replace the call to EKKPRTS in "Sample FORTRAN Program EXLMDL" with the following fragment of code:

C
C   Analyze sensitivity of the solution to the objective function.
      CALL EKKSOBJ(RTCOD,DSPACE)
C
C   Analyze sensitivity of the solution to the bounds for rows and
C   columns.
      CALL EKKSBND(RTCOD,DSPACE,3,1)
C
C   Turn off printing of the page header (message EKK0006I).
      CALL EKKMSET(RTCOD,DSPACE,6,0,-1,0,0,6,0)
C
C   Turn off printing of all message numbers.
      CALL EKKMSET(RTCOD,DSPACE,1,0,0,0,0,9999,1)
C
C   Generate names for the model.
      CALL EKKNAME(RTCOD,DSPACE,0,0,1,0,0,1,1)
C
C   Set the control variables so the maximum amount of information
C   from EKKPRTS will be printed.
      CALL EKKIGET(RTCOD,DSPACE,OSLI,OSLILN)
      IPRTINFOMASK=1023
      IPRTMTRXMASK=16
      CALL EKKISET(RTCOD,DSPACE,OSLI,OSLILN)
C
C   Print the solution.
      CALL EKKPRTS(RTCOD,DSPACE)
C
C   Restore the printing of the message numbers.
      CALL EKKMSET(RTCOD,DSPACE,1,0,0,0,0,9999,2)
C
C   Restore printing of the page header (message EKK0006I).
      CALL EKKMSET(RTCOD,DSPACE,6,0,256,0,0,6,0)

in addition to the usual EKKPRTS output described in the preceding section, you will get LP sensitivity analysis information for the objective function and row and column bounds. This output is described in the following sections.

Sensitivity to Objective Function Output

The following section of output from EKKPRTS provides, for each variable, the variable status as in the columns section, the original objective function coefficient, and for first an increase in the coefficient, then a decrease in the coefficient, the following information:

Because of the length of the information presented, the output will be more readable if the line length is set to 132 before calling EKKPRTS. This is done by setting the value of control variable Ilinelen to 132.

 EKK0213I Sensitivity to Objective Function                Page 6
 EKK0063I      ....Name......Stat...Original_Objective...........Range...........
          .Objective_Range...Entering..Leaving.
 EKK0064I        1 C0000001   LL          1.00000000           11.20000000
                30.00000000  C0000001  C0000005
 EKK0064I                                                       - INFINITY
                 - INFINITY  ********  ********
 EKK0064I        2 C0000002   LL           .                     .
                 4.50000000  C0000002  R0000002
 EKK0064I                                                       - INFINITY
                 4.50000000  ********  ********
 EKK0064I        3 C0000003   LL           .                     .
                 4.50000000  C0000003  R0000002
 EKK0064I                                                       - INFINITY
                 4.50000000  ********  ********
 EKK0064I        4 C0000004   BS           .                     .
                 4.50000000  C0000007  R0000001
 EKK0064I                                                        .
                 4.50000000  C0000007  R0000001
 EKK0064I        5 C0000005   BS          2.00000000            + INFINITY
                 + INFINITY  ********  ********
 EKK0064I                                                       0.17857143
                 2.67857143  C0000001  C0000005
 EKK0064I        6 C0000006   BS           .                     .
                 4.50000000  C0000003  R0000002
 EKK0064I                                                        .
                 4.50000000  C0000003  R0000002
 EKK0064I        7 C0000007   LL           .                     .
                 4.50000000  C0000007  R0000001
 EKK0064I                                                       - INFINITY
                 4.50000000  ********  ********
 EKK0064I        8 C0000008   LL         -1.00000000            3.80000000
                 4.50000000  C0000008  C0000005
 EKK0064I                                                       - INFINITY
                 4.50000000  ********  ********

Any values that are zero are indicated by a single decimal point.

If no basis change takes place regardless of how much the objective function coefficient is increased or decreased (indicated by + or - in the range field), then the names of the entering and leaving variables are filled in with asterisks.

Sensitivity to Bounds Output

The following section of output from EKKPRTS provides, for each row and column, the row or column status as in the previous section, and for first the lower, then the upper bounds, the following information:

Because of the length of the information presented, the output will be more readable if the line length is set to 132 before calling EKKPRTS. This is done by setting the value of control variable Ilinelen to 132.

 EKK0214I Sensitivity to Row Bounds                       Page 7
 EKK0063I      ....Name......Stat..........Value.................Range...........
          .Objective_Range...Entering..Leaving.
 EKK0064I        1 R0000001   BS          5.21428571            5.98214286
                 5.41071429  C0000001  C0000005
 EKK0064I                                                       - INFINITY
                 + INFINITY  ********  ********
 EKK0064I        2 R0000002   BS           .                    + INFINITY
                 + INFINITY  ********  ********
 EKK0064I                                                       - INFINITY
                 + INFINITY  ********  ********
 EKK0064I        3 R0000003   FX          4.00000000            + INFINITY
                 4.50000000  ********  ********
 EKK0064I                                                        .
                 4.50000000  R0000003  C0000006
 EKK0064I        4 R0000004   LL          1.80000000            5.60000000
                 4.50000000  R0000004  R0000001
 EKK0064I                                                        .
                 4.50000000  R0000004  C0000004
 EKK0064I        5 R0000005   UL         15.00000000           17.71428571
                -0.92857143  R0000005  R0000001
 EKK0064I                                                      14.50000000
                 5.50000000  R0000005  C0000005
 EKK0243I Sensitivity to Column Bounds                     Page 8
 EKK0063I      ....Name......Stat..........Value.................Range...........
          .Objective_Range...Entering..Leaving.
 EKK0064I        1 C0000001   LL          2.50000000            2.58928571
                 5.41071429  C0000001  C0000005
 EKK0064I                                                       2.18438538
                 1.28073090  C0000001  R0000001
 EKK0064I        2 C0000002   LL           .                    1.05000000
                 4.50000000  C0000002  R0000002
 EKK0064I                                                      -2.71428571
                 4.50000000  C0000002  R0000001
 EKK0064I        3 C0000003   LL           .                    1.90909091
                 4.50000000  C0000003  R0000002
 EKK0064I                                              -0.909090909091D+31
                 4.50000000  C0000003  R0000002
 EKK0064I        4 C0000004   BS          0.64285714            + INFINITY
                 + INFINITY  ********  ********
 EKK0064I                                                       - INFINITY
                 + INFINITY  ********  ********
 EKK0064I        5 C0000005   BS          1.00000000            + INFINITY
                 + INFINITY  ********  ********
 EKK0064I                                              -0.651162790698D+31
                 + INFINITY  C0000001  R0000001
 EKK0064I        6 C0000006   BS          4.00000000            + INFINITY
                 + INFINITY  ********  ********
 EKK0064I                                                       - INFINITY
                 + INFINITY  ********  ********
 EKK0064I        7 C0000007   LL           .                    3.16666667
                 4.50000000  C0000007  R0000001
 EKK0064I                                                      -1.50000000
                 4.50000000  C0000007  C0000004
 EKK0064I        8 C0000008   LL           .                    0.26315789
                 5.76315789  C0000008  C0000005
 EKK0064I                                                      -1.57894737
                -3.07894737  C0000008  C0000005

Any values that are zero are indicated by a single decimal point. If no basis change takes place regardless of how much the bounds are increased or decreased (indicated by +infinity or -infinity in the range field), then the names of the entering and leaving variables are filled in with asterisks. 


Repeat an Existing Matrix Block as a New Block (EKKRPTB)

EKKRPTB provides a convenient way to load into the workspace a block of the current matrix that is similar to an existing block. You may copy a block from the current matrix or another matrix into the current matrix as a new block. You may then modify this block as desired to create the block that you need.

Using EKKRPTB

EKKRPTB is very similar to EKKDSCB, except that you only need to describe where the block is in terms of the model number and block number and indicate where it is to be placed in the current matrix. The copy of the block is stored in the same format as the original.

When calling EKKRPTB, you need to indicate whether the copy of the block is directly copied into dspace or if the copy refers to the original by pointers. In the former case, if you change the original block, none of the blocks that copied the original directly will be affected. In the latter case, if you change the original block, all blocks that are virtual copies of the original by the use of pointers will be changed. This is very useful for changing multiperiod models. See "Sample FORTRAN Program EXRPTB" for an example of each of these options.

Control Variables

The integer control variable Inumels and the index control variables Nblockcol, Nblockrow, and Nblockelem are updated to reflect that you have just created a new block. You may directly obtain information on the block you just copied by using these control variables. 


Creating or Changing Selection Lists (EKKSEL)

EKKSEL allows you to create selection lists for rows and columns of the current matrix and provides a convenient way to update the selection lists based on a comparison of a string with each row or column name. The selection lists are changed after the comparisons depending on the operation chosen.

Selection lists affect the output of the following subroutines:

What Is a Selection List?

A selection list is a data structure that defines which rows or columns are to be considered during the execution of certain library modules. Only the subroutines listed previously use the information contained in selection lists.

Format of a Selection List

When EKKSEL is called for the first time, two selection lists are created, one for rows and one for columns. Each selection list is a one-dimensional array of fullwords. Within a selection list, the ith fullword in the array corresponds to the ith row or column number.

The value of the last bit (least-significant bit) in the fullword corresponding to a row or column determines if information pertaining to that row or column is printed during the execution of one of the subroutines listed above. If the last bit is set, then the information pertaining to the row or column is printed; if not, then no information is printed. All other bits are reserved for use by library modules.

In addition, if information that is printed for row or column x contains information about row or column y, and row or column y is not selected, then the information about row or column x is not printed. See the output from the calls to EKKBCDO in "Sample FORTRAN Program EXSELNAM" for an example.

How EKKSEL Works

You need to call EKKSEL to set up the selection lists as indicated above. If selection lists are not created, then the subroutines that use selection lists select all rows and columns for processing.

When EKKSEL is called for the first time, space for the row and column selection lists is reserved in high storage. The number of fullwords in each selection list is equal to the current values of Imaxrows and Imaxcols, respectively. These lists have the last bit in each fullword set to 1. If EKKSEL is being called again, this step is bypassed.

Then, if your matrix has names for the rows and columns, the string you pass to EKKSEL is used in comparisons with the row or column names of the matrix. This string may use wildcard or arbitrary characters, as explained below. The string is compared to each row or column name in turn. If the string matches the row or column name, then the value 1 is used in a logical expression with the last bit of the fullword in the selection list array corresponding to the row or column; if not, then the value 0 is used. The logical operator that is used is specified in the call to EKKSEL. AND, OR, and XOR have the usual meanings, but NOT clears the bit in the selection list array if the string matched the name, rather than performing a logical NOT. This has the effect of removing matching rows and columns from the processing of the subroutines listed above.

If your matrix does not have names for the rows and columns, then the selection lists have the last bit of each fullword set to 1, and EKKSEL returns to your program. This provides a convenient way to reinitialize selection lists if you do not wish to provide row and column names for your matrix. Because no space is reserved for names when you pass your model using EKKLMDL or EKKNMDL, you will have to call EKKNAME after the model is passed to set up space for row and column names.

Wildcard and Arbitrary Characters

When passing EKKSEL the string that is used in comparison with row and column names, you can use wildcard and arbitrary characters in the string. The character to be used as a wildcard character and the character to be used as an arbitrary character are both specified in the call to EKKSEL. You should use characters that are not in the row and column names or characters that you do not wish to treat as regular characters.

A wildcard character matches zero or more occurrences of any regular character. If wildcard characters appear consecutively, they are treated as if only one had occurred.

An arbitrary character matches exactly one occurrence of any regular character. An arbitrary character is usually used as placeholder in a comparison string.

Examples

In the following examples, * is the wildcard character and ? is the arbitrary character.

String
Matches
T???*
Any name starting with T followed by at least three characters of any value.
*R*?W*
Zero or more characters followed by an R followed by one or more characters followed by a W followed by zero or more characters. The first R and the first W that follows the arbitrary character are matched, so TESTROW matches, but RWTROW does not.

Operating on Selection Lists Directly

If your model has no names, or you wish to update the selection lists directly, you may do so by using the index control variables Nsellistrow and Nsellistcol for rows and columns, respectively. Each of these control variables gives an Fortran index into mspace for the start of the appropriate selection list array. To use them, you have to declare mspace as an array of fullwords that is twice the length of dspace and begins at the same location as the beginning of dspace, as shown in "Storage Allocation". Refer to "Sample FORTRAN Program EXSELNM2" for a sample program that manipulates selection lists directly.

Saving Selection Lists

The row and column selection lists for each model are applicable to that model only. The selection lists for a particular model are saved when EKKPTMI is called to save model information and restored when EKKGTMI is called to restore model information. If the integer control variable Imodelmask is set to a value of 2 or includes a value of 2, then the selection lists for the current model are saved in the file produced by a call to EKKPTMD. Restoring this model through a call to EKKGTMD restores the selection lists to the values they had when EKKPTMD was called.


[ Top of Page | Previous Page | Next Page | Table of Contents ]