Previous Page: CPXgetcolindexFirst PageNext Page: CPXgetcols

CPXgetcolname


Description

The routine CPXgetcolname() is used to access a range of column names or, equivalently, the variable names of an LP 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.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs. The value CPXERR_NEGATIVE_SURPLUS indicates that insufficient space was available in the namestore array to hold the names.

Synopsis

int CPXgetcolname (CPXENVptr env,
                   CPXLPptr lp,
                   char **name,
                   char *namestore,
                   int storespace,
                   int *surplus_p,
                   int begin,
                   int end);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

CPXLPptr lp
A pointer to a CPLEX LP problem object as returned by CPXcreateprob().

char **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 will be returned in name[j-begin].

char *namestore
An array of characters where the specified column names are to be returned. namestore may be NULL if storespace is 0.

int storespace
An integer indicating the length of the array namestore. storespace may be 0.

int *surplus_p
A pointer to an integer that will contain the difference between storespace and the total amount of memory required to store the requested names. A non-negative value of *surplus_p indicates that the length of the array namestore was sufficient. A negative value indicates that the length of the array was insufficient and that the routine could not complete its task. In this case, CPXgetcolname() returns the value CPXERR_NEGATIVE_SURPLUS, and the negative value of the variable *surplus_p indicates the amount of insufficient space in the array namestore.

If the value of storespace is 0, then the negative of the value of *surplus_p returned indicates the total number of characters needed for the array namestore.

int begin
An integer indicating the beginning of the range of column names to be returned.

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

Example

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

See Also

Example lpex7.c in the CPLEX User's Manual.

Previous Page: CPXgetcolindexFirst PageNext Page: CPXgetcols