Input/Output Routines


EKKMPS - Accept Model Data from an Input Stream in MPS Format

This subroutine specifies a linear or mixed integer model from an Input Stream, which might be a file or a pipe, in MPS format. Refer to "Passing Your Model Using Mathematical Programming System (MPS) Format" for more information on MPS format.

Syntax

FORTRAN 

CALL EKKMPS(rtcod,dspace,unit,type,intunit

C 

ekkmps(&rtcod,dspace,unit,type intunit); 

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

unit
is the unit number specifying where the input is read.


Specified as: a fullword integer; 0 unit 99.

Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, or 6.

type
is the type of storage to create for the matrix, where:

If type=1, a copy of the matrix is stored by indices.
If type=2, a copy of the matrix is stored by columns.

Specified as: a fullword integer. Its value must be 1 or 2.

intunit
is the unit number for storing integer information for branch and bound. intunit should be set to 0 for non-MIP problems.


Specified as: a fullword integer; 0 intunit 99.

Notes:

  1. If you are using any variant of UNIX or any PC operating system, intunit cannot be 1, 2, 5, or 6.
  2. If intunit is not 0, and EKKPRSL is called for this problem, the scope of the presolve will be limited due to the integrality constraints.
On Return
rtcod
is the return code for the subroutine, where:

If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.

If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

Returned as: a fullword integer.

dspace
is the user-provided work area.


Returned as: a one-dimensional real array of doublewords.

Notes

  1. If EKKDSCM has not been called, it will be called allowing for one model with one block.
  2. In MPS files with multiple models, type-N rows, right-hand sides, ranges, or bounds, the default chosen is the first of each type found. This can be overridden by setting the appropriate character control variables prior to calling EKKMPS.
  3. In MPS files with parametric change vectors, you may set all or some of the character control variables Cchangecost, Cchangerhs, Cchangerange, or Cchangebounds. This tells EKKMPS to select the appropriate change vectors from the file.
  4. If you want to set any control variables using EKKxGET and EKKxSET before the call to EKKMPS, you must call EKKDSCM before the call to EKKxGET and EKKxSET. This is especially true if you are setting Imaxrows and Imaxcols.
  5. If Imaxrows and Imaxcols are positive, they have their usual meanings. If they are negative, they act as increments, that is, Imaxrows will be set to Inumrows + (-Imaxrows). This is useful if you want to have spare rows.
  6. To add integer variables, or to change continuous variables to integer variables, you need to reserve space for "spares", using the Imaxints control variable before any calls to EKKMPS, EKKLMDL, EKKIMDL, or EKKSMDL. If you do this before calling EKKMPS, EKKIMDL, or EKKSMDL, a negative value for Imaxints indicates that space for (-Imaxints) extra integer variables will be allocated. Also, if you want to set Imaxints before calling EKKMPS, EKKLMDL, EKKIMDL, or EKKSMDL, you must call EKKDSCM before calling EKKIGET or EKKISET.
  7. If type=1, EKKMPS tries to recover from the error of having duplicate column names by assuming it was intended.
  8. If type=2, EKKMPS does not recover from the error, and an error message is issued.

  9. If Inumchar is set to anything other than 8 and fixed format input is used, all fields in the input file must be separated by one blank. Also, the width of the row and column name fields in the file (including trailing blanks) must match Inumchar exactly.
  10. If you want to assign MPS data sets to blocks, you should first read the data sets into separate models in the same application. You can then use EKKRPTB to enter one of the models as a block in the other model.
  11. In library routines, 10 31 is used as an operational value for +infinity, and minus 10 31 is used as an operational value for -infinity.
  12. Any values whose absolute value is less than the real control variable Rtolmps will be set to zero. If Rtolmps is negative, no values will be set to zero.
  13. Column bounds for general integer variables should be given in the MPS file and the upper bound should be less than 10 31; otherwise, the general integer variables will default to 0-1 integer variables.
  14. Since the library modules are now written in C, a FORTRAN open statement can not be used to associate a named file with a ;unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.

Examples

Refer to the following sample programs for examples of using EKKMPS:


[ Top of Page | EKKMPS | EKKPRTS | EKKSEL | EKKBASI | EKKBASO ]
[ EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
[ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

EKKQMPS - Read in the Quadratic Parts of a Model in MPS Format

This subroutine reads in the quadratic coefficient matrix for a quadratic programming problem in MPS format. See "Passing Your Model Using Mathematical Programming System (MPS) Format" for more information on MPS format. The linear part of the model must be specified before the quadratic part.

Syntax

FORTRAN 

CALL EKKQMPS(rtcod,dspace,unit,type

C 

ekkqmps(&rtcod,dspace,unit,type); 

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

unit
is the unit number from which to read the matrix of quadratic objective coefficients.


Specified as: a fullword integer; 0 unit 99.

Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, or 6.

type
is the storage format of the matrix, where:

If type=1, the matrix is stored by indices.
If type=2, the matrix is stored by columns.

Specified as: a fullword integer.

On Return
rtcod
is the return code for the subroutine, where:

If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
See "Return Codes" for an explanation of return codes.

If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

Returned as: a fullword integer.

dspace
is the user-provided work area.


Returned as: a one-dimensional real array of doublewords.

Notes

  1. The quadratic matrix should be positive semidefinite. If it is not, the quadratic programming algorithm may find a local minimum instead of a global one, or it may fail altogether.
  2. The quadratic parts of a spreadsheet quadratic programming problem can be defined by EKKSMDL. For more information, see "Passing Your Model Using Spreadsheet Format".
  3. EKKQMPS resets the basis to a null basis. If you want to use EKKSSLV to solve the linear part of your quadratic programming problem and then use EKKQSLV to proceed with that basis, call EKKQMPS before calling EKKSSLV.
  4. Similarly, you may want to have EKKQSLV solve your quadratic programming problem, then create a new quadratic matrix using EKKQMPS or EKKQMDL, and then proceed using the optimal basis from the first call to EKKQSLV. To do this, you must save and restore this basis by using EKKBASO and EKKBASI or by saving the status vectors and solution vectors using EKKNGET index control variables Nrowstat, Ncolstat, Nrowacts, and Ncolsol.

  5. The model name on the NAME card in the input file must match the value of the character control variable Cname. If Cname is not set before calling EKKMPS, Cname is set to the name of the linear part of the model by EKKMPS, and may be modified before calling EKKQMPS.
  6. Any values whose absolute value is less than the real control variable Rtolmps will be set to zero. If Rtolmps is negative, no values will be set to zero.
  7. Since the library modules are written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.

Examples

Refer to the following sample programs for examples of using EKKQMPS:


[ Top of Page | EKKMPS | EKKQMPS | EKKSEL | EKKBASI | EKKBASO ]
[ EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
[ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

EKKPRTS - Print the Problem Solution

This subroutine prints the problem solution. It also prints the results of sensitivity analysis done with EKKSBND or EKKSOBJ. See "Printing the Solution (EKKPRTS)" for information on how to interpret the output from EKKPRTS.

Syntax

FORTRAN 

CALL EKKPRTS(rtcod,dspace

C 

ekkprts(&rtcod,dspace); 

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

On Return
rtcod
is the return code for the subroutine, where:

If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
See "Return Codes" for an explanation of return codes.

If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

Returned as: a fullword integer.

dspace
is the user-provided work area.


Returned as: a one-dimensional real array of doublewords.

Notes

  1. The integer control variables Iprtinfomask, Isolmask, Iprintunit, and Iprintsens, and the index control variables Nsellistrow and Nsellistcol can be used to control what gets printed and where it gets printed.
  2. Selection lists may be used to control the output of EKKPRTS.
  3. EKKPRTS may be called to print the information resulting from a call to EKKSBND or EKKSOBJ. Because of the length of information presented, it will be more readable if the line length is set to 132 (integer control variable Ilinelen=132) before calling EKKPRTS to print the sensitivity analysis output.
  4. EKKPRTS may be used with EKKNSLV, but the matrix elements are not printed unless a column or index copy of the matrix exists and Iprtinfomask is set appropriately.
  5. Since the library modules are written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.

Examples

Refer to the following sample programs for examples of using EKKPRTS:


[ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKBASI | EKKBASO ]
[ EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
[ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

EKKSEL - Select Rows and Columns by Name for Output

This subroutine gives you a convenient way to update the row and column selection lists (which selectively affect output), on the basis of comparisons of row and column names with an input string.

For more information on how to use EKKSEL, see "Creating or Changing Selection lists."
 

Note:

EKKSEL is not guaranteed to work in PL/I programs. The PL/I ILC does not directly support the passing of character strings to VS FORTRAN routines. A PL/I program may work correctly, if the correct PL/I data types are used. Note that the compiler may generate a warning message. 

Syntax

FORTRAN 

CALL EKKSEL(rtcod,dspace,selname,selnamelen,wildcard, arbchar, oper, rowcol)

C 

ekksel(&rtcod,dspace,selname,selnamelen,wildcard, arbchar, oper, rowcol);

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

selname
is the character string to be compared with the row and column names. It may contain the wildcard character to allow groups of names to be selected.


Specified as: a character string of length 80.

selnamelen
is the number of characters to be used from selname for the comparisons. The first selnamelen characters will be used.


Specified as: a fullword integer.

wildcard
is the character used as a wildcard in selname so that groups of names can be selected.


Specified as: a single character.

arbchar
is the character used to represent an arbitrary character in selname so that groups of names can be selected.


Specified as: a character.

oper
is the operation to be performed with the value resulting from the comparison of selname and the current row or column name, and the last bit of the fullword in the selection list corresponding to the current row or column, where:

If oper=1, perform an AND
If oper=2, perform an OR
If oper=3, set the last bit of the corresponding fullword vector to 0 if the value resulting from the comparison is 1. This has the effect of removing matching row and column names from the selection list.
If oper=4, perform an exclusive OR.

Specified as: a fullword integer. Its value must be 1, 2, 3, or 4.

rowcol
indicates whether to operate on rows, columns, or both, where:

If rowcol=1, operate on both rows and columns
If rowcol=2, operate on rows only
If rowcol=3, operate on columns only.

Specified as: a fullword integer. Its value must be 1, 2, or 3.

On Return
rtcod
is the return code for the subroutine, where:

If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
See "Return Codes" for an explanation of return codes.

If rtcod is non-zero, its value is the return code associated with the first occurrence of the highest severity message.

Returned as: a fullword integer.

dspace
is the user-provided work area.


Returned as: a one-dimensional real array of doublewords.

Notes

  1. Index control variables Nsellistrow and Nsellistcol may be used to retrieve the row and column selection lists directly. These selection lists are one-dimensional integer arrays of fullwords, with each fullword corresponding to a row or column. The rightmost bit is used to determine selection of a row or column based on name comparison. All other bits are reserved for use by the library modules.
  2. Selection lists are initialized during the first call to EKKSEL. The number of fullwords allocated is equal to the value of Imaxrows and Imaxcols. The rightmost bit of each fullword in the selection lists is set during initialization.
  3. The character wildcard may occur anywhere in selname. It matches zero or more characters in a row or column name.
  4. For example, if selname is "T*ROW*", where an asterisk (*) is wildcard, selname matches any name starting with "T", followed by zero or more characters, followed by "ROW", followed by zero or more characters.

  5. The character arbchar may occur anywhere in selname. It matches any single character in a row or column name.
  6. For example, if selname is "T??ROW*", where a question mark (?) is arbchar, then selname matches any name starting with "T", followed by exactly two characters, followed by "ROW", followed by zero or more characters.

  7. Selection lists affect the processing of the following routines:

Examples

Refer to the following sample programs for examples of using EKKSEL:


[ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASO ]
[ EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
[ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

EKKBASI - Read in a Basis in MPS Format

This subroutine reads in a basis in MPS format. See "Passing Your Model Using Mathematical Programming System (MPS) Format" for additional information on MPS format. This subroutine is a companion to EKKBASO.

Syntax

FORTRAN 

CALL EKKBASI(rtcod,dspace,unit

C 

ekkbasi(&rtcod,dspace,unit); 

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

unit
is the unit number specifying where the basis file is read from.


Specified as: a fullword integer; 0 unit 99.

Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, or 6.

On Return
rtcod
is the return code for the subroutine, where:

If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.

If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

Returned as: a fullword integer.

dspace
is the user-provided work area.


Returned as: a one-dimensional real array of doublewords.

Notes

  1. To use EKKBASI, your rows and columns must have names. You can use EKKNAME to add user-defined names, or names may be generated for you. If you supply names using EKKNAME, the names must match those specified in the basis file attached to the unit.
  2. Since the library modules are written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.
  3. By default, the first basis encountered in the file will be used. To set the name of the basis to be used, set the character control variable Cbasis.
  4. If you want to specify a basis using library data structures, refer to "Passing Your Model Using Library Data Structures" and see "Sample FORTRAN Program EXOSLBAS".
  5. If Inumchar is set to a value other than 8, the width of the row and column fields in the basis file must match Inumchar exactly.
  6. EKKBASI does not use selection lists.

Examples

Refer to the following sample programs for examples of using EKKBASI:


[ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
[ EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
[ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

EKKBASO - Write out the Current Basis in MPS Fixed Format

This subroutine writes the current basis to stdout in MPS fixed format. See "Passing Your Model Using Mathematical Programming System (MPS) Format" for additional information on MPS format. This subroutine is a companion to EKKBASI.

Syntax

FORTRAN 

CALL EKKBASO(rtcod,dspace,unit,val

C 

ekkbaso(&rtcod,dspace,unit,val); 

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

unit
is the unit number specifying where the basis file is to be written.


Specified as: a fullword integer; 0 num (the length of iarray).

Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 0, 2, or 5.

val
is the choice to write or not write the values of the variables in the model, where:

If val=0, the values are not written to the basis file.
If val=1, the values are written to the basis file.
If val=2, the values are written to the basis file in binary format.

Specified as: a fullword integer. Its value must be 0, 1, or 2.

Note:

The binary option in MPS format, val = 2, is only valid for VM and MVS. 

 

On Return
rtcod
is the return code for the subroutine, where:

If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
See "Return Codes" for an explanation of return codes.

If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

Returned as: a fullword integer.

dspace
is the user-provided work area.


Returned as: a one-dimensional real array of doublewords.

Notes

  1. EKKBASO will generate a NAME card for the basis file with the name of the basis specified by the character control variable Cbasis. If Cbasis has not been set, the name of the basis on the NAME card will be blank.
  2. Inumchar should not be changed between the time when you enter your model and when the basis is written to stdout using EKKBASO. If you change Inumchar between specifying a model and writing out the basis, the results are unpredictable.
  3. If no names exist at the time EKKBASO is called, EKKBASO will write out names of the correct length as long as Inumchar is greater than or equal to 8.
  4. Selection lists may be used to control the output of EKKBASO.
  5. If EKKBCDO is called from a program written in FORTRAN, it may be neccessary to call EKKFCLS to flush the output buffer and close the MPS file that is created. In general, FORTRAN a main program does not automatically close C files on exit.
  6. Since the library modules are written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.

Examples

Refer to the following sample programs for examples of using EKKBASO:


[ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
[ EKKBASO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
[ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

EKKBCDO - Write out a Model in MPS Fixed Format

This subroutine writes the current model to stdout in MPS fixed format. For more information on MPS format, see "Passing Your Model Using Mathematical Programming System (MPS) Format".

Syntax

FORTRAN 

CALL EKKBCDO(rtcod,dspace,unit,type,nfields

C 

ekkbcdo(&rtcod,dspace,unit,type,nfields); 

On Entry
dspace
is the user-provided work area.


Specified as: a one-dimensional real array of doublewords.

unit
is the unit number specifying where the MPS format output file is to be written.


Specified as: a fullword integer; 0 unit 99.

Note:

  • If you are using any variant of UNIX, or any PC operating system, unit cannot be 0, 2, or 5.

    type
    is the type of matrix to write, where:

    If type=1, the numeric string is written in character format.
    If type=2, the numeric string is written in binary format.

    Specified as: a fullword integer. Its value must be 1 or 2.

    Note:

    The binary output option is only valid for VM and MVS.

    nfields
    is the number of row/coefficient pairs across each card image in the COLUMNS section.


    Specified as: a fullword integer. Its value must be 1 or 2.

    On Return
    rtcod
    is the return code for the subroutine, where:

    If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
    See "Return Codes" for an explanation of return codes.

    If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

    Returned as: a fullword integer.

    dspace
    is the user-provided work area.


    Returned as: a one-dimensional real array of doublewords.

    Notes

    1. EKKBCDO will generate a NAME card for the output file with the name of the model specified by the character control variable Cname. If Cname has not been set, the name of the model on the NAME card will be blank.
    2. Inumchar should not be changed between the time when you enter your model and when the model is written to stdout using EKKBCDO. If you change Inumchar between specifying a model and writing out the basis, the results are unpredictable.
    3. If no names exist at the time EKKBCDO is called, EKKBCDO writes out names of the correct length as long as Inumchar is greater than or equal to 8.
    4. Selection lists may be used to control the output of EKKBCDO.
    5. If EKKBCDO is called from a program written in FORTRAN, it may be neccessary to call EKKFCLS to flush the output buffer and close the MPS file that is created. In general, FORTRAN a main program does not automatically close C files on exit.
    6. EKKBCDO can only be used with unscaled matrices. You should not call EKKSCAL before EKKBCDO.
    7. Since the library modules are written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.

    Examples

    Refer to the following sample programs for examples of using EKKBCDO:


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSTAT | EKKPTMD | EKKGTMD | EKKFOPN ]
    [ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

    EKKSMAP - Print the Storage Map

    This subroutine prints information about the amount of dspace currently being used. This subroutine is useful for debugging. See "Debugging Your Program" for more information on debugging your program. Refer to "Storage Allocation" for more information about the storage layout.

    Syntax

    FORTRAN 

    CALL EKKSMAP(rtcod,dspace

    C 

    ekksmap(&rtcod,dspace); 

    On Entry
    dspace
    is the user-provided work area.


    Specified as: a one-dimensional real array of doublewords.

    On Return
    rtcod
    is the return code for the subroutine, where:

    If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
    See "Return Codes" for an explanation of return codes.

    If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

    Returned as: a fullword integer.

    dspace
    is the user-provided work area.


    Returned as: a one-dimensional real array of doublewords.

    Examples

    Refer to the following sample programs for examples of using EKKSMAP:


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSMAP | EKKPTMD | EKKGTMD | EKKFOPN ]
    [ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

    EKKSTAT - Print Problem Statistics

    This subroutine prints problem statistics. Refer to "Debugging Your Program" for more information.

    Syntax

    FORTRAN 

    CALL EKKSTAT(rtcod,dspace

    C 

    ekkstat(&rtcod,dspace); 

    On Entry
    dspace
    is the user-provided work area.


    Specified as: a one-dimensional real array of doublewords.

    On Return
    rtcod
    is the return code for the subroutine, where:

    If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
    See "Return Codes" for an explanation of return codes.

    If rtcod is nonzero, its value is the return code associated with the first occurrence of the highest severity message.

    Returned as: a fullword integer.

    dspace
    is the user-provided work area.


    Returned as: a one-dimensional real array of doublewords.

    Examples

    Refer to the following sample programs for examples of using EKKSTAT:


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSMAP | EKKSTAT | EKKGTMD | EKKFOPN ]
    [ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

    EKKPTMD - Put a Model out to an Output Stream

    This subroutine writes out a linear programming or mixed-integer programming model (NOT in MPS format). The models "put" by this subroutine can be retrieved with EKKGTMD.

    Syntax

    FORTRAN 

    CALL EKKPTMD(rtcod,dspace,unit

    C 

    ekkptmd(&rtcod,dspace,unit); 

    On Entry
    dspace
    is the user-provided work area.


    Specified as: a one-dimensional real array of doublewords.

    unit
    is the unit number specifying where the model is to be written.


    Specified as: a fullword integer; 0 unit 99.

    Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 0, 2, or 5.

    On Return
    rtcod
    is the return code for the subroutine, where:

    If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
    See "Return Codes" for an explanation of return codes.

    If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

    Returned as: a fullword integer.

    dspace
    is the user-provided work area.


    Returned as: a one-dimensional real array of doublewords.

    Notes

    1. You can specify what parts of the model are written to the file with the integer control variable Imodelmask.
    2. If you want to save a MIP model, your EKKMSLV call must use direct access files, and the files must be saved in addition to calling EKKPTMD. This saves all the basis and matrix information.
    3. Before returning, EKKPTMD does a C equivalant to a FORTRAN REWIND.
    4. Since the library modules are written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.
    5. EKKPTMD may be used with a network model only if a column or index copy of the matrix exists.
    6. EKKPTMD should not be used for a quadratic programming problem. It will not save all the information needed for the problem (only the linear part of the problem is saved).
    7. In a driver program written in C, a call to EKKFCLS should follow a call to EKKPTMD in order to flush the FORTRAN output buffer and close the output file.

    Example

    Refer to "Sample FORTRAN Program EXPTMD" for an example of using EKKPTMD.


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKFOPN ]
    [ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

    EKKGTMD - Get a Model from an Input Stream

    This subroutine reads in a linear programming or mixed-integer programming model (NOT in MPS format). It then becomes the current model. This subroutine is used to "get" files that have been "put" by EKKPTMD.

    Syntax

    FORTRAN 

    CALL EKKGTMD(rtcod,dspace,unit

    C 

    ekkgtmd(&rtcod,dspace,unit); 

    On Entry
    dspace
    is the user-provided work area.


    Specified as: a one-dimensional real array of doublewords.

    unit
    is the unit number specifying from which the model is to be read.


    Specified as: a fullword integer; 0 unit 99.

    Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, or 6.

    On Return
    rtcod
    is the return code for the subroutine, where:

    If rtcod = 0, the subroutine completed successfully. Only informational messages were issued.
    See "Return Codes" for an explanation of return codes.

    If rtcod is not zero, its value is the return code associated with the first occurrence of the highest severity message.

    Returned as: a fullword integer.

    dspace
    is the user-provided work area.


    Returned as: a one-dimensional real array of doublewords.

    Notes

    1. You can specify what parts of the model are read from the file with the integer control variable Imodelmask. Refer to "EKKIGET - Request Current Values of Integer Control Variables" for a list of acceptable values for Imodelmask.
    2. If you want to restore a MIP model, your EKKMSLV call must use direct access files, and the files must be restored in addition to calling EKKGTMD. This restores all the basis and matrix information.
    3. Before returning, EKKGTMD does the C equivalent of a FORTRAN REWIND.
    4. Since the library modules are now written in C, a FORTRAN open statement can not be used to associate a named file with a unit to be supplied to any of the library I/O modules. The library routine EKKFOPN (which see at "EKKFOPN - Open and Connect Files to FORTRAN I/O Units") is provided to mimic the FORTRAN open statement without using the FORTRAN operating environment. Similarly, one can not use a FORTRAN close statement to dissociate a named file from the unit supplied to a library module, nor a FORTRAN rewind statement to reinitialize reading from a named file associated with a unit that has been supplied to a library module. EKKFCLS ("EKKFCLS - Close and Disconnect FORTRAN I/O Units") and EKKREW ("EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers") have been provided for these purposes.
    5. EKKGTMD may be used with a network model only if a column or index copy of the matrix exists.
    6. EKKGTMD should not be used with EKKQSLV. EKKGTMD will not restore all the information needed for a quadratic programming problem (only the linear part of the problem is restored).

    Example

    Refer to "Sample FORTRAN Program EXPTMD" for an example of using EKKGTMD.


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD ]
    [ EKKFCLS | EKKFREW | Bottom of Page | Index to Modules ]

    EKKFOPN - Open and Connect Files to FORTRAN I/O Units

    This subroutine enables Optimization Library applications written in either FORTRAN or C to open and connect named files to FORTRAN I/O units. This subroutine is provided as a convenience to both C and FORTRAN programmers. It mimics the FORTRAN open statement, but does not use the FORTRAN run-time environment. The FORTRAN open statement itself will not connect a file name to a unit number that is to be supplied to any of the library I/O routines. Any messages from EKKFOPN will have been generated by the C run-time library.

    Syntax

    FORTRAN 

    CALL EKKFOPN(unit,file,status,access,form,blank,recl,iostat

    C 

    ekkfopn(unit,file,status,access,form,blank,recl,&iostat); 

    On Entry
    unit
    is the number of the FORTRAN I/O unit to be connected to the file.


    Specified as: a fullword integer; 0 unit 99.

    Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, 5, or 6.

    file
    is the name of the file to be opened.


    Specified as: a character string.

    status
    is the status of the file when it is opened, where:

    If status=NEW, EKKFOPN creates file and attaches it to unit.
    If status=OLD, EKKFOPN attaches file to unit.
    If status=UNKNOWN, EKKFOPN either creates file and attaches it to unit if file does not exist, or attaches file to unit if it does exist.

    For more information, see the appropriate FORTRAN manuals for your operating platform.

    Specified as: a character string.

    access
    is the access method for the connection to the file, where:

    If access=SEQUENTIAL, access to file by EKKFOPN will be sequential.
    If access=DIRECT, access to file by EKKFOPN will be direct.

    For more information, see the appropriate FORTRAN manuals for your operating platform.

    Specified as: a character string.

    form
    is the format of the file connection, where:

    If form=FORMATTED, EKKFOPN connects file for formatted input or output.
    If form=UNFORMATTED, EKKFOPN connects file for unformatted input or output.

    For more information, see the appropriate FORTRAN manuals for your operating platform.

    Specified as: a character string.

    blank
    is the default interpretation of blanks when a format specification is used, where:

    If blank=ZERO, EKKFOPN specifies that imbedded blanks in numeric fields of file are interpreted as zeroes.
    If blank=NULL, EKKFOPN specifies that imbedded blanks in numeric fields of file are ignored.

    For more information, see the appropriate FORTRAN manuals for your operating platform.

    Specified as: a character string.

    recl
    is the length of each record in file, if access= DIRECT. If access=SEQUENTIAL, then recl must be equal to zero.

    Specified as: a fullword integer; recl ge 0.

    On Return
    iostat
    is the value of the iostat specifier in the FORTRAN OPEN statement, where:

    If iostat=0, the OPEN operation completed without error.
    If iostatis not 0, an error occurred during the OPEN operation. The meaning of the value depends on the platform.
    See the appropriate FORTRAN manuals for your operating platform.

    Returned as: a fullword integer.

    Example

    Refer to "Sample C Program EXNAME" for an example of using EKKFOPN.


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD ]
    [ EKKFOPN | EKKFREW | Bottom of Page | Index to Modules ]

    EKKFCLS - Close and Disconnect files from FORTRAN I/O Units

    This subroutine enables Optimization Library applications written in either FORTRAN or C to disconnect named files from FORTRAN I/O units. This subroutine is provided as a convenience to both C and FORTRAN programmers. It mimics the FORTRAN close statement, but does not use the FORTRAN run-time environment. The FORTRAN close statement itself will not disconnect a file name from a unit number that has been supplied to any of the library I/O routines. Any messages from EKKFCLS will have been generated by the C run-time library.

    Syntax

    FORTRAN 

    CALL EKKFCLS(unit,status,iostat); 

    C 

    ekkfcls(unit,status,&iostat); 

    On Entry
    unit
    is the number of the FORTRAN I/O unit to be disconnected from the file.


    Specified as: a fullword integer; 0 unit 99.

    Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, 5, or 6.

    status
    is the disposition of the file after it is closed, where:

    If status=KEEP, the file attached to unit will continue to exist after EKKFCLS finishes processing.
    If status=DELETE, the file attached to unit will be deleted after EKKFCLS finishes processing.

    For additional information, see the appropriate FORTRAN manuals for your platform.

    Specified as: a character string.

    On Return
    iostat
    is the value of the iostat specifier in the FORTRAN CLOSE statement, where:

    If iostat=0, the CLOSE operation completed without error.
    If iostatne 0, an error occurred during the CLOSE operation. The meaning of the value depends on the platform.
    See the appropriate FORTRAN manuals for your platform.

    Returned as: a fullword integer.

    Examples

    Refer to the following sample programs for examples of using EKKFCLS:


    [ Top of Page | EKKMPS | EKKQMPS | EKKPRTS | EKKSEL | EKKBASI ]
    [ EKKBASO | EKKBCDO | EKKSMAP | EKKSTAT | EKKPTMD | EKKGTMD ]
    [ EKKFOPN | EKKFCLS | Bottom of Page | Index to Modules ]

    EKKFREW - Rewind Files Associated with FORTRAN I/O Unit numbers

    This subroutine enables Optimization Library applications written in either C or FORTRAN to open files by name, and to identify them by numbers, similar to FORTRAN I/O unit numbers, to library I/O subroutines, which are all written in C. This subroutine mimics the equivalent FORTRAN open statement, without using the FORTRAN operating environment. Any resulting messages are from the C run-time library. You can NOT use a FORTRAN open statement to associate a file with a unit number to be accessed by a library I/O routine.

    Syntax

    FORTRAN 

    EKKFREW(unit); 

    On Entry
    unit
    is the (pseudo) I/O unit number of the file to be "rewound."


    Specified as: a fullword integer; 0 unit 99.

    Note: If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, 5, or 6.


    [ Top of Page | EKKBASI | EKKBASO | EKKBCDO | EKKFCLS | EKKFOPN ]
    [ EKKFREW | EKKGTMD | EKKMPS | EKKPRTS | EKKPTMD | EKKQMPS ]
    [ EKKSEL | EKKSMAP | EKKSTAT | Index to Modules ]