Descriptions of the C API functions are given in alphabetical order. Each entry consists of: the name of the function, its C function prototype, a brief description of each item in the calling sequence, and descriptions of what the function does and what it returns. To avoid having one very large file contain descriptions of all the functions, the functions whose names begin with "ekk_get" and "ekk_set" have been split off in a separate file named featCMGS.htm. The following alphabetized list provides links to descriptions of the remaining functions. Interlineal insertions provide links to entries elsewhere in the list. To conserve space in the list, the four characters "ekk_" have been omitted. Finally, in the documentation below, the names of the functions themselves (ekk_...) are hypertext links back to the beginning of the list.
Function prototype:
int ekk_activateCutoff( EKKModel * model );
This function
activates a "cutoff" feature of the branch
and bound algorithm used to solve mixed integer programming problems. When this
feature is activated, ekk_dualSimplex will return with the current solution, if this solution is feasible and
the objective value is greater than or equal to the value of Rbbcutoff (which may be set with
ekk_setRbbcutoff and retrieved with ekk_getRbbcutoff). This feature
is provided for those who are interested in implementing their own version of a branch and bound algorithm.
If an error occurred, ekk_activateCutoff returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addColumnElementBlock( EKKModel * model , int numberColumns ,
const int * indexRow , const int * startOfEachColumn , const double * elements );
This function
adds a new block, stored by columns, to the current model. The first column passed in
corresponds to the first column of the constraint matrix.
If an error occurred, ekk_addColumnElementBlock returns a value of -1, otherwise it returns the block number of the added column element block.
Function prototype:
int ekk_addColumnElementBlockWithOffsets( EKKModel * model ,
int numberColumns , int baseColumn, int rowOffset , const int * indexRow ,
const int * startOfEachColumn , const double * elements );
This function
adds a new block to the matrix. It allows the user to append new columns to the
matrix. The first column start need not be zero; together with the row offset
this allows added flexibility in building up a matrix.
If an error occurred, ekk_addColumnElementBlockWithOffsets returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addColumns( EKKModel * model , int numberToAdd ,
const double * objective , const double * lowerBound , const double * upperBound ,
const int * startOfEachColumn , const int * indexRow , const double * elements );
This function
adds new columns, and their bounds and objective coefficients, to the current model.
If any of the data related pointers is null, then default values are
stored in the corresponding data array. I.e., if objective is null, then all the new objective function coefficients are set to zero; if
lowerBound is null, then all the new lower bounds are set to 0.0; if upperBound is null, then all the new upper bounds are set
to 1.031.
If an error occurred, ekk_addColumns returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addElementBlock( EKKModel * model , int numberElements ,
const int * indexRow , const int * indexColumn , const double * elements );
This function
adds a new block, stored by indices, i.e., as triplets,
to the current model.
If an error occurred, ekk_addElementBlock returns a value of -1, otherwise it returns the block number of the added element block.
Function prototype:
int ekk_addElementBlockWithOffsets( EKKModel * model , int numberElements ,
const int * indexRow , const int * indexColumn , const double * elements ,
int rowOffset , int ColumnOffset );
This function
adds a block of elements passed by triples. This has the same effect as if
the user modified the indexRow array by rowOffset and the indexColumn array
by columnOffset, but is provided for greater flexibility.
If an error occurred, ekk_addElementBlockWithOffsets returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addIntegerSet( EKKModel * model , int priority , int number ,
const int * columns , const double * downPseudoCost , const double * upPseudoCost );
This function
adds a new set of integers to the current model. If either of the pseudocost
arrays are NULL then default values of 0.001 are used for that array.
If an error occurred, ekk_addIntegerSet returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addOneColumn( EKKModel * model , double objectiveCoefficient , double lowerBound ,
double upperBound , int numberElements , const int * indexRow , const double * elements );
This function
adds one column to the current model. This includes upper and lower bounds on
the value of the new column, the value of the coefficient of the new column
in the objective function, and new elements for the appropriate constraint rows.
If an error occurred, ekk_addOneColumn returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addOneRow( EKKModel * model , double lowerBound , double upperBound ,
int numberElements , const int * indexColumn , const double * elements );
This function
adds one new constraint to the current model.
If an error occurred, ekk_addOneRow returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addRows( EKKModel * model , int numberToAdd , const double * lowerBound ,
const double * upperBound , const int * startOfEachRow , const int * indexColumn , const double * elements );
This function
adds new constraint rows to the model. If one of the bound related pointers is null, then default values are stored in the corresponding bound
arrays. I.e., if lowerBound is null, then all the new lower bounds are set to -1.031, and if upperBound is null,
then all the new upper bounds are set to 1.031.
If an error occurred, ekk_addRows returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addSOS1Set( EKKModel * model , int priority , int number , const int * columns , const double * downPseudoCost , const double * referenceRow );
This function
adds a special ordered set of type 1 to the model (at most one variable nonzero). If downPseudoCost is NULL then default values of
0.001 will be used. If referenceRow is null then values 1.0, 2.0, 3.0, ..... will be used. The set will be ordered in increasing
values of the reference row. The size as well as order matters. If we have a set with 4 entries and the first takes a value of 0.3
in a solution, while the last takes a value of 0.7 then with 1.0, 2.0, 3.0, 4.0 the branch would be at 0.3*1.0 + 0.7*4.0 or 3.1, so between
3 and 4. If the reference row entries had been 0.0, 1000.0, 1001.0, 1002.0, then the branch would have been between 1 and 2.
If an error occurred, ekk_addSOS1Set returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addSOS2Set( EKKModel * model , int priority , int number ,
const int * columns , const double * downPseudoCost , const double * referenceRow );
This function
adds a special ordered set of type 2 to the model (at most two variables nonzero and
if two then they must be adjacent in terms of the reference row order).
See ekk_addSOS1Set for more on a reference row.
If an error occurred, ekk_addSOS2Set returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addSOS3Set( EKKModel * model , int priority , int number ,
const int * columns , const double * downPseudoCost , const double * referenceRow );
This function
adds a special ordered set of type 3 to the model (exactly one variable may be nonzero and must take value 1).
See ekk_addSOS1Set for more on a reference row.
If an error occurred, ekk_addSOS3Set returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_addSpaceForColumnElementBlock( EKKModel * model , int baseColumn , int numberColumns , int numberElements );
This function
is intended to be used with large problems where passing in a copy of a matrix would cause performance degradation. This reserves necessary
space which the user can carefully fill in using ekk_blockColumn etc.
If an error occurred, ekk_addSpaceForColumnElementBlock returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_allSlackBasis( EKKModel * model );
This function
creates a starting basis of all slack variables for the simplex solver.
If an error occurred, ekk_allSlackBasis returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_barrier( EKKModel * model , int mode );
This function
provides the functionality of ekkbslv to solve a LP problem using a
primal dual interior
point algorithm with predictor corrector. The mode parameter corresponds to the sslvswch parameter in the calling sequence of ekkbslv.
The crossover phase is now done by ekk_crossover.
If an error occurred, ekk_barrier returns a nonzero value, otherwise it returns zero.
Function prototype:
EKKModel * ekk_baseModel( );
This function
ekk_baseModel returns a pointer to the "base" model for the OSL context, unless an error occurred, in which case it returns a null pointer.
This base model is created when ekk_initializeContext is called. At any time the user may set tolerances
etc. in this model. In that case these modified values will be used whenever a new model is created.
Function prototype:
int * ekk_blockColumn( EKKModel * model , int whichBlock );
This function
returns a pointer to the array of column starts, or
column indices, for the specified
block of the constraint matrix.
Function prototype:
int ekk_blockColumnBase( EKKModel * model , int whichBlock );
This function
returns the "column base" (i.e., numerical offset) for the indices of the columns in the specified block of the constraint matrix.
Function prototype:
double * ekk_blockElement( EKKModel * model , int whichBlock );
This function
returns a pointer to the matrix coefficients for this block. This should be
used in conjunction with ekk_blockColumn and
ekk_blockRow.
Function prototype:
int ekk_blockNumberColumns( EKKModel * model , int whichBlock );
This function
returns the number of columns in the specified block or -1 if a triplet block.
Function prototype:
int ekk_blockNumberElements( EKKModel * model , int whichBlock );
This function
returns the number of elements in the specified block.
Function prototype:
int * ekk_blockRow( EKKModel * model , int whichBlock );
This function
returns a pointer to the array of row indices for the elements of the specified block of the constraint matrix.
Function prototype:
int ekk_blockRowBase( EKKModel * model , int whichBlock );
This function
returns the "row base" (i.e., numerical offset) for the indices of the rows in the specified block of the constraint matrix.
Function prototype:
int ekk_blockType( EKKModel * model , int whichBlock );
This function
returns "1" if the elements of the specified block of of the constraint matrix is
stored by indices, i.e., as triplets, and returns "2,"
if they are stored by columns.
Function prototype:
int ekk_branchAndBound( EKKModel * model , const char * matrixFile ,
const char * basisFile );
This function
provides the functionality of ekkmslv to solve a MIP problem using a
branch and bound
algorithm.
If an error occurred, ekk_branchAndBound returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_clearBrnuCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerBrnuCallBack as a substitute for the default version
of the MIP User Exit ekk_brnu.
Function prototype:
void ekk_clearChnuCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerChnuCallBack as a substitute for the default version of the
MIP User Exit ekk_chnu.
Function prototype:
void ekk_clearEvnuCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerEvnuCallBack as a substitute for the default version of the
MIP User Exit ekk_evnu,
Function prototype:
void ekk_clearItruCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerItruCallBack as a substitute for the default version of the
Iteration User Exit ekk_itru.
Function prototype:
void ekk_clearMsguCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerMsguCallBack as a substitute for the default version of the
Message User Exit ekk_msgu.
Function prototype:
void ekk_clearNoduCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerNoduCallBack as a substitute for the default version of the
MIP User Exit ekk_nodu,
Function prototype:
void ekk_clearOrduCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerOrduCallBack as a substitute for the default version of the
Row Ordering User Exit ekk_ordu.
Function prototype:
void ekk_clearSlvuCallBack( EKKModel * model );
This function
clears the registration of an alternate user exit subroutine, which had been
registered with ekk_registerSlvuCallBack as a substitute for the default version of the
MIP User Exit ekk_slvu.
Function prototype:
double * ekk_colaux( EKKModel * model );
This function
returns a pointer to an array that contains the column auxiliary solve information. If an error occurred, ekk_colaux returns a null pointer.
Function prototype:
double * ekk_collower( EKKModel * model );
This function
returns a pointer to an array that contains the column lower bounds.
If an error occurred, ekk_collower returns a null pointer.
Function prototype:
double * ekk_colrcosts( EKKModel * model );
This function
returns a pointer to an array that contains reduced costs for the columns.
If an error occurred, ekk_colrcosts returns a null pointer.
Function prototype:
double * ekk_colscales( EKKModel * model );
This function
returns a pointer to an array that contains scale factors for the columns.
If an error occurred, ekk_colscales returns a null pointer.
Function prototype:
double * ekk_colsol( EKKModel * model );
This function
returns a pointer to an array that contains solution values.
If an error occurred, ekk_colsol returns a null pointer.
Function prototype:
int * ekk_colstat( EKKModel * model );
This function
returns a pointer to an array that contains status values for the columns.
If an error occurred, ekk_colstat returns a null pointer.
Function prototype:
const char * const * ekk_columnNamePointers( EKKModel * model );
This function
returns a pointer to an array that contains the column names for the specified model. If there are no column names, it returns null.
Function prototype:
int ekk_columnStatus( EKKModel * model , int iColumn );
This function
returns the column status of the specified column. The only bit of interest is the top bit, i.e. 0x80000000, which if 1, indicates a basic variable.
Function prototype:
double * ekk_colupper( EKKModel * model );
This function
returns a pointer to an array that contains the column upper bounds.
If an error occurred, ekk_colupper returns a null pointer.
Function prototype:
EKKContext * ekk_context( EKKModel * model );
This function
returns a pointer to the OSL context. This allows a user to use the context to look at other models.
If an error occurred, ekk_context returns a null pointer.
Function prototype:
int ekk_copyCollower( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for lower bounds
on the column activities.
ekk_copyCollower returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyColrcosts( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for reduced
costs for the columns.
ekk_copyColrcosts returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyColsol( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for solution values
of the columns.
ekk_copyColsol returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyColstat( EKKModel * model , const int * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the status
of the columns.
ekk_copyColstat returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyColumnNames( EKKModel * model , const char * const * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the names
of the columns.
ekk_copyColumnNames returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyColupper( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for upper bounds
on the column activities.
ekk_copyColupper returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyModel( EKKModel * model , EKKModel * oldModel );
This function
copies the contents of oldModel into model.
If an error occurred, ekk_copyModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_copyObjective( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the objective
coefficients for the columns.
ekk_copyObjective returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyRowacts( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the
row activities.
ekk_copyRowacts returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyRowduals( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the duals
on the rows.
ekk_copyRowduals returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyRowlower( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for lower bounds
on the row activities.
ekk_copyRowlower returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyRowNames( EKKModel * model , const char * const * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the names
of the rows.
ekk_copyRowNames returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyRowstat( EKKModel * model , const int * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for the status
of the row slacks.
ekk_copyRowstat returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copyRowupper( EKKModel * model , const double * fromArray , int toStart , int toEnd );
This function
copies the contents of fromArray into the OSL region for upper bounds
on the row activities.
ekk_copyRowupper returns a nonzero value if an error occurred, otherwise it returns zero.
Function prototype:
int ekk_copySubModel( EKKModel * model , EKKModel * oldModel , int numberRows2 , int numberColumns2 ,
const int * selectedRows , const int * selectedColumns );
This function
copies data from the specified rows and columns of oldModel into model.
The order of rows and columns in the new model is as given by the arrays.
Also a row or column may appear more than once. Note that at present any
quadratic information is lost, as is any Presolve information.
If an error occurred, ekk_copySubModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_crash( EKKModel * model , int mode );
This function
provides the functionality
of ekkcrsh to obtain a starting basis for the simplex LP solver. The value of mode
corresponds to the "type" parameter in the calling
sequence of ekkcrsh.
If an error occurred, ekk_crash returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_createBInverse( EKKModel * model );
This function
provides the functionality
of ekkinvt to generate the primal and dual solutions corresponding to the current basis.
If an error occurred, ekk_createBInverse returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_createColumnCopy( EKKModel * model , EKKMatrixCopy * copy );
This function
allocates space for, and creates a copy of the constraint matrix (stored by columns) in, the struct pointed to by the copy
parameter. The EKKMatrixCopy struct is defined by:
struct EKKMatrixCopy {
int *index;
int *start;
double *element;
};
typedef struct EKKMatrixCopy EKKMatrixCopy;
If an error occurred, ekk_createColumnCopy returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_createNames( EKKModel * model , int lengthOfEachName );
This function
creates default OSL names (of the form Rnnnnnnn and Cnnnnnnn, where "n" is a decimal digit) for the rows and columns of the current model. Afterward, one can
use the ekk_copyRowNames
and ekk_copyColumnNames functions to overwrite the defaults.
If an error occurred, ekk_createNames returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_createRowCopy( EKKModel * model , EKKMatrixCopy * copy );
This function
allocates space for, and creates a copy of the constraint matrix (stored by rows) in, the struct pointed to by the copy
parameter. The form of this struct, and a brief explanation of "storage by rows," are given above.
If an error occurred, ekk_createRowCopy returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_crossover( EKKModel * model );
This function
provides part of the functionality
of ekksslv to make the "crossover" from the interior point solver to the simplex solver
to obtain a basic feasible solution to a LP programming problem.
If an error occurred, ekk_crossover returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deactivateCutoff( EKKModel * model );
This function
deactivates the "cutoff" feature of the branch
and bound algorithm that can be activated by
ekk_activateCutoff, described above. This feature is provided for those who are interested in implementing their own version of
a branch and bound algorithm.
If an error occurred, ekk_deactivateCutoff returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_decomposeCrash( EKKModel * model , int type , int strategy , int numberBlocks );
This function
provides the functionality of ekklpdc to generate a starting basis for a structured LP problem
using a Dantzig Wolfe decomposition. See ekk_setIlpdcflag which is only active if numberBlocks is -1.
If an error occurred, ekk_decomposeCrash returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deleteColumns( EKKModel * model , int numberToDelete ,
const int * which );
This function
deletes specified columns from the model.
If an error occurred, ekk_deleteColumns returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deleteIntegerInformation( EKKModel * model );
This function
deletes specified integer information from the model. This can be useful if integer information to be re-entered in a more structured manner.
If an error occurred, ekk_deleteIntegerInformation returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deleteMatrixCopy( EKKMatrixCopy * copy );
This function
deletes the copy of the constraint matrix stored in, and also deallocates the space for, the
struct pointed to by the copy parameter.
If an error occurred, ekk_deleteMatrixCopy returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deleteModel( EKKModel * model );
This function
deletes the current model and all memory associated with it.
If an error occurred, ekk_deleteModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deleteNames( EKKModel * model );
This function
deletes row and column names the current model. (Allows one to save some space.)
If an error occurred, ekk_deleteNames returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_deleteRows( EKKModel * model , int numberTodelete , const int * which );
This function
deletes linear constraints from the current model.
If an error occurred, ekk_deleteRows returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_doParametrics( EKKModel * model )
This function
does a parametric analysis of a LP problem.
If an error occurred, ekk_doParametrics returns a nonzero value, otherwise it returns zero.
Function prototype:
double * ekk_double( int number_entries );
This function
returns a pointer to memory that has been "malloc"ed for an array of double words of length number_entries. ekk_double provides the
functionality of the C malloc command for arrays of double words. ekk_double should be used instead of the native C malloc
command for this purpose because the mechanics of dynamic memory support in C is implementation dependent, and your executable application
code and the executable functions of the Optimization Library may be incompatible.
ekk_double returns a null pointer, if an error occurred.
Function prototype:
int ekk_dropLastElementBlock( EKKModel * model );
This function
deletes the last block of constraints from the current model.
If an error occurred, ekk_dropLastElementBlock returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_dualNetwork( EKKModel * model , int startup );
This function
provides the functionality of ekknslv
to solve a network programming problem using the dual simplex method.
The problem must be dual feasible on entry.
See "Network Programming" for more information on how to solve network programming problems.
If an error occurred, ekk_dualNetwork returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_dualSimplex( EKKModel * model );
This function
provides part of the functionality of ekksslv to solve a LP problem using the dual simplex
algorithm with the basis already in memory.
If an error occurred, ekk_dualSimplex returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_eitherSimplex( EKKModel * model );
This function
provides part of the functionality
of ekksslv to solve a LP problem using the primal or dual simplex algorithm based on the characteristics of the problem.
If an error occurred, ekk_eitherSimplex returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_endContext( EKKContext * context );
This function
deallocates system resources allocated by
ekk_initializeContext
and used by Optimization Library functions.
ekk_endContext will also delete all models and the context space.
Function prototype:
int ekk_exportBasis( EKKModel * model , const char * fileName , int ifCharacter );
This function
provides the functionality of ekkbaso to write basis information (in
MPS format) to the specified file. The use of ifCharacter set to 2 will save the full 64 bits of
floating point number in 12 printable characters for greater accuracy. However this format may not be portable across different computer architectures.
If an error occurred, ekk_exportBasis returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_exportModel( EKKModel * model , const char * fileName ,
int ifCharacter , int numberFields );
This function
provides the functionality of ekkbcdo to write model information (in
MPS format) to the specified
file.
The use of ifCharacter set to 2 will save the full 64 bits of
floating point number in 12 printable characters for greater accuracy.
However this format may not be portable across different computer architectures.
Using 2 fields yields a more compact representation but having only one field
may allow the use of simple tools such as grep to extract part of the
model.
If an error occurred, ekk_exportModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_findSOS( EKKModel * model );
This function
provides the functionality
of ekksos to identify special ordered sets of types 1 and 3 in the current model, which should
(of course) correspond to a MIP problem.
If an error occurred, ekk_findSOS returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_formBInverseb( EKKModel * model , double * b );
This function
provides the functionality
of ekkges to compute the solution of AB
x
= b where AB
is the current basis matrix and the right hand side is the vector b supplied. The result is written into the array b provided in the calling
sequence.
If an error occurred, ekk_formBInverseb returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_formBInverseTransposeb( EKKModel * model , double * b );
This function
provides the functionality
of ekkges to compute the solution of ABTx
= b where ABT
is the transpose of the current basis matrix and the right hand side is the vector b supplied. The result is written into the array b provided in
the calling sequence.
If an error occurred, ekk_formBInverseTransposeb returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_free( void * pointer );
This function
provides the functionality of the C free command. ekk_free should be used instead of the native C command because the mechanics of dynamic
memory support in C is implementation dependent, and user executable application code might be incompatible with Optimization Library executable
functions. ekk_free should always be used to deallocate arrays returned by OSL functions, which it is the user's responsibility to delete,
or when ekk_int or ekk_double were used to obtain memory. Otherwise ekk_free should never be used.
Function prototype:
void ekk_freeVector( EKKVector * vec );
This function
frees the space associated with the EKKVector struct identified by vec. This struct is defined by:
ekk_freeVector does not return anything.
Function prototype:
int ekk_fromBinary( EKKModel * originalmodel , EKKModel * binarymodel );
This function
provides the functionality of ekkbmps to transform the data of the 0/1 MIP problem contained in
binarymodel, which had been generated by ekk_makeBinary, back into an updated version of the original general
integer MIP problem. It is the user's responsibility to delete the binarymodel.
If an error occurred, ekk_fromBinary returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_importBasis( EKKModel * model , const char * fileName );
This function
provides the functionality of ekkbasi
to read in a basis previously written by ekk_exportBasis.
If an error occurred, ekk_importBasis returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_importModel( EKKModel * model , const char * fileName );
This function
provides the functionality of ekkmps to read in model data in
MPS format, and to populate the
model referenced in its calling sequence. If this model is not yet named when ekk_importModel is called, then the model will be given the name from the NAME
field in the model data read in by ekk_importModel. On the other hand, if the model already has a name, then the name in the NAME field in the model data read
in by ekk_importModel must match this name.
If an error occurred, ekk_importModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_importModelFree( EKKModel * model , const char * fileName );
This function
provides the functionality of ekkmps to read in model data in
MPS format, and to populate the
model referenced in its calling sequence. If this model is not yet named when ekk_importModelFree is called, then the model will be given the name from the
NAME field in the model data read in by ekk_importModelFree.
On the other hand, if the model already has a name, then the name in the NAME field in the model data read
in by ekk_importModelFree must match this name. This is like ekk_importModel
but it always reads in free format, it assumes a name length of up to 24 and
sets the true length in ekk_getInumchar.
If an error occurred, ekk_importModelFree returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_importQuadraticData( EKKModel * model , const char * fileName );
This function
provides the functionality of ekkqmps to read in a quadratic objective
coefficient matrix elements in MPS format, and to populate the model referenced in its calling sequence. The name in the NAME
field in the model data read in by ekk_importQuadraticData must match the value of model supplied in its calling sequence.
If an error occurred, ekk_importQuadraticData returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_infeasibilities( EKKModel * model , int mask , int output ,
int * index , int * table );
This function
provides the functionality
of ekknfes to analyze an infeasible LP problem. The mask parameter corresponds to the
parameter of the same name in the calling sequence of ekknfes.
If an error occurred, ekk_infeasibilities returns a nonzero value, otherwise it returns zero.
Function prototype:
EKKContext * ekk_initializeContext( );
This function
initializes an entire Optimization Library context. Among other things, it provides the functionality of
ekk_init. However, it does not initialize a model.
If an error occurred, ekk_initializeContext returns a null pointer, otherwise it returns a pointer to the OSL context. This pointer can be used to
iterate over current models. The context pointer is an argument in the calling sequences of
ekk_newModel,
ekk_model, and
ekk_numberOfModels.
Function prototype:
int * ekk_int( int number_entries );
This function
returns a pointer to memory that has been "malloc"ed for an array of integers of length number_entries. ekk_int provides the functionality of
the C malloc command for arrays of integers. ekk_int should be used instead of the native C malloc command for this purpose because the
mechanics of dynamic memory support in C is implementation dependent, and your executable application code and the executable functions of the Optimization
Library may be incompatible in this respect.
ekk_int returns a null pointer, if the "malloc" failed, or if an error occurred.
Function prototype:
char * ekk_integerType( EKKModel * model );
This function
returns a pointer to a character array, if the current model includes integer variables, or NULL, if it does not. If the current model does include integer
variables, then the array pointed to contains single character indicators (with possible values: 0, 1, and 2) that identify the type of each variable. An indicator is: 0 for a continuous variable, 1 for a binary integer variable, or 2 for a general integer variable.
Function prototype:
int ekk_isColumnBasic( EKKModel * model , int iColumn );
This function
returns a nonzero value, if the column whose C index is iColumn is basic. If an inverse exists, the value returned is 1 plus the index of the pivot row.
If the column whose C index is iColumn is not basic, 0 is returned.
Function prototype:
int ekk_isModelInteger( EKKModel * model );
This function
returns 1, if the current model has integer data, and 0 if it does not.
Function prototype:
int ekk_isModelQuadratic( EKKModel * model );
This function
returns 1, if the current model had quadratic objective coefficients, and
0 if it does not.
Function prototype:
int ekk_isRowBasic( EKKModel * model , int iRow );
This function
returns 1 plus the index of the pivot row, if the row whose C index is iRow is basic, or 0, if this row is not basic.
Function prototype:
int ekk_lastAlgorithm( EKKModel * model );
This function
returns the last simplex algorithm used as 1 for primal and 2 for dual.
This is of most use when ekk_eitherSimplex
was called.
Function prototype:
int * ekk_listOfIntegers( EKKModel * model );
This function
returns a pointer to an int array of length ekk_getInumints which contains the sequence numbers of the integer
variables. It is up to user to free this array using
ekk_free.
Function prototype:
int ekk_loadDspace( EKKModel * model , double * dspace , int lengthOfDspace );
This function
populates a new Optimization Library workspace, identified by dspace, whose size in double words is specified by lengthOfDspace, with data
obtained from the model identified by model. This function enables one to create a workspace, and then use it with "old style"
Optimization Library application code.
If an error occurred, ekk_loadDspace returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_loadQuadraticData( EKKModel * model , int type ,
int numberElements , const int * row , const int * column , const double * element );
This function
loads the quadratic coefficient matrix for a QP problem.
If an error occurred, ekk_loadQuadraticData returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_loadRimModel( EKKModel * model , int numberOfRows , const double * lowerRow , const double * upperRow , int numberOfColumns ,
const double * objective , const double * lowerColumn , const double * upperColumn );
This function
populates the "Rim" of the current model. That is, it loads into the model
structure the values supplied for the coefficients of the linear objective function,
and the upper and lower bounds on the rows and columns of the model.
If any of the data related pointers is null, then default values are
stored in the corresponding data array. I.e. for rows, if
lowerRow is null, then all the new lower bounds are set to -1.031, and if upperRow is null, then all the new upper bounds
are set to 1.031.
For columns, if objective is null, then all the new objective function coefficients are set to zero; if
lowerColumn is null, then all the new lower bounds are set to 0.0;
if upperColumn is null, then all the new upper bounds are set
to 1.031.
If an error occurred, ekk_loadRimModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_makeBinary( EKKModel * model , int type );
This function
provides the functionality of ekkbmpr to transform a general integer MIP problem
into a 0/1 MIP problem. This function should be called early in the solution of such a problem. Since this ekk_makeBinary
modifies data in the model supplied, one must save a copy of the original model, if one wishes to recover the solution to the
original general integer problem. ekk_copyModel and ekk_fromBinary
provide the capability to do this.
If an error occurred, ekk_makeBinary returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_markAsInteger( EKKModel * model , int iColumn );
This function
marks a particular column as an integer variable.
If an error occurred, ekk_markAsInteger returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_markColumnsAsBasic( EKKModel * model , int numberToMark , const int * which );
This function
marks columns as being basic.
Function prototype:
int ekk_markRowsAsBasic( EKKModel * model , int numberToMark , const int * which );
This function
marks rows as being basic.
Function prototype:
int ekk_matrixTransposeVector( EKKModel * model , double alpha , const double * x , double beta , double * y );
This function
provides the functionality
of ekkgemv to compute y b y + a AT x.
If an error occurred, ekk_matrixTransposeVector returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_matrixVector( EKKModel * model , double alpha , const double * x , double beta , double * y );
This function
provides the functionality
of ekkgemv to compute y b y + a A x.
If an error occurred, ekk_matrixVector returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_mergeBlocks( EKKModel * model , int ifColumnOrdered );
This function
creates a new copy of the constraint matrix in which all the blocks of elements have been merged into a single block. The resulting matrix will be stored by
columns. This will make subsequent algorithms faster.
If an error occurred, ekk_mergeBlocks returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_messagePrintOff( int messageNumber );
This function
provides some of the functionality of ekk_mset, with fewer parameters, to turn off
the printing of the specified Optimization
Library message.
If an error occurred, ekk_messagePrintOff returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_messagePrintOn( int messageNumber );
This function
provides some of the functionality of ekk_mset, with fewer parameters, to turn on
the printing of the specified Optimization
Library message.
If an error occurred, ekk_messagePrintOn returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_messagesPrintOff( int messageNumber );
This function
provides some of the functionality of ekk_mset, with fewer parameters, to turn off
the printing of the specified Optimization
Library messages.
If an error occurred, ekk_messagesPrintOff returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_messagesPrintOn( int messageNumber );
This function
provides some of the functionality of ekk_mset, with fewer parameters, to turn on the printing of
the specified Optimization
Library messages.
If an error occurred, ekk_messagesPrintOff returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_messageUserExitOff( int messageNumber );
This function
provides some of the functionality of ekk_mset, with fewer parameters, to turn off the call to the message user exit
when the specified Optimization
Library message is generated.
If an error occurred, ekk_messageUserExitOff returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_messageUserExitOn( int messageNumber );
This function
provides some of the functionality of ekk_mset, with fewer parameters, to turn on the call to the message user exit when the specified
Optimization
Library message is generated.
If an error occurred, ekk_messageUserExitOn returns a nonzero value, otherwise it returns zero.
Function prototype:
EKKModel * ekk_model( const EKKContext * context , int whichModel );
This function
returns the whichModel 'th model of the OSL context. As models
are created and deleted then the models position in the context may change,
so the user should use some identifier e.g. the name if this may happen.
ekk_model returns null if an error occurred.
Function prototype:
int * ekk_mset( EKKModel * model , int startNumber , int maxAllowed , int maxPrint , int userExit , int endNumber , int noNumber );
This function
provides the capability to change the conditions under which specified OSL messages will be output.
Notes
If an error occurred, ekk_mset returns a nonzero value, otherwise it returns zero.
Function prototype:
EKKModel * ekk_newModel( EKKContext * context , const char * nameOfModel );
This function
creates a new (but empty) model, assigns the name supplied, and returns a pointer to the newly created model.
If nameOfModel is null or "", then a name can be
associated with this model by invoking ekk_importModel. If it is not null then the NAME card must match. ekk_newModel
MUST be called in order to create a pointer to the
model (which is an entirely different thing from the name of the model, i.e., the value of nameOfModel).
Note: ekk_newModel gets space for the new model from the operating system. To recover this space, after having processed
(or lost interest in) the model, one should call
ekk_deleteModel. A call to
ekk_endContext recovers the space
for all remaining models.
ekk_newModel returns a null pointer, if an error occurred.
Function prototype:
int ekk_numberOfModels( const EKKContext * context );
This function
returns the number of models in the OSL context. This would normally be used to loop over all models setting some tolerance.
Function prototype:
double * ekk_objective( EKKModel * model );
This function
returns a pointer to an array that contains the objective function coefficients.
If an error occurred, ekk_objective returns a null pointer
Function prototype:
int ekk_pivotRow( EKKModel * model );
This function
returns the last pivot row - this is only useful in specialized algorithms
when the problem is infeasible.
Function prototype:
int ekk_postSolve( EKKModel * model , const char * fileName );
This function
provides the functionality
of ekkpssl to recover a problem that has been processed by ekk_presolve.
If an error occurred, ekk_postSolve returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_preSolve( EKKModel * model , int mode , const char * fileName );
This function
provides the functionality
of ekkprsl to simplify the constraint set of a LP problem.
If an error occurred, ekk_preSolve returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_primalNetwork( EKKModel * model , int startup );
This function
provides the functionality of ekknslv
to solve a network programming problem using the primal simplex method. See
"Network Programming" for more information on how to solve network programming problems.
If an error occurred, ekk_primalNetwork returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_primalSimplex( EKKModel * model , int startUpMode );
This function
provides the functionality
of ekksslv to solve a LP problem using the primal simplex algorithm. Note that regardless of the
value startUpMode, the simplex solver uses the row and column status regions to determine a starting basis, and to identify non-basic rows and columns.
If startUpMode=3, an advanced basis is determined from the existing primal solution vector, as well as the row and column status vectors, and the row
activities. There is no provision for using dual solution values in selecting an advanced starting basis.
There are very few problems for which startupMode=2 will give best results.
If an error occurred, ekk_primalSimplex returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_printBase( EKKModel * model , int base );
This function
is provided to permit printing problem information in the "old style," with FORTRAN notation. Not everyone is a C programmer.
Function prototype:
int ekk_printSolution( EKKModel * model );
This function
provides the functionality of ekkprts
to output solution information. The user can exercise substantial control over what
will be output by setting values for the index control variables:
Isolmask
and/or Iprintsens and/or
Iprtinfomask (using the appropriate
ekk_setI... function) and/or by modifying the row and column
selection lists using
ekk_sellistrow and/or ekk_sellistcol. Output is not necessarily directed to stdout,
but to the current Logfile File, which can be set using ekk_setLogfileFilePointer or
ekk_setLogfileFileName.
If an error occurred, ekk_printSolution returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_quadraticBarrier( EKKModel * model , int mode );
This function
provides the functionality
of ekkqslv (with alg = -1) to solve a QP problem using a regularized interior
point algorithm. The initialization parameter, mode, takes values of 0 and 1. A value of 0 means "continue from a previous
quadratic solution," and a value of 1 means "start from scratch." A value of 0 is recommended, when a previous solution is available.
If an error occurred, ekk_quadraticBarrier returns a nonzero value, otherwise it returns zero.
Function prototype:
int * ekk_quadraticBlockColumn( EKKModel * model , int whichBlock );
This function
returns a pointer to the array of column starts, or
column indices, for the specified
block of the quadratic matrix.
Function prototype:
int ekk_quadraticBlockColumnBase( EKKModel * model , int whichBlock );
This function
returns the "column base" (i.e., numerical offset) for the indices of the
columns in the specified block of the quadratic matrix.
Function prototype:
double * ekk_quadraticBlockElement( EKKModel * model , int whichBlock );
This function
returns a pointer to the quadratic coefficients for this block. This should be
used in conjunction with ekk_quadraticBlockColumn and
ekk_quadraticBlockRow.
Function prototype:
int ekk_quadraticBlockNumberColumns( EKKModel * model , int whichBlock );
This function
returns the number of columns in the specified quadratic block.
Function prototype:
int ekk_quadraticBlockNumberElements( EKKModel * model , int whichBlock );
This function
returns the number of elements in the specified quadratic block.
Function prototype:
int * ekk_quadraticBlockRow( EKKModel * model , int whichBlock );
This function
returns a pointer to the array of row indices for the elements of the
specified block of the quadratic matrix.
Function prototype:
int ekk_quadraticBlockRowBase( EKKModel * model , int whichBlock );
This function
returns the "row base" (i.e., numerical offset) for the indices of the rows in the specified block of the quadratic matrix.
Function prototype:
int ekk_quadraticBlockType( EKKModel * model , int whichBlock );
This function
returns "1" if the elements of the specified block of of the
quadratic matrix is stored by indices,
i.e., as triplets, and returns "2," if they are stored by columns.
Function prototype:
int ekk_quadraticParametrics( EKKModel * model , const double * parrhs , const double * parobj , double lambdaMin , double lambdaMax );
This function
provides the functionality of ekkqpar to parametrically analyze a QP problem. It modifies right
hand sides of row constraints and the objective function coefficients (by adding lambdaMin times the values of parrhs and
parobj respectively), and resolves the QP problem. If the optimal basis has changed, then the iteration user exit function, ekk_itru,
is called; otherwise, the problem is again modified and re-solved until either a new optimal basis is found, or the number of repetitions exceeds
the value of the control variable
Iqparmaxiter),
(which can be set with
ekk_setIqparmaxiter),
or the product of the number of repetitions with lambdaMin exceeds lambdaMax. ekk_quadraticParametrics itself does not generate
any output. However, from ekk_itru one can output results, change values of control variables (including Iqparmaxiter), and call various
other OSL functions. For more details, see the
documentation of ekk_itru.
If an error occurred, ekk_quadraticParametrics returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_quadraticSimplex( EKKModel * model , int mode );
This function
provides the functionality of ekkqslv (with alg = 1) to solve a QP problem using
an iterative simplex based algorithm. The mode parameter takes values of 0 and 1. A value of 0 means "start from a previous
quadratic solution," and a value of 1 "means start from scratch." A value of 0 is recommended, when a previous solution is available.
If an error occurred, ekk_quadraticSimplex returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_registerBrnuCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
MIP User Exit ekk_brnu.
Function prototype:
void ekk_registerChnuCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
MIP User Exit ekk_chnu.
Function prototype:
void ekk_registerEvnuCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
MIP User Exit ekk_evnu,
Function prototype:
void ekk_registerItruCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
Iteration User Exit ekk_itru.
Function prototype:
void ekk_registerMsguCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
Message User Exit ekk_msgu.
Function prototype:
void ekk_registerNoduCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
MIP User Exit ekk_nodu,
Function prototype:
void ekk_registerOrduCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
Row Ordering User Exit ekk_ordu.
Function prototype:
void ekk_registerSlvuCallBack( void * ekkcbptr );
This function
registers by name an alternate user exit subroutine to be called in place of the default version of the
MIP User Exit ekk_slvu.
Function prototype:
int ekk_regularized( EKKModel * model , int mode );
This function
solves a LP problem using the regularized interior point method.
If an error occurred, ekk_regularized returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_repeatElementBlock( EKKModel * model , int whichBlock , int rowOffset , int columnOffset , int ifCopy );
This function
repeats a block of the constraint matrix an a location specified by the row and column offset values.
If an error occurred, ekk_repeatElementBlock returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_replaceColumn( EKKModel * model , int iColumn ,
int numberElements , const int * indexRow , const double * elements );
This function
replaces a column with a new one in the current model. i.e. a column, and the terms that reference it among the constraints, are deleted, and a new one
is added. If an error occurred, ekk_replaceColumn returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_replaceElements( EKKModel * model , int numberElements , const int * indexRow , const int * indexColumn , const double * elements );
This function
replaces or modifies elements in the model. If an indexRow, Column pair define
an existing element then that element is given the new value, unless its
value is less than or equal to ekk_getRtolmps when
it is deleted. Any new elements are added (again if above the tolerance
whose default value is 1.0e-12).
If an error occurred, ekk_replaceElements returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_replaceRow( EKKModel * model , int iRow ,
int numberElements , const int * indexRow , const double * elements );
This function
replaces one constraint of the model with another.
If an error occurred, ekk_replaceRow returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_resizeElementBlock( EKKModel * model , int iBlock ,
int maximumNumberElements , int ifCompress );
This function
redefines the size of the given block. If the block is column ordered then
it is always resized so that it can take any number of columns - up to the
maximum currently defined.
If an error occurred, ekk_resizeElementBlock returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_resizeModel( EKKModel * model , int newNumberRows , int newNumberColumns , int ifCompress );
This function
resets the numbers of rows and columns for the existing model. If the number of rows or columns is increased to more than the current maximum then the maximum possible will be increased by more than the amount asked. This is to minimize the overhead of resizing one row or column at a time.
If an error occurred, ekk_resizeModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_resizeModelExact( EKKModel * model ,
int newNumberRows , int newNumberColumns ,
int maxRows , int maxCols , int ifCompress );
This function
is as ekk_resizeModel. but if the new of rows or columns number is greater than the maximum it will be
resized exactly. This means that repeated calls to ekk_resizeModelExact will be slower.
If an error occurred, ekk_resizeModelExact returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_restoreModel( EKKModel * model , const char * fileName );
This function
provides the functionality of ekkgtmd to read
model data from the file specified by the fileName parameter into the model, specified by the model parameter.
If an error occurred, ekk_restoreModel returns a nonzero value, otherwise it returns zero.
Function prototype:
double * ekk_rowacts( EKKModel * model );
This function
returns a pointer to an array that contains the values of the row activities.
Function prototype:
double * ekk_rowaux( EKKModel * model );
This function
returns a pointer to an array that contains the row auxiliary solve information.
Function prototype:
double * ekk_rowduals( EKKModel * model );
This function
returns a pointer to an array that contains the row duals (note that the
sign is changed to the more common usage when using the C API).
Function prototype:
double * ekk_rowlower( EKKModel * model );
This function
returns a pointer to an array that contains the row lower bounds.
Function prototype:
const char * const * ekk_rowNamePointers( EKKModel * model );
This function
returns a pointer to an array that contains the row names for the specified model. If there are no row names it returns null.
Function prototype:
double * ekk_rowscales( EKKModel * model );
This function
returns a pointer to an array that contains scale factors for the rows.
Function prototype:
int * ekk_rowstat( EKKModel * model );
This function
returns a pointer to an array that contains status values for the rows.
Function prototype:
int ekk_rowStatus( EKKModel * model , int iRow );
This function
returns the status of the row slack. The only bit of interest is the
top bit i.e. 0x80000000, which if set, indicates a basic variable.
Function prototype:
double * ekk_rowupper( EKKModel * model );
This function
returns a pointer to an array that contains the row upper bounds.
Function prototype:
int ekk_saveModel( EKKModel * model , const char * fileName );
This function
provides the functionality of ekkptmd
to save model data in the file specified by the fileName parameter.
If an error occurred, ekk_saveModel returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_scale( EKKModel * model );
This function
provides the functionality of ekkscal to scale the coefficients of the constraint matrix.
The purpose of scaling these coefficients is to reduce their numerical spread, in the hope of increasing the numerical stability of the
computations to follow. Scaling is very important, and can be very effective in improving numerical stability. On the other hand, scaling
a problem may hide some relationships between variables that would otherwise be apparent. In any case, you should realize that user is
probably better able to scale the problem than any computer algorithm. One way to do this is: first choose appropriately scaled units for
the extensive variables of the problem, e.g., consider using: kilo-tons instead of pounds, tank car loads instead of gallons, millions
of dollars instead of pennies, or nanometers instead of meters, so that the numerical spread of the coefficients in each single constraint,
and in the objective function, will be at most one or two orders of magnitude; and then second, scale the constraints themselves, by
multiplying each entire constraint relation by an appropriate positive constant, so that the numerical spread of the coefficients in
the different constraints is at most another one or two orders of magnitude. (Of course, these steps are not completely
separable. A choice of units for a particular variable effects each constraint in which that variable appears. The best you can do
is just the best you can do.) The scaling algorithm implemented in ekk_scale is
intended to approximate this in its attempt to
minimize the numerical spread of the matrix coefficients, but of course, a computer algorithm knows nothing about choosing appropriate
units for extensive variables.
If an error occurred, ekk_scale returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_scaleElements( EKKModel * model , int mode );
This function
scales or unscales the elements of the matrix. (See the discussion of scaling given above.)
It is an error if the request for scaling is incorrectly applied, i.e. if a request is made to scale (or to unscale) a problem that is
already scaled (or unscaled). Normally after scaling, the elements are explicitly scaled while the "rim"
is implicitly scaled i.e. will be scaled/unscaled on entry to solves. This
allows more flexible scaling and unscaling.
If an error occurred, ekk_scaleElements returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_scaleRim( EKKModel * model , int mode );
This function
scales or unscales the bounds and objective coefficients of the model. (See the discussion of scaling given above.)
It is an error if it is incorrectly applied, i.e. if a scaled problem is scaled
or an unscaled problem is unscaled.
Normally after scaling, the elements are explicitly scaled while the "rim"
is implicitly scaled i.e. will be scaled/unscaled on entry to solves. This
allows more flexible scaling and unscaling.
If an error occurred, ekk_scaleRim returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_scaling( EKKModel * mode );
This function
returns information as to the scaled state of the model.
It returns 0 if no scaling, -1 if scaling factors , +1 if elements scaled and +2 if rim scaled as well.
Function prototype:
int ekk_selectionList( EKKModel * model , const char * name , char wildcard , char arbchar , int operation , int rowcol );
This function
sets up or modifies a selection list that influences OSL output based on a comparison of a string
with row and/or column names.
If an error occurred, ekk_selectionList returns a nonzero value, otherwise it returns zero.
Function prototype:
int * ekk_sellistcol( EKKModel * model );
This function
returns a pointer to an array that contains the column
selection list.
If an error occurred, ekk_sellistcol returns a nonzero value, otherwise it returns zero.
Function prototype:
int * ekk_sellistrow( EKKModel * model );
This function
returns a pointer to an array that contains the row
selection list.
If an error occurred, ekk_sellistcol returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_senseBound( EKKModel * model , int type , int respect );
This function
provides the functionality of ekksbnd to analyze the
sensitivity of the solution to
changes in the bounds of the problem. The values of type and respect correspond to the parameters with the same names in the calling sequence of
ekksbnd.
If an error occurred, ekk_senseBound returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_senseObjective( EKKModel * model );
This function
provides the functionality of ekksobj to
analyze the sensitivity of a LP problem to
changes in the objective function coefficients.
If an error occurred, ekk_senseObjective returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_sequenceOut( EKKModel * model );
This function
returns the current value of the last variable leaving the basis. This is
only of use for specialized purposes in the dual method, when the problem
has been found to be infeasible.
Function prototype:
int ekk_simplex( EKKModel * model , int mode );
This function
solves a linear programming problem using the primal or dual simplex algorithm, as specified by mode.
Setting mode = 1 is suggested for novice users. ekk_simplex automatically does pre- and post- processing.
If no error has occurred, ekk_simplex returns zero, but if an error occurred, ekk_simplex returns a nonzero value.
Function prototype:
int ekk_sizeMatrix( EKKModel * model );
This function
returns the number of stored elements in the constraint matrix of the current model. (Some of these could be stored zeros.)
If an error occurred, ekk_sizeMatrix returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_sort( int * key , int number );
This function
sorts the key array in ascending order.
If an error occurred, ekk_sort returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_sortOnDouble( double * key , int * array , int number );
This function
sorts the entries of the key array, in ascending order, and moves the corresponding entries of the array of integers
into the same relative positions.
If an error occurred, ekk_sortOnDouble returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_sortOnInt( int * key , double * array , int number );
This function
sorts the entries of the key array, in ascending order, and moves the corresponding entries of the array of
double words into the same relative positions.
If an error occurred, ekk_sortOnInt returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_stderrNumber( EKKModel * model , int messageNumber );
This function
resets the threshold for OSL messages to be directed to stderr. All OSL messages are directed to stdout, unless output has been
redirected by using ekk_setLogfileFilePointer or ekk_setLogfileFileName. An
OSL message whose message number is greater than or equal to the threshold value will also be directed to stderr. The default value for
this threshold is 7000. ekk_stderrNumber does not return anything.
Function prototype:
int ekk_tableauArtificialColumn( EKKModel * model , int iColumn , double zeroTolerance , EKKVector *vec );
This function
copies the elements of the requested row, whose C index is iColumn, into the entries of the element array of the vec
struct. This column is then updated by the inverse of the current basis. The index array of the struct is filled with the indices
of the rows with nonzero element values. icolumn should be between 0 and
Inumcols-1.
If an error occurred, ekk_tableauArtificialColumn returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_tableauStructuralColumn( EKKModel * model , int iColumn , double zeroTolerance , EKKVector *vec );
This function
copies the elements of the requested column, whose C index is iColumn, into the entries of the element array of the
vec struct. This column is then updated by the inverse of the current basis. The index array of the struct is filled
with the indices of the rows with nonzero element values. iColumn should be between 0 and
Inumcols-1.
If an error occurred, ekk_tableauStructuralColumn returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_tableauRow( EKKModel * model , int iRow , double zeroTolerance , EKKVector *vec1, EKKVector *vec2 );
This function
loads the arrays of the vec1 and vec2 structs with indices and element values of artificial and structural columns
from row number iRow of the tableau.
If an error occurred, ekk_tableauRow returns a null pointer.
Function prototype:
int ekk_unloadDspace( EKKModel * model , double * dspace );
This function
populates the model identified by the first parameter in its calling sequence with data obtained from the Optimization Library workspace identified by the
second parameter in its calling sequence. This function enables one to populate a model with data from an "old style" Optimization Library workspace, and then
to use it with "new style" Optimization Library application code, as shown in the sample code.
If an error occurred, ekk_unloadDspace returns a nonzero value, otherwise it returns zero.
Function prototype:
void ekk_userData( EKKModel * model );
This function
returns a generic pointer previously stored by the user by means of ekk_setUserData. If this pointer has not been stored with the
indicated model data by ekk_setUserData, then ekk_userData returns a
null pointer.
Function prototype:
int ekk_validateIntegers( EKKModel * model );
This function
checks the bounds on the integer variables, to verify that there is at least one integer between the upper and lower bounds on each
integer variable, and that the variable type for each integer variable is consistent with its bounds.
If an error occurred, ekk_validateIntegers returns a nonzero value, otherwise it returns zero.
Function prototype:
int ekk_validateModel( EKKModel * model );
This function
verifies the structure, but not the content, of the current model.
If an error occurred, ekk_validateModel returns a nonzero value, otherwise it returns zero. It may also print error messages.