Most of the ILOG CPLEX query routines in the Callable Library require your application to allocate memory for one or more arrays that will contain the results of the query. In many cases, your application-the calling program-does not know the size of these arrays in advance. For example, in a call to CPXgetcols()
requesting the matrix data for a range of columns, your application needs to pass the arrays cmatind
and cmatval
for ILOG CPLEX to populate with matrix coefficients and row indices. However, unless your application has carefully kept track of the number of nonzero columns (that is, the colnonzero
counts) throughout the problem specification and, if applicable, throughout its modification, the actual length of these arrays remains unknown.
For example, consider a program that needs to call CPXgetcols()
to access a range of columns. Here is the list of arguments for CPXgetcols()
.