% CPLEXQP - quadratic programming by the barrier method.
%
% CPLEXQP solves a quadratic program on the form
%
%       min  0.5x'Qx + c'x
%       s.t  Ax | b
%            l <= x <= u
%
% where | is any of =, <= , >=.
%
% Calling syntax: [obj,x,lambda,status,cstat] = cplexqp(c,A,b,Q,l,u,le,ge,opts)
%
% Q must be symmetric, an error will occur otherwise
%
% If 'l','u' are given as empty matrices [], x is assumed non-negative.
%
% 'le' ('ge') are indices corresponding to equations with <=  ( >= ) 
% and can be omitted.
%
% 'opts' is a structure that contains option pairs, eg struct('qpmethod',4)
%
% valid options are currently, qpmethod, itlim, preind, output
%   the first three are standard cplex options, the latter switches
%   output on/off
%
% On exit 'status' has the following interpretation:
%
%                 1 optimal solution found
%                 2 problem infeasible
%                 3 problem unbounded
%                 9 problem non-optimal, singularities in Phase II
%                10 problem non-optimal, singularities in Phase I
%
% 'cstat' tells the status of the columns:
%
%                  cstat[i] = 0   variable at lower bound
%                  cstat[i] = 1   variable is basic
%                  cstat[i] = 2   variable at upper bound
%                  cstat[i] = 3   variable free and non-basic
