CPXXNETwriteprob and CPXNETwriteprob

The routine CPXXNETwriteprob/CPXNETwriteprob writes the network stored in a network problem object to a file.

int  CPXXNETwriteprob( CPXCENVptr env, CPXCNETptr net, char const * filename_str, char const * format_str )

int  CPXNETwriteprob( CPXCENVptr env, CPXCNETptr net, char const * filename_str, char const * format_str )

Description

The routine CPXXNETwriteprob/CPXNETwriteprob writes the network stored in a network problem object to a file. This can be done in CPLEX (.net) or DIMACS (.min) network file format 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 is written.

Table 1. File extensions for network files
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
rlp for RLP format of LP formulation with generic names of rows and columns
alp for ALP format of LP formulation with generic names of rows and columns, types, and bounds.

Arguments

env
A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.
net
A pointer to a CPLEX network problem object as returned by CPXXNETcreateprob/CPXNETcreateprob.
filename_str
Name of the network file to write, where the file extension specifies the file format unless overridden by the format argument. If the file name ends with .gz a compressed file is written in accordance with the selected file type.
format_str
File format to generate. Possible values appear in the table. If NULL is passed, the format is inferred from the file name.

Return

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

Example


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