clear

% Definition of the constraints
A=[1 -1 0 0 0 0 0;0 0 1 -1 0 0 0;0 0 0 0 1 -1 0;0 0 0 0 0 0 -1];
b=[3;-5;-3;-3;-0.5;0.1;-3];

% Definition of the objective function
G=[5 1 0 3;
   1 6 0 0.3;
   0 0 5 0.1;
   3 0.3 0.1 2];
g=[10;7.8;-4;7];




[uf0,Ac,ac,Nc,nc]=initial_condition(A,b);   % Calculation of initial feas.
                                            % point.
%----------------------------- Measuring ----------------------------------
% Calculation of the initial feasible point isn't included
tic                                         % Described QP algorithm
uf1=qpas(uf0,G,g,Ac,ac,Nc,nc)               
toc

Ap=-A';
bp=-b;
tic                                         % QP toolbox algorithm
uf2=quadprog(G,g,Ap,bp,[],[],[],[],uf0)     
toc


% Calculation of the initial feasible point is included
tic                                         % Described QP algorithm
[uf0,Ac,ac,Nc,nc]=initial_condition(A,b);
uf1=qpas(uf0,G,g,Ac,ac,Nc,nc)
toc

tic                                         % QP toolbox algorithm
uf2=quadprog(G,g,Ap,bp)
toc