Overview | Group | Tree | Graph | Index | Concepts |
The routine CPXcopyquad
is used to copy
quadratic objective matrix Q when Q
is not diagonal. The arguments qmatbeg
, qmatcnt
,
qmatind
, and qmatval
are used to specify the
nonzero coefficients of the matrix Q. The meaning of these vectors is
identical to the meaning of the corresponding vectors matbeg
,
matcnt
, matind
and matval
, which are
used to specify the structure of A in a call to CPXcopylp
.
Q must be symmetric when copied by this function. Therefore, if the quadratic coefficient in algebraic form is 2x1x2, then x2 should be in the list for x1, and x1 should be in the list for x2, and the coefficient would be 1.0 in each of those entries. See the corresponding example C program to review how the symmetry requirement is implemented.
0.5
in front of the quadratic objective term.How the arrays are accessed
Suppose that CPLEX wants to access the entries in a column
j
. These are assumed to be given by the array entries:
qmatval[qmatbeg[j]],..,qmatval[qmatbeg[j]+qmatcnt[j]-1]
The corresponding column/index entries are:
qmatind[qmatbeg[j]],..,qmatind[qmatbeg[j]+qmatcnt[j]-1
The entries in qmatind[k]
are not required to be in column
order. Duplicate entries in qmatind
within a single column are
not allowed. Note that any column j
that has only a linear
objective term has qmatcnt[j] = 0
and no entries in
qmatind
and qmatval
.
Example
status = CPXcopyquad (env, lp, qmatbeg, qmatcnt, qmatind, qmatval);
See Also:
env | A pointer to the CPLEX environment as returned by |
lp | A pointer to a CPLEX problem object as returned by |
qmatbeg | An array that with |
qmatcnt | An array that with |
qmatind | An array that with |
qmatval | An array that with |