Purpose 
 
 
 
  Writes the current 
 
problem to an MPS or LP file. 
  
  Topic area 
 
 
 
 
  Synopsis 
 
 
 
 
 int XPRS_CC XPRSwriteprob(XPRSprob prob, const char *filename, const char *flags); 
 
 
 
 
 WRITEPROB [-flags] [filename] 
 
 
 
  Arguments 
 
 
 
 
  
   
   | 
      prob  
     | 
      The current problem. 
     | 
 
   
   | 
      filename  
     | 
      A string of up to 
     MAXPROBNAMELENGTH  characters to contain the file name to which the problem is to be written. If omitted, the default 
     problem_name  is used with a 
     .mps  extension, unless the 
     l  flag is used in which case the extension is 
     .lp . 
     | 
 
   
   | 
      flags  
     | 
      Flags, which can be one or more of the following: 
      
      
       
       | 
          o  
         | 
          one element per line; 
         |   
       | 
          n  
         | 
          output the scaled problem; 
         |   
       | 
          s  
         | 
          scrambled vector names; 
         |   
       | 
          l  
         | 
          output in LP format; 
         |   
       | 
          p  
         | 
          output values in full precision (obsolete as this is now default behavior); 
         |   
       | 
          t  
         | 
          omit the Xpress header in LP or MPS format; 
         |   
       | 
          v  
         | 
          use the provided filename verbatim, without appending the 
         .mps or 
         .lp extension; 
         |   
       | 
          z  
         | 
          compress the output file. 
         |  | 
 
  
 
  Example 
 
 
 
  The following example outputs the current problem in LP format with scrambled vector names to the file 
  problem_name 
 .lp. 
 
 
 
 
 XPRSwriteprob(prob, "", "ls");
 
  
 
  Further information 
 
 
 
  1. If 
 
XPRSloadlp, 
 
XPRSloadmip, 
 
XPRSloadmiqp or 
 
XPRSloadqp is used to obtain a matrix then there is no association between the objective function and the 
 
N rows in the matrix and so a separate 
 
N row (called 
 
__OBJ___) is created when you do an 
 
XPRSwriteprob ( 
 
WRITEPROB). Also if you do an 
 
XPRSreadprob ( 
 
READPROB) and then change either the objective row or the 
 
N row in the matrix corresponding to the objective row, you lose the association between the two and the 
 
__OBJ___ row is created when you do an 
 
XPRSwriteprob ( 
 
WRITEPROB). To remove the objective row from the matrix when doing an 
 
XPRSreadprob ( 
 
READPROB), set 
 
KEEPNROWS to 
 
-1 before 
 
XPRSreadprob ( 
 
READPROB). 
  
  2. 
 
Warning: If 
 
XPRSreadprob ( 
 
READPROB) is used to input a problem, then the input file will be overwritten by 
 
XPRSwriteprob ( 
 
WRITEPROB) if a new filename is not specified. 
  
  3. The Optimizer can write compressed matrix files in the following formats, as long as the command-line tool necessary to compress the file can be located in the path: 
 bzip2, 
 xz, 
 lzma, 
 Z, 
 zip, 
 tar, 
 tgz. The Optimizer has built-in support for the 
 gz format: no external tools are necessary to write gzipped matrix files. 
 
 
 
  Related topics 
 
 
 
                 
                
                    © 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the
                    property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not
                    convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except
                    solely for internal evaluation purposes to determine whether to purchase a license to the software
                    described in this documentation, or as otherwise set forth in a written software license agreement
                    between you and FICO (or a FICO affiliate). Use of this documentation and the software described in
                    it must conform strictly to the foregoing permitted uses, and no other use is permitted.