NO FRAMES

CPXgetcolname

public int CPXgetcolname(CPXCENVptr env, CPXCLPptr lp, char ** name, char * namestore, int storespace, int * surplus_p, int begin, int end)
Definition file: cplex.h

The routine CPXgetcolname accesses a range of column names or, equivalently, the variable names of a CPLEX problem object. The beginning and end of the range, along with the length of the array in which the column names are to be returned, must be specified.

Note
If the value of storespace is 0, the negative of the value of surplus_p returned specifies the total number of characters needed for the array namestore.

Example

 status = CPXgetcolname (env, lp, cur_colname, cur_colnamestore,
                         cur_storespace, &surplus, 0,
                         cur_numcols-1);
 

See also the example lpex7.c in the ILOG CPLEX User's Manual and in the standard distribution.

Parameters:

env

A pointer to the CPLEX environment as returned by CPXopenCPLEX.

lp

A pointer to a CPLEX problem object as returned by CPXcreateprob.

name

An array of pointers to the column names stored in the array namestore. This array must be of length at least (end - begin + 1). The pointer to the name of column j is returned in name[j-begin].

namestore

An array of characters where the specified column names are to be returned. May be NULL if storespace is 0.

storespace

An integer specifying the length of the array namestore. May be 0.

surplus_p

A pointer to an integer to contain the difference between storespace and the total amount of memory required to store the requested names. A nonnegative value of surplus_p specifies that storespace was sufficient. A negative value specifies that it was insufficient and that the routine could not complete its task. In that case, CPXgetcolname returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of the variable surplus_p specifies the amount of insufficient space in the array namestore.

begin

An integer specifying the beginning of the range of column names to be returned.

end

An integer specifying the end of the range of column names to be returned.

Returns:

The routine returns zero if successful and nonzero if an error occurs. The value CPXERR_NEGATIVE_SURPLUS specifies that insufficient space was available in the namestore array to hold the names.