Model Definition and Description

  • Index to all Optimization Libarary Modules
  • EKKDSCA - Describe a Mathematical Programming Application
  • EKKDSCM - Describe a Mathematical Programming Model
  • EKKDSCB - Describe One Block of the Problem Matrix for a Model
  • EKKRPTB - Repeat an Existing Matrix Block As a New Block in the Current
  • EKKLMDL - Specify the Linear Part of a Model
  • EKKIMDL - Specify the Integer Parts of a MIP Model
  • EKKNMDL - Specify a Network Model
  • EKKQMDL - Specify the Quadratic Parts of a QP Model
  • EKKPMDL - Specify a Parametric Model
  • EKKSMDL - Specify a Model in Spreadsheet Format
  • EKKEMDL - Specify an Empty Model

  • [ Top of Page | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL | EKKIMDL ]
    [ EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKDSCA - Describe a Mathematical Programming Application

    This subroutine should be called once at the beginning of each application. It is the way for you to describe your application to the Optimization Library modules. It also allows you to specify the number of models in your application. EKKDSCA reserves space at the bottom of dspace for model information for the number of models specified. See "OSL Terms and Concepts" for more information on applications, models, and storage.

    Syntax

    FORTRAN  CALL EKKDSCA(rtcod,dspace,ndwords,nmodel
    C  ekkdsca(&rtcod,dspace,ndwords,nmodel);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    ndwords
    is the number of doublewords in dspace.

    Specified as: a fullword integer.
    Note: An estimate for ndwords is given by the following equation. Additional space may be necessary in some situations. A message will be issued to inform you if dspace needs to be larger to solve your problem. 
    10,000 + 1000*(number of models)
           + 10*(maximum number of columns)
           +  6*(maximum number of columns if EKKSOBJ is called)
           +  6*(maximum number of columns if EKKSBND is called)
           +  5*(maximum number of columns if EKKSPAR is called)
           + 10*(maximum number of rows)
           +  6*(maximum number of rows if EKKSBND is called)
           +  4*(maximum number of rows if EKKSPAR is called)
           + 10*(maximum number of non-zero elements)
           + (2*(number of EKKCOPY or EKKNWMT copies)
              *(maximum number of non-zero elements))
           + (any user space allocated using EKKHIS)
    Note: MIP algorithms may sometimes require significantly more storage. It is not possible to predict this. 
    nmodel
    is the number of models in the application.

    Specified as: a fullword integer; nmodel >= 1.
    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.

    Note

    All but the first call to EKKDSCA should be preceded by a call to EKKINIT.

    Examples

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


    [ Top of Page | EKKDSCA | EKKDSCB | EKKRPTB | EKKLMDL | EKKIMDL ]
    [ EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKDSCM - Describe a Mathematical Programming Model

    This subroutine allows you to describe the models in your application to the Optimization Library. The solver modules use the model information supplied by the most recent call to EKKDSCM or EKKGTMI.

    This subroutine should be called once for each model in your application. If you do not call EKKDSCM, the model input subroutine (such as EKKMPS, EKKLMDL, EKKNMDL, or EKKSMDL) will call EKKDSCM for you with model=1 and nblock=1.

    If your matrix is made up of multiple blocks, use EKKDSCB or EKKRPTB to describe these blocks to the Optimization Library. See "OSL Terms and Concepts" for more information on applications, models, and blocks.

    Syntax

    FORTRAN  CALL EKKDSCM(rtcod,dspace,model,nblock
    C  ekkdscm(&rtcod,dspace,model,nblock);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    model
    is the model number to describe.

    Specified as: a fullword integer; model <= nmodel in EKKDSCA.
    nblock
    is the number of blocks used to define the matrix for the model.

    Specified as: a fullword integer.
    On Return
    rtcod
    is the return code for the subroutine, where:

    See "Return Codes" for an explanation of return codes.

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

    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. EKKDSCM calls EKKPTMI if there already is a current model.
    2. A minimum of five blocks is required for each quadratic programming model.
    3. A call to EKKDSCM resets the values of all the control variables to whatever they were after the first call to EKKDSCM in the program. The reset values will be the default values, unless the control variables had been set prior to the very first call to EKKDSCM. For example, if an application consists of several models, and each model is a maximization problem, it is possible to set Rmaxmin after a call to EKKDSCA, but before any calls to EKKDSCM. This sets the initial value of Rmaxmin for the entire application.
    4. This procedure works for all control variables except those integer control variables that determine the sizes of arrays, such as Imaxcols, Imaxrows, Imaxints, Imaxsets, and Imaxintinfo. These control variables cannot be set to an initial value that will persist for the entire application. Within each model, these can be set only once.

    Examples

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


    [ Top of Page | EKKDSCA | EKKDSCM | EKKRPTB | EKKLMDL | EKKIMDL ]
    [ EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKDSCB - Describe One Block of the Problem Matrix for a Model

    This subroutine is used to describe one block of the problem matrix for a model stored as a collection of blocks. "OSL Terms and Concepts" gives more information about how blocks are used to form a constraint matrix.

    EKKMPS, EKKLMDL, EKKNMDL, or EKKSMDL must be called before calling this subroutine.

    Syntax

    FORTRAN  CALL EKKDSCB(rtcod,dspace,type,block,mrow,mcol,dels,rbas, cbas, ncol, nel)
    C  ekkdscb(&rtcod,dspace,type,block,mrow,mcol,dels,rbas, cbas, ncol, nel);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    type
    is the type of block, where:

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

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

    block
    is the block number.

    Specified as: a fullword integer; block <= nblock in EKKDSCM.
     
    Note: If block=0, the next available block is used. 
    mrow
    mcol
    dels
    the elements of the matrix block.

    Specified as: a one-dimensional real array of doublewords with nel entries.
    rbas
    is the row base to be added to all row numbers.

    Specified as: a fullword integer.
    cbas
    is the column base to be added to all of the column numbers.

    Specified as: a fullword integer.
    ncol
    is the number of columns.

    Specified as: a fullword integer.
    nel
    is the number of elements in the block.

    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 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. If there are overlapping entries in two or more blocks, the corresponding entry in the composite matrix will be the sum of the entries in the overlapping blocks.
    2. If you add a block to a matrix that has been scaled, you must scale the elements in the block. The scale factors for the matrix begin in dspace at the locations pointed to by the index control variables, Nrowscales and Ncolscales. See "Sample FORTRAN Program EXNGET" for an example use of the scaling factors.
    3. rbas and cbas are automatically added to the indices specified by the mrow and mcol arrays. You do not need to do so before calling EKKDSCB.
    4. EKKDSCB will accept and maintain any zero coefficients in the dels array. A warning message is issued to indicate the number of zero coefficients passed to EKKDSCB.
    5. In all Optimization Library modules, 1031 is used as an operational value for +infinity, and -1031 is used as an operational value for -infinity.
    6. EKKDSCB cannot be used to describe a block of a network problem unless a column or index copy of the constraint matrix exists.

    Examples

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


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKLMDL | EKKIMDL ]
    [ EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKRPTB - Repeat an Existing Matrix Block as a New Block in the Current Problem Matrix

    This subroutine copies a specified matrix block into your matrix. If you are working on a model that requires a block that is similar to one you previously specified, you can copy it to the current model, even if the block you are copying is from a different model. After you copy the block, you can modify it to create the block you need.

    Syntax

    FORTRAN  CALL .br EKKRPTB(rtcod,dspace,modelin,blockin, blockout, rbas, cbas, copy)
    C  ekkrptb (&rtcod, dspace, modelin, blockin, blockout, rbas, cbas, copy);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    modelin
    is the number of the model that contains the block to be repeated.

    Specified as: a fullword integer; modelin <= nmodel in EKKDSCA
    .
    Note: If modelin = 0, the block is in the current model. 
    blockin
    is the number of the block in model modelin to be repeated.

    Specified as: a fullword integer; blockin <= nblock in EKKDSCM.
     
    Note: If blockin = 0, the last block to be created is used. 
    blockout
    is the number of the block to create in the current model that will hold the repeated block.

    Specified as: a fullword integer; blockout <= nblock in EKKDSCM.
     
    Note: If blockout = 0, the next available block is used. 
    rbas
    is the number of rows down to place the new block (that is, the offset). A value of 0 indicates that the new block is to be put in the first row.

    Specified as: a fullword integer.
    cbas
    is the number of columns over to place the new block (that is, the offset). A value of 0 indicates that the new block is to be put in the first column.

    Specified as: a fullword integer.
    copy
    specifies whether the actual block data should be copied, where:

    If copy=0, do not copy the data for the block; use pointers instead.
    If copy=1, copy all data for the block.
    Specified as: a fullword integer.

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

    See "Return Codes" for an explanation of return codes.

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

    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. If you need to limit your use of dspace and you do not need the data for a block, specify copy=0.
    2. Any changes to a block that is copied into other models by the use of pointers (that is, copy=0) will affect all copies of the block. Any changes to a block that is directly copied into other models (that is, copy=1) will affect only that block.

    Example

    Refer to "Sample FORTRAN Program EXRPTB" for an example of using EKKRPTB.


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKIMDL ]
    [ EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKLMDL - Specify the Linear Part of a Model

    This subroutine specifies the linear part of a model. It creates the necessary data structures in dspace. See "Passing Your Model Using Library Data Structures" for additional information on its use.

    Syntax

    FORTRAN  CALL EKKLMDL(rtcod,dspace,type,nr,nc,nel,dobj,drlo,drup, dclo, dcup, mrow, mcol, dels)
    C  ekklmdl(&rtcod,dspace,type,nr,nc,nel,dobj,drlo,drup, dclo, dcup, mrow, mcol, dels);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    type
    is the format the matrix is stored in, where:

    If type=1, a copy of the matrix is stored by indices.
    See "Storage-by-Indices" for information on storage-by-indices.
    If type=2, a copy of the matrix is stored by columns.
    See "Storage-by-Columns" for information on storage-by-columns.

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

    nr
    is the number of rows.

    Specified as: a fullword integer.
    nc
    is the number of columns.

    Specified as: a fullword integer.
    nel
    is the number of nonzero elements.

    Specified as: a fullword integer; if the matrix is stored by columns, nel = mcol(nc+1)-1.
    dobj
    the coefficients of the objective function.

    Specified as: a one-dimensional real array of doublewords with nc entries.
    drlo
    is the lower bounds on the rows.

    Specified as: a one-dimensional real array of doublewords with nr entries.
    drup
    is the upper bounds on the rows.

    Specified as: a one-dimensional real array of doublewords with nr entries.
    dclo
    is the lower bounds on the columns.

    Specified as: a one-dimensional real array of doublewords with nc entries.
    dcup
    is the upper bounds on the columns.

    Specified as: a one-dimensional real array of doublewords with nc entries.
    mrow
    mcol
    dels
    is the elements of the matrix.

    Specified as: a one-dimensional real array of doublewords with nel entries.
    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. The basis is set to all logical variables if a basis does not already exist.
    2. If you want to use EKKxGET and EKKxSET to set any control variables before the call to EKKLMDL, EKKMPS, EKKNMDL, or EKKSMDL, you must call EKKDSCM before the call to EKKxGET and EKKxSET. This is especially true if you are setting Imaxrows and Imaxcols.
    3. EKKLMDL accepts and maintains any zero coefficients that are in the dels array. A warning message is issued to indicate the number of zero coefficients that were passed to EKKLMDL.
    4. If you are storing your matrix by indices, a nonpositive value in the mrow or mcol arrays will end processing of the matrix coefficients. An informational message will be issued indicating the difference between the number of elements that were read and nel. If this is not what you expected, check your specification of the mrow or mcol arrays.
    5. If you do not want to enter the elements of your matrix when you call EKKLMDL, set nel to zero. You may then enter the elements of your matrix using EKKDSCB or EKKRPTB. See "Sample FORTRAN Program EXDSCB" for an example of how to do this.
    6. 1031 is used as an operational value for +infinity, and -1031 is used as an operational value for -infinity.
    7. 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.

    Examples

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


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKIMDL - Specify the Integer Parts of a Model

    This subroutine gives you flexibility in defining the integer parts of a mixed-integer programming problem. Previously, your only choice was to use MPS format (EKKMPS) to define such a problem. Now, if you want to use another format, first use EKKLMDL or EKKMPS to specify the linear problem, and then use EKKIMDL to describe the integer information.

    Syntax

    FORTRAN  CALL EKKIMDL(rtcod,dspace,nints,intnums,nsets,type, priority, ntotinfo, setindx, sets, dnpcost, uppcost)
    C  ekkimdl(&rtcod,dspace,nints,intnums,nsets,type, priority, ntotinfo, setindx, sets, dnpcost, uppcost);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional doubleword real array.
    nints
    is the number of integer variables. If nints = 0, then all variables will be identified as integer variables; some may be general integer variables and some may be 0-1 integer variables, depending on their upper and lower bounds.

    Specified as: a full word integer of value 0 <= nints and not greater than Imaxints as explained in note 7 below. (Refer to "The General Case".)
    intnums
    is the variable numbers of the integer variables.

    Specified as: a one-dimensional fullword integer array of length nints.
    nsets
    is the number of sets of integer variables. If nsets=0, all integer variables are regular and put in one set.

    Specified as: a fullword integer of length 0 <= nsets <= Imaxsets.
    type
    is the type of each set, where:

    If type=1, the set is a type 1 Special Ordered Set
    If type=2, the set is a type 2 Special Ordered Set
    If type=3, the set is a type 3 Special Ordered Set
    If type=4, the set contains regular integer variables (that is, not in a Special Ordered Set)

    Specified as: a one-dimensional fullword integer array of length nsets.

    priority
    is the priority of each set. If the ith entry of priority = 0, then all sets numbered i or greater get a default priority of 1000.

    Specified as: a one-dimensional fullword integer array of length nsets.
    ntotinfo
    is the sum of the sizes of all the sets, plus the number of integer variables not in sets. (Thus, if a variable is a member of more than one set, it should be counted for each occurrence.)

    Specified as: a fullword integer of value 0 <= ntotinfo <= Imaxintinfo.
    setindx
    is the array of starting points of the variable numbers of each set in the sets array. This is explained more fully in the discussion of the sets parameter, which follows.

    Specified as: a one-dimensional fullword integer array of length nsets + 1.
    sets
    the variable numbers of the variables in sets. The variable numbers of the members of a particular set appear in adjacent entries of the sets array. The variable numbers are addressed indirectly, by means of the setindx array. The ith entry of the setindx array is the sequence number (i.e. FORTRAN index) in the sets array of the variable number of the first member of the ith set. The variable number of the last member of the ith set is the (p-1)th entry of the sets array where p is the (i+1)th entry of the setindx array.

    Specified as: a one-dimensional fullword integer array of length ntotinfo.
    dnpcost
    is the "down pseudocost" of each variable in a set. If ith entry of dnpcost = 0, then all variables numbered i or greater in the set get a default down pseudocost of 0.001.

    Specified as: a one-dimensional doubleword real array of length ntotinfo.
    uppcost
     
    Note: This means that if uppcost is totally filled with zeroes, default reference row values will be used for all Special Ordered Sets, and default up-pseudocosts will be used for all other variables. This is sufficient for most applications. 
     
    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. 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, EKKIMDL, EKKLMDL, 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, EKKIMDL, EKKLMDL, or EKKSMDL, you must call EKKDSCM before calling EKKIGET or EKKISET.
    2. The integer parts of a spreadsheet mixed-integer programming problem can be defined by EKKSMDL. For more information, see "Passing Your Model Using Spreadsheet Format".
    3. If any variables are not put in a set (that is, they appear in nints but not in sets), they are placed in a set of their own at the end of EKKIMDL processing. A warning message is issued when this happens. This set has a priority of 1000, and the pseudocosts are set to 0.001.
    4. If multiple calls are made to EKKIMDL, each new call overwrites the previous one. That is, the earlier calls no longer apply. Note that if the integer control variable Imaxints was not set before the first call to EKKIMDL, then Imaxints will be set to nints by the first call and it cannot be changed.
    5. 1031 is used as an operational value for +infinity, and -1031 is used as an operational value for -infinity. However, you should not use 1031 as a large upper bound for a general integer variable whose lower bound is 0. If a variable is identified in the call to EKKIMDL as an integer variable, its lower bound is 0, and its upper bound is 1031, then EKKIMDL will reset the upper bound to 1, thus specifying that the variable is a 0-1 integer variable.
    6. To formulate special ordered sets using EKKIMDL, convexity constraints often must be added to your formulation. For example, to define an SOS of type 3 in which exactly one member must have the value 1 and all other members must have the value 0, the following constraint should be added:
    7. x1+x2+x3+...+xn=1
      where x1...xn are the members of the special ordered set. This constraint need not be added to an MPS file to be read by EKKMPS but they are required for EKKIMDL. Similar convexity constraints are needed for special ordered sets of type 2 when the application requires them.
    8. If the integer control variable Imaxints has been set to a positive number before the call to EKKIMDL, then nints must satisfy 0 <= nints <= Imaxints, and the restriction that the number of integer variables cannot exceed the value of Imaxints will be imposed, even if nints = 0. If the integer control variable Imaxints has not been set before the call to EKKIMDL, then EKKIMDL will set the value of Imaxints to the number of integer variables in the problem (as determined by the value of nints). If the integer control variable Imaxints has been set to a negative number before the call to EKKIMDL, then EKKIMDL will reset the value of Imaxints to the number of integer variables in the problem plus the negative of the previous value of Imaxints.

    Examples

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


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKIMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKNMDL - Specify a Network Model

    This subroutine specifies a pure network model allowing you to enter the problem in a more concise format that the EKKMPS format, it also saves storage, and improves performance. You can also use EKKMPS, EKKLMDL, or EKKSMDL to load a network problem, if you prefer.

    See "Passing Your Model Using Library Data Structures" for information on using EKKNMDL.

    Syntax

    FORTRAN  CALL EKKNMDL(rtcod,dspace,type, action, narc, nnode, from, to, cost, alo, aup, nlo, nup, res1, res2)
    C  ekknmdl(&rtcod,dspace,type, action, narc, nnode, from, to, cost, alo, aup, nlo, nup, res1, res2);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    type
    is the type of problem to solve, where:

    If type=1, the problem is a pure network problem.

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

    action
    is the action to be taken, where

    If action=1, generate an incidence matrix stored by columns
    If action=2, generate an incidence matrix stored by indices
    If action=3, do not generate a row or column copy of the incidence matrix.

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

    narc
    the number of arcs.

    Specified as: a fullword integer.
    nnode
    the number of nodes.

    Specified as: a fullword integer.
    from
    the array of "from" nodes.

    Specified as: a fullword integer array of length narc.
    to
    the array of "to" nodes.

    Specified as: a fullword integer array of length narc.
    cost
    the array of costs.

    Specified as: a doubleword real array of length narc.
    alo
    an array of lower bounds on arc flows.

    Specified as: a doubleword real array of length narc.
    aup
    an array of upper bounds on arc flows.

    Specified as: a doubleword real array of length narc.
    nlo
    the array of lower bounds on node exogenous flows.

    Specified as: a doubleword real array of length nnode.
    nup
    the array of upper bounds on node exogenous flows.

    Specified as: a doubleword real array of length nnode.
    res1
    a reserved variable.

    Specified as: a one-dimensional doubleword array of length 1.
    res2
    a reserved variable.

    Specified as: a one-dimensional doubleword array of length 1.
    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. For network flow problems, columns represent arcs and rows represent nodes.
    2. Option action=3 is provided for applications that do not require a factorized basis (that is, applications that involve a call to EKKSSLV, EKKQSLV, EKKSPAR, EKKSBND, or EKKSOBJ). If action=3, the constraint matrix is not created. This reduces use of dspace.
    3. 1031 is used as an operational value for +infinity, and -1031 is used as an operational value for -infinity.

    Example

    Refer to "Sample FORTRAN Program EXNMDL" for an example of using EKKNMDL.


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKIMDL | EKKNMDL | EKKPMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKQMDL - Specify the Quadratic Parts of a Model

    This subroutine specifies a quadratic matrix for a quadratic programming model. It creates data structures in dspace. See "Passing Your Model Using Library Data Structures" for more information on its use. EKKLMDL or EKKMPS must be called before you call EKKQMDL.

    Syntax

    FORTRAN  CALL EKKQMDL(rtcod,dspace,type, nelq, rowq, colq, delsq)
    C  ekkqmdl(&rtcod,dspace,type, nelq, rowq, colq, delsq);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    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.

    nelq
    is the number of nonzero elements in the quadratic matrix.

    Specified as: a fullword integer.
     
    Note: nelq = colq(Inumcols + 1) - 1 for type = 2. 
    rowq
    colq
    delsq
    is the elements of the matrix.

    Specified as: a one-dimensional real array of doublewords with nelq entries.
    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. EKKDSCM must be called with a minimum of five blocks for each quadratic programming model.
    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. 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.
    4. EKKQMDL 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 EKKQMDL before calling EKKSSLV.
    5. Similarly, you may want to have EKKQSLV solve your quadratic programming problem, then create a new quadratic matrix using 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.

    6. 1031 is used as an operational value for ++infinity, and -1031 is used as an operational value for -infinity.

    Examples

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


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKIMDL | EKKNMDL | EKKQMDL | EKKSMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKPMDL - Specify a Parametric Model

    This subroutine initializes five arrays that are used by the EKKSPAR subroutine to solve an LP parametric problem. EKKPMDL puts the arrays in dspace. See "Using LP Sensitivity Analysis and LP Parametrics" for more information on its use.

    Syntax

    FORTRAN  CALL EKKPMDL(rtcod,dspace,cdelta, lrdelta, urdelta, lcdelta, ucdelta, mask)
    C  ekkpmdl(&rtcod,dspace,cdelta, lrdelta, urdelta, lcdelta, ucdelta, mask);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    cdelta
    is the vector to be added to the objective function coefficients.

    Specified as: a doubleword real array the length of the number of columns (Inumcols).
    lrdelta
    is the vector to be added to the lower bounds for rows.

    Specified as: a doubleword real array the length of the number of rows (Inumrows).
    urdelta
    is the vector to be added to the upper bounds for rows.

    Specified as: a doubleword real array the length of the number of rows (Inumrows).
    lcdelta
    is the vector to be added to the lower bounds for columns.

    Specified as: a doubleword real array the length of the number of columns (Inumcols).
    ucdelta
    is the vector to add to the upper bounds for columns.

    Specified as: a doubleword real array the length of the number of columns (Inumcols).
    mask
    is a bit mask to identify which of the above vectors are applicable, where:

    If 1 mask, the cdelta vector is applicable.
    If 2 mask, the lrdelta vector is applicable.
    If 4 mask, the urdelta vector is applicable.
    If 8 mask, the lcdelta vector is applicable.
    If 16 mask, the ucdelta vector is applicable.

    For example, if mask=21, EKKPMDL uses the cdelta, urdelta, and ucdelta vectors, and ignores lrdelta and lcdelta.

    See "Control Variable Bit Masks" for more information about bit masks.

    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 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. You must use one of four subroutines--EKKMPS, EKKLMDL, EKKNMDL, or EKKSMDL--to enter the LP model before you call EKKPMDL to build the arrays for a simplex parametric problem.
    2. After your program calls EKKPMDL, the index control variables Nsparcost, Nsparrlo, Nsparrup, Nsparclo, and Nsparcup are set if mask has been set to indicate they were applicable.
    3. If mask is set to ignore some vectors, those arrays in the calling sequence do not have to be of full length.
    4. The arrays created by EKKPMDL in dspace are of the length specified by Imaxrows or Imaxcols, depending on whether they are row or column arrays. This means that if Inumrows is less than Imaxrows, or if Inumcols is less than Imaxcols, entries are reserved in the arrays to allow the addition of rows and columns up to the maximum.

    Example

    Refer to "Sample FORTRAN Program EXPARA2" for an example of using EKKPMDL.


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKIMDL | EKKNMDL | EKKQMDL | EKKPMDL | EKKEMDL | Bottom of Page ]
    [ Index to Modules ]

    EKKSMDL - Specify a Model in Spreadsheet Format

    This subroutine specifies a file in spreadsheet format from a file created by a spreadsheet program, such as Lotus 1-2-3. For information on using Lotus 1-2-3 Version 3.0 in formulating linear, quadratic, and mixed-integer programming problems, see "Passing Your Model Using Spreadsheet Format".

    Syntax

    FORTRAN  CALL EKKSMDL(rtcod,dspace,unit, action, type, res)
    C  ekksmdl(&rtcod,dspace,unit, action, type, res);
    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 or the output is updated.

    Specified as: a fullword integer; 0 <= unit <= 99.

    Notes:

    1. If you are using any variant of UNIX or any PC operating system, unit cannot be 1, 2, or 6.
    2. If you are using MVS, see "Processing Your Program" for information on the JCL needed to specify a unit.
    action
    is the action to be taken, where:

    If action=1, the spreadsheet worksheet file is read.
    If action=2, the spreadsheet worksheet file is updated.

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

    type
    is the type of spreadsheet, where:

    If type=1, the spreadsheet is a Lotus 1-2-3 Version 3.0 spreadsheet.

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

    res
    is a reserved variable.

    Specified as: a fullword integer. Its value must be 0.
    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. Only nonempty, unprotected cells in the solution range(s) are updated.
    2. To use EKKSMDL, the location in the spreadsheet of certain sets of cells--the adjustable cells, the constraint cells, and the objective cell--must be specified. Typically, these locations are specified by making assignments to the character control variables Cssolution, Csconstrts, and Csobjective. For more information, see "Passing Your Model Using Spreadsheet Format".
    3. If an application that solves multiple optimization problems has multiple calls to EKKSMDL, it should include an assignment to Imaxrows and Imaxcols before the first call to EKKSMDL. This assignment saves extra space for columns and constraint rows. EKKSMDL includes a call to EKKLMDL, so the usage notes for EKKLMDL apply to EKKSMDL. See "EKKLMDL - Specify the Linear Part of a Model".
    4. If an application program that solves multiple mixed-integer programming problems has multiple calls to EKKSMDL and EKKMSLV, it should include an assignment to Imaxints before the first call to EKKSMDL. This assignment saves extra space for integer variables. EKKSMDL includes a call to EKKIMDL if the model contains integer variables; so the usage notes for EKKIMDL apply to EKKSMDL. See "EKKIMDL - Specify the Integer Parts of a Model".
    5. EKKSMDL includes a call to EKKQMDL if the model contains quadratic data; so the usage notes for EKKQMDL also apply to EKKSMDL. See "EKKQMDL - Specify the Quadratic Parts of a Model".
    6. Many spreadsheet programs other than Lotus 1-2-3 provide a facility for producing Lotus 1-2-3 worksheet files. For information about whether your spreadsheet program can create a Lotus 1-2-3 work file, see your spreadsheet documentation.
    7. Most spreadsheet files can be transferred between systems. See the Lotus 1-2-3 documentation for restrictions.
    8. EKKSMDL includes a call to EKKLMDL if linear constraints are found in the worksheet file. The call to EKKLMDL is followed by a call to EKKNAME for the creation of row and column names. Control variables that apply to EKKNAME also apply to EKKSMDL.
    9. Integer control variable Ismdltypemask will be set to indicate the type of model read in by EKKSMDL.
    10. In library routines, 1031 is used as an operational value for +infinity, and -1031 is used as an operational value for -infinity.
    11. If you are using MVS, the 1-2-3 worksheet file must be a contiguous file. This can be ensured by coding the space parameter as follows when creating the file:
    12. SPACE=(TRK,(nnn),,CONTIG)
      where nnn is the number of tracks allocated to this file.
    13. 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.

    Example

    Refer to "Sample FORTRAN Program EXSMDL" for an example of using EKKSMDL.


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKIMDL | EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | Bottom of Page ]
    [ Index to Modules ] EKKEMDL - Specify an Empty Model This subroutine specifies a completely empty model, which can be populated later with EKKCOL and EKKROW.

    Syntax

    FORTRAN  CALL EKKEMDL(rtcod,dspace,nrow,ncol,nels); 
    C  ekkemdl(&rtcod,dspace,nrow,ncol,nels);
    On Entry
    dspace
    is the user-provided work area.

    Specified as: a one-dimensional real array of doublewords.
    nrow
    is the number of rows to be provided for in the empty model.

    Specified as: a fullword integer. ncol

    is the number of columns to be provided for in the empty model.

    Specified as: a fullword integer. nels

    is the number of nonzero elements to be provided for in the empty model.

    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 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. Sometimes it is desired to create a model without necessarily having to populate it initially. This routine makes this possible.


    [ Top of Page | EKKDSCA | EKKDSCM | EKKDSCB | EKKRPTB | EKKLMDL ]
    [ EKKIMDL | EKKNMDL | EKKQMDL | EKKPMDL | EKKSMDL | EKKEMDL ]
    [ Index to Modules ]