Previous Page: CPXNETsolution First PageNext Page: CPXnewcols

CPXNETwriteprob


Description

This function writes the network stored in a CPLEX network problem object to a file. This can be done in CPLEX (.net) or DIMACS (.min) network file format (MIN) or as the LP representation of the network in any of the LP formats (.lp, .mps, or .sav).

If the file name ends with .gz, a compressed file will be written.

Return Value

If the operation is successful, CPXNETwriteprob() returns the value 0; if not, it returns a nonzero value to indicate an error.

Synopsis

int CPXNETwriteprob (CPXENVptr env,
                     CPXNETptr net,
                     char *filename,
                     char *format);

Arguments


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

CPXNETptr net
A pointer to a CPLEX network problem object as returned by CPXNETcreateprob().

char *filename
Name of the network file to write, unless otherwise specified with the format argument. If the file name ends with .gz a compressed file will be written in accordance with the selected file type.

char *format
File format to generate. Possible values are:

net  
for CPLEX network format  
min  
for DIMACS network format  
lp  
for LP format of LP formulation  
mps  
for MPS format of LP formulation  
sav  
for SAV format of LP formulation  

If NULL is passed, the format is inferred from the file name.

Example

status = CPXNETwriteprob (env, net, "network.net", NULL);

Previous Page: CPXNETsolution First PageNext Page: CPXnewcols