Initializing help system before first use

# XPRSloadqcqp, XPRSloadqcqp64

Purpose
Used to load a quadratic problem with quadratic side constraints into the Optimizer data structure. Such a problem may have quadratic terms in its objective function as well as in its constraints.
Topic areas
Problem Input, Quadratic
Synopsis
`int XPRS_CC XPRSloadqcqp(XPRSprob prob, const char * probname, int ncols, int nrows, const char rowtype[], const double rhs[], const double rng[], const double objcoef[], const int start[], const int collen[], const int rowind[], const double rowcoef[], const double lb[], const double ub[], int nobjqcoefs, const int objqcol1[], const int objqcol2[], const double objqcoef[], int nqrows, const int qrowind[], const int nrowqcoefs[], const int rowqcol1[], const int rowqcol2[], const double rowqcoef[]);`
``
`int XPRS_CC XPRSloadqcqp64(XPRSprob prob, const char * probname, int ncols, int nrows, const char rowtype[], const double rhs[], const double rng[], const double objcoef[], const XPRSint64 start[], const int collen[], const int rowind[], const double rowcoef[], const double lb[], const double ub[], XPRSint64 nobjqcoefs, const int objqcol1[], const int objqcol2[], const double objqcoef[], int nqrows, const int qrowind[], const XPRSint64 nrowqcoefs[], const int rowqcol1[], const int rowqcol2[], const double rowqcoef[]);`
Arguments

prob | The current problem.
probname | A string of up to MAXPROBNAMELENGTH characters containing a name for the problem. If probname is NULL, the problem name will be an empty string.
ncols | Number of structural columns in the matrix.
nrows | Number of rows in the matrix (not including the objective row). Objective coefficients must be supplied in the objcoef array, and the objective function should not be included in any of the other arrays.
rowtype | Character array of length nrows containing the row types:
L | indicates a <= constraint (use this one for quadratic constraints as well);
E | indicates an = constraint;
G | indicates a >= constraint;
R | indicates a range constraint;
N | indicates a nonbinding constraint.
May be NULL if the problem contains no rows.
rhs | Double array of length nrows containing the right hand side coefficients of the rows. The right hand side value for a range row gives the upper bound on the row. May be NULL if the problem contains no rows.
rng | Double array of length nrows containing the range values for range rows. Values for all other rows will be ignored. May be NULL if there are no ranged constraints. The lower bound on a range row is the right hand side value minus the range value. The sign of the range value is ignored - the absolute value is used in all cases.
objcoef | Double array of length ncols containing the objective function coefficients. This can be NULL to set all objective coefficients to 0 (zero).
start | Integer array containing the offsets in the rowind and rowcoef arrays of the start of the elements for each column. This array contains one entry for each column, plus one more if collen is NULL. If collen is NULL, the last entry of start contains the position in the rowind and rowcoef arrays at which an extra column would start, if it were present. This value is also the length of the rowind and rowcoef arrays. May be NULL if the problem contains no coefficients.
collen | Integer array of length ncols containing the number of nonzero elements in each column. May be NULL if not required. This array is not required if the non-zero coefficients in the rowind and rowcoef arrays are contiguous, and the start array has an additional entry as described above.
rowind | Integer array containing the row indices for the nonzero elements in each column. May be NULL if the problem contains no coefficients. If the indices are input contiguously, with the columns in ascending order, the length of the rowind array is found by adding the start entry for the last column to the collen entry for the last column, or if collen is NULL, by the additional entry at the end of start.
rowcoef | Double array containing the nonzero element values; length as for rowind. May be NULL if the problem contains no coefficients.
lb | Double array of length ncols containing the lower bounds on the columns. Use XPRS_MINUSINFINITY to represent a lower bound of minus infinity. If this is NULL then all lower bounds are 0 (zero).
ub | Double array of length ncols containing the upper bounds on the columns. Use XPRS_PLUSINFINITY to represent an upper bound of plus infinity. If this is NULL then all upper bounds are infinite.
nobjqcoefs | Number of quadratic terms.
objqcol1 | Integer array of size nobjqcoefs containing the column index of the first variable in each quadratic term. May be NULL if all objective coefficients are zero.
objqcol2 | Integer array of size nobjqcoefs containing the column index of the second variable in each quadratic term. May be NULL if all objective coefficients are zero.
objqcoef | Double array of size nobjqcoefs containing the quadratic coefficients. May be NULL if all objective coefficients are zero.
nqrows | Number of rows containing quadratic matrices.
qrowind | Integer array of size nqrows, containing the indices of rows with quadratic matrices in them. Note that the rows are expected to be defined in rowtype as type L. May be NULL if the problem contains no quadratic constraints.
nrowqcoefs | Integer array of size nqrows, containing the number of nonzeros in each quadratic constraint matrix. May be NULL if the problem contains no quadratic constraints.
rowqcol1 | Integer array of size nqcelem, where nqcelem equals the sum of the elements in nrowqcoefs (i.e. the total number of quadratic matrix elements in all the constraints). It contains the first column indices of the quadratic matrices. Indices for the first matrix are listed from 0 to nrowqcoefs[0]-1, for the second matrix from nrowqcoefs[0] to nrowqcoefs[0]+ nrowqcoefs[1]-1, etc. May be NULL if the problem contains no quadratic constraints.
rowqcol2 | Integer array of size nqcelem, containing the second index for the quadratic constraint matrices. May be NULL if the problem contains no quadratic constraints.
rowqcoef | Integer array of size nqcelem, containing the coefficients for the quadratic constraint matrices. May be NULL if the problem contains no quadratic constraints.

Related controls
Integer

EXTRACOLS | Number of extra columns to be allowed for.
EXTRAELEMS | Number of extra matrix elements to be allowed for.
EXTRAMIPENTS | Number of extra MIP entities to be allowed for.
EXTRAROWS | Number of extra rows to be allowed for.
KEEPNROWS | Status for nonbinding rows.
SCALING | Type of scaling.

Double

MATRIXTOL | Tolerance on matrix elements.

Example
To load the following problem presented in LP format:

    minimize [ x^2 ]
    s.t.
    4 x + y <= 4
    x + y + [z^2] <= 5
     [ x^2 + 2 x*y + y^2 + 4 y*z + z^2 ] <= 10
    x + 2 y >= 8
     [ 3 y^2 ] <= 20
    end

the following code may be used:

    {
        int ncols = 3;
        int nrows = 5;
        char rowtypes[] = {'L','L','L','G','L'};
        double rhs[] = {4,5,10,8,20};
        double rng[] = {0,0,0,0,0};
        double objcoef[] = {0,0,0,0,0};
        int start[] = {0,3,6,6};
        int* collen = NULL;
        int mrind[] = {0,1,3,0,1,3};
        double rowcoef[] = {4,1,1,1,1,2};
        double lb[] = {0,0,0};
        double ub[] = {XPRS_PLUSINFINITY,XPRS_PLUSINFINITY,
        XPRS_PLUSINFINITY};

        int nobjqcoefs = 1;
        int objqcol1[] = {0};
        int objqcol2[] = {0};
        double objqcoef[] = {1};

        int nqrows = 3;
        int qrowind[] = {1,2,4};
        int nrowqcoefs[] = {1,5,1};
        int qcmcol1[] = {2,0,0,1,1,2,1};
        int qcmcol2[] = {2,0,1,1,2,2,1};
        // ! to have 2xy define 1xy (1yx will be assumed to be implicitly present)
        double rowqcoef[] = {1,9,1,8,2,7,3};
    }

    XPRSloadqcqp(xprob,"qcqp",ncols,nrows,rowtypes,rhs,rng,objcoef,start,
    collen,mrind,rowcoef,lb,ub,nobjqcoefs,objqcol1,objqcol2,objqcoef,nqrows,qrowind,nrowqcoefs,
    qcmcol1,qcmcol2,rowqcoef);

    }

Further information
1. The objective function is of the form cTx+ 0.5 xTQx. Note that only the upper or lower triangular part of the Q matrix is specified, both for the objective and constraints.
2. The row and column indices follow the usual C convention of going from 0 to nrows-1 and 0 to ncols-1 respectively.
3. The double constants XPRS_PLUSINFINITY and XPRS_MINUSINFINITY are defined in the Optimizer library header file.
4. Passing zero for all integer arguments and NULL for all array arguments will load an empty problem.
Related topics
XPRSloadmip, XPRSloadlp, XPRSloadmiqp, XPRSloadqp, XPRSreadprob.
Parent Topic Console and Library Functions

© 2001-2026 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.