When you instantiate a problem object, it is originally empty. In other words, it has no constraints, no variables, and no coefficient matrix. ILOG CPLEX offers you several alternative ways to put data into an empty problem object (that is, to populate your problem object).
-
You can make a sequence of calls, in any convenient order, to these routines:
-
CPXaddcols
-
CPXaddqconstr
-
CPXaddrows
-
CPXchgcoeflist
-
CPXcopyctype
-
CPXcopyqsep
-
CPXcopyquad
-
CPXnewcols
-
CPXnewrows
-
If data already exist in MPS, SAV, or LP format in a file, you can call
CPXreadcopyprob
to read that file and copy the data into the problem object. Mathematical Programming System (MPS) is an industry-standard format for organizing data in mathematical programming problems. LP and SAV file formats are ILOG CPLEX-specific formats for expressing linear programming problems as equations or inequalities. Understanding File Formats explains these formats briefly. They are documented in the reference manual ILOG CPLEX File Formats.
-
You can assemble arrays of data and then call
CPXcopylp
to copy the data into the problem object.
Whenever possible, compute your problem data in double precision (64 bit). Computers are finite-precision machines, and truncating your data to single precision (32 bit) can result in unnecessarily ill-conditioned problems For more information, refer to Numeric Difficulties.