Note for Optimizer library users
BCL functions cover all aspects of modeling, and perform simple optimization tasks without making reference to the problem representation (matrix) used by the underlying solution algorithms. The more advanced Optimizer library user may nevertheless wish to access the problem matrix directly. It is possible to use all Optimizer library functions with the matrix generated by BCL. To this end, BCL provides several functions which specifically relate to the matrix representation.
The function XPRBloadmat explicitly transforms the constraint-wise representation in BCL into the matrix representation required by the Optimizer library. It is usually not necessary to call this function because BCL automatically carries out this transformation whenever required.
The functions XPRBgetcolnum and XPRBgetrownum return the column and row indices associated with BCL variables and constraints respectively. While loading the matrix with a call to XPRBloadmat, all variables that do not occur in any constraint and all empty constraints are ignored and variable and constraint indices are updated correspondingly (with negative indices indicating that a variable or constraint is not part of the active matrix in the Optimizer).
It should be stressed that BCL, and thus the arrays storing references to problem variables, does not keep track of any changes to the matrix occurring during the solution procedure within the Optimizer. This implies that if linear presolve or integer preprocessing is used, the correct solution information is available only after the postsolve has been carried out. This is usually done automatically if the solution algorithm terminates correctly (see the description of XPRBlpoptimize and XPRBmipoptimize in Chapter BCL C library functions for details).
If the matrix is altered directly with Optimizer library functions such as XPRSaddrows or XPRSchgcoef it is not possible to retrieve the modifications in the BCL model. In order to maintain a coherent status, any such modification has to be carried out in BCL, followed by a call to function XPRBloadmat.
Appendix Using BCL with the Optimizer library explains in more detail how to use Optimizer library functions within a BCL program. Interested users are directed there for details