If the file name ends with one of the following extensions, a compressed file is written.
-
.bz2 for files compressed with BZip2.
-
.gz for files compressed with GNU Zip.
This is from the documentation for CPXwriteprob here. If it suits your needs (it is not human readable, but has other advantages), you could use the SAV format which is described here.
For example:
status = CPXwriteprob (env, lp, "myprob.lp.gz", NULL);
or
status = CPXwriteprob (env, lp, "myprob.sav.gz", NULL);
#CPLEXOptimizers#DecisionOptimization