Previous Page: CPXmpsmreadFirst PageNext Page: CPXmpsread

CPXmpsqread


Usage

Barrier Users Only

Description

This routine is used to read MPS format files containing quadratic objective terms. It is used just like the CPXmpsread() routine, except that it has additional arguments.

The last five additional arguments: int **qmatbeg_p, int **qmatcnt_p, int **qmatind_p, double **qmatval_p, int *qnzspace_p have the same meaning as those for CPXlpqread().

Note that even though CPXmpsqread() returns a ctype array and SOS data, it is not possible to copy both a ctype array and a quadratic matrix simultaneously into a single problem.

Return Value

The routine returns a zero on success, and a nonzero if an error occurs.

Synopsis

int CPXmpsqread char (CPXENVptr env,
                      char *filename,
                      int *numcols_p,
                      int *numrows_p,
                      int *numrims_p,
                      int *objsen_p,
                      double **obj_p,
                      double **rhs_p,
                      char **sense_p,
                      int **matbeg_p,
                      int **matcnt_p,
                      int **matind_p,
                      double **matval_p,
                      double **lb_p,
                      double **ub_p,
                      double **rngval_p,
                      int **freerowind_p,
                      int **rimtype_p,
                      int **rimbeg_p,
                      int **rimcnt_p,
                      int **rimind_p,
                      double **rimval_p,
                      char **dataname_p,
                      char **objname_p,
                      char **rhsname_p,
                      char **rngname_p,
                      char **bndname_p,
                      char ***colname_p,
                      char **colnamestore_p,
                      char ***rowname_p,
                      char **rownamestore_p,
                      char ***rimname_p,
                      char **rimnamestore_p,
                      int *colspace_p,
                      int *rowspace_p,
                      int *nzspace_p,
                      int *rimspace_p,
                      int *rimnzspace_p,
                      unsigned *colnamespace_p,
                      unsigned *rownamespace_p,
                      unsigned *rimnamespace_p,
                      char **ctype_p,
                      int *numsos_p,
                      int *numsosnz_p,
                      char **sostype_p,
                      int **sosbeg_p,
                      int **sosind_p,
                      double **sosref_p,
                      double **sosref_p,
                      int **qmatbeg_p,
                      int **qmatcnt_p,
                      int **qmatind_p,
                      double **qmatval_p,
                      int *qnzspace_p);

Arguments

The arguments to CPXmpsqread() are identical to those of CPXmpsread(), with the following additional arguments.

Each of the parameters ctype_p, numsos_p, numsosnz_p, sostype_p, sosbeg_p, sosind_p and sosref_p may be NULL. If a given parameter is NULL and there is information associated with it in the file, the information is still processed, but it will be discarded.

char **ctype_p
A pointer to a variable that will contain the address of an array that is used to store the type of each variable. Refer to the CPXcopyctype() routine for a description of each possible array value.

int *numsos_p
A pointer to an integer that will contain the number of Special Ordered Sets.

int *numsosnz_p
A pointer to an integer that will contain the total number of members in all sets.

char **sostype_p
A pointer to a variable that will contain the address of an array of type character containing the type of each SOS. Possible values are:

CPX_TYPE_SOS1  
('1')  
SOS Type 1  
CPX_TYPE_SOS2  
('2')  
SOS Type 2  

int **sosbeg_p
int **sosind_p
double **sosref_p
These three arguments are pointers to variables that will contain the array pointers describing the SOS data. Every SOS will be stored in sequential order in (*sosind_p), with (*sosbeg_p)[k] containing the beginning of SOS k. The last element of SOS k is stored in (*sosind_p)[(*sosbeg_p)[k+1]-1] for k < (*numsos_p)-1, and in (*sosind_p)[(*sosbeg_p)[(*numsosnz_p)-1]] for k=(*numsos_p)-1. Every entry (*sosref_p)[k] indicates the reference row value corresponding to SOS element (*sosind_p)[k].

int **qmatbeg_p
int **qmatcnt_p
int **qmatind_p
double **qmatval_p
These four arguments are pointers to variables that will contain the addresses of arrays that describe the Q matrix. They are analogous to the matbeg_p, matcnt_p, matind_p, and matval_p parameters used in the CPXlpread() and CPXmpsread() routines. The CPXmpsqread() routine allocates these arrays if the routine is successful.

int *qnzspace_p
A pointer to an integer that indicates the length of the arrays *qmatind_p and *qmatval_p. It is also used, as described at the beginning of this section, to allocate additional space for these arrays.

Example

status = CPXmpsqread (env, filename, &numcols, &numrows, &numrims,
                      &matind, &matval, &lb, &ub, &rngval,
                      &freerowind, &rimtype, &rimbeg, &rimcnt,
                      &rimind, &rimval, &dataname, &objname,
                      &rhsname, &rngname, &bndname, &colname,
                      &colnamestore, &rowname, &rownamestore,
                      &rimname, &rimnamestore, &colspace,
                      &rowspace, &nzspace, &rimspace,
                      &rimnzspace, &colnamespace, &rownamespace,
                      &rimnamespace, &ctype, &numsos, &numsosnz,
                      &sostype, &sosbeg, &sosind, &sosref,
                      &qmatbeg, &qmatcnt, &qmatind, &qmatval,
                      &qnzspace);

Previous Page: CPXmpsmreadFirst PageNext Page: CPXmpsread