NO FRAMES

CPXsolwrite

int CPXPUBLIC CPXsolwrite(CPXCENVptr env, CPXCLPptr lp, void(CPXPUBLIC *hsection)(CPXCENVptr, CPXCLPptr, void *) , void(CPXPUBLIC *rsectionbeg)(void *) , void(CPXPUBLIC *csectionbeg)(void *) , void(CPXPUBLIC *write_entry)(void *, int, int, char *, char *, double, double, double, double, double) , void(CPXPUBLIC *sectionend)(void *) , void * info)
Definition file: cplex.h
Note

This is an advanced routine. Advanced routines typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other Callable Library routines instead.

The routine CPXsolwrite is a generic routine for writing solutions. It performs all the calculations needed to produce a solution file, but it writes only through functions that the user provides to it, so that the user may choose the data representation, data selection, and file format.

The user must open the file before calling CPXsolwrite and close the file after calling CPXsolwrite.

The arguments to CPXsolwrite are functions it calls to write the file. CPXsolwrite does not “know” anything about the file or the type of output being written. The argument info, the last parameter, communicates information to the routines hsection, rsectionbeg, csectionbeg, write_entry, and sectionend.

The function indicated by hsection writes a header section in a formatted file. Its only arguments are the ILOG CPLEX environment pointer env, the problem pointer lp, and the info parameter. CPXsolwrite calls this function first. It uses the lp problem pointer to retrieve any information needed by the header-section function.

The function indicated by rsectionbeg writes information at the beginning of the row section of a formatted file. It is called after hsection and sectionend. Its only argument is the info parameter.

The function indicated by csection writes information at the beginning of the column section of a formatted file. It is called after all row entries have been completed. Its only argument is the info parameter.

The function indicated by write_entry is called once for each row and column in the problem. The following table summarizes its arguments.

The function indicated by sectionend is used at the end of each header, row, and column section. The only argument to this function is the info parameter.

Type Name Meaning 
void *info the info parameter of CPXsolwrite 
int aflag a for alternate optimum 
int num sequence number; cumulative over rows and columns 
char *name name of row or column 
char *state state of row or column; one of: UL, LL, BS, EQ, FR, ** 
double val1 for rows, row activity; for columns, column solution value 
double val2 for rows, slack activitiy; for columns, objective coefficient 
double ll for rows, lower limit; for columns, lower bound 
double ul for rows, upper limit; for columns, upper bound 
double val3 for rows, dual value; for columns, reduced cost 

Parameters:

env

The pointer to the ILOG CPLEX environment, as returned by one of the CPXopenCPLEX routines.

lp

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

info

A generic pointer that passes information to each of the functions called by CPXsolwrite.

Returns:

The routine returns zero on success and nonzero if an error occurs.