Search This Blog

Saturday, September 15, 2012

Quadratic programming solver using a null-space active-set method

% Quadratic programming solver using a null-space active-set method.
%
% [x, obj, lambda, info] = qpng (H, q, A, b, ctype, lb, ub, x0)
%
% Solve the general quadratic program
%
%      min 0.5 x'*H*x + q'*x
%       x
%
% subject to
%      A*x [ "=" | "<=" | ">=" ] b
%      lb <= x <= ub
%
% and given x0 as initial guess.
%
% ctype = An array of characters containing the sense of each constraint in the
%         constraint matrix.  Each element of the array may be one of the
%         following values
%           'U' Variable with upper bound ( A(i,:)*x <= b(i) ).
%           'E' Fixed Variable ( A(i,:)*x = b(i) ).
%           'L' Variable with lower bound ( A(i,:)*x >= b(i) ).
%
% status = an integer indicating the status of the solution, as follows:
%        0 The problem is infeasible.
%        1 The problem is feasible and convex.  Global solution found.
%        2 Max number of iterations reached no feasible solution found.
%        3 Max number of iterations reached but a feasible solution found.
%
% If only 4 arguments are provided the following QP problem is solved:
%
% min_x .5 x'*H*x+x'*q   s.t. A*x <= b
%
% Any bound (ctype, lb, ub, x0) may be set to the empty matrix []
% if not present.  If the initial guess is feasible the algorithm is faster.
%
% See also: glpk.
%
% Copyright 2006-2007 Nicolo Giorgetti.

% This file is part of GLPKMEX.
%
% GLPKMEX is free software; you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% GLPKMEX is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with GLPKMEX; see the file COPYING.  If not, write to the Free
% Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
% 02110-1301, USA.

No comments:

Post a Comment

Thank you