qcqp_nlp_consfcn

qcqp_nlp_consfcn(x, QQ, BB, dd)

qcqp_nlp_consfcn() - Evaluates quadratic constraints and their Jacobian for NLP solver.

[H, G] = QCQP_NLP_CONSFCN(X, QQ, BB, DD)
[H, G, DH, DG] = QCQP_NLP_CONSFCN(X, QQ, BB, DD)

Constraint evaluation function for quadratic constraints, suitable
for use with MIPS, FMINCON, etc. Computes constraint vectors and their
gradients for a set of quadratic constraints of the form:

    1/2 Xblk' * blkQe * Xblk + Be * X == de
    1/2 Xblk' * blkQi * Xblk + Bi * X <= di

where Xblk is formed by creating a block diagonal matrix with X repeated
along the block diagonal.

Inputs:
  X   : optimization vector
  QQ  : struct with (possibly sparse) quadratic matrices for
        equality/inequality constraints with the following fields:
      blkQi : block diagonal matrix formed from the nqi x 1 cell array
              of sparse quadratic matrices for inequaliy constraints
      blkQe : block diagonal matrix formed from the nqe x 1 cell array
              of sparse quadratic matrices for equaliy constraints
  BB : struct with the matrices (possibly sparse) of linear parameters
       of equality/inequality constraints with the following fields:
      Bi : matrix with linear parameters for inequality constraints
      Be : matrix with linear parameters for equality constraints
  DD : struct with the vector of constant terms of equality/inequality
       constraints with the following fields:
      di : vector with constant terms for inequality constraints
      de : vector with constant terms for equality constraints

Outputs:
  H  : vector of inequality constraint values
  G  : vector of equality constraint values
  DH : (optional) inequality constraint gradients, column j is
       gradient of H(j)
  DG : (optional) equality constraint gradients

Examples:
    [h, g] = qcqp_nlp_consfcn(x, QQ, BB, dd);
    [h, g, dh, dg] = qcqp_nlp_consfcn(x, QQ, BB, dd);

See also qcqp_nlp_costfcn(), qcqp_nlp_hessfcn(), qcqps_master().