%% init
system_dim = 1000;
constraint_num = 250;
multiplier_mu = 10;
initial_t = 1;
% initial guess
x = zeros(system_dim, 1);
lambda = ones(constraint_num, 1);

%% generate problem randomly
% min  0.5*x^T*x + c^T x
% s.t. A^T x >= 0
density = 0.001/system_dim;
[c, A, b] = generate_problem(system_dim, constraint_num, density);

%% solve problem using barrier method
[optiX1, total_iteration1] = solve_problem(x, c, A, b, initial_t, multiplier_mu);

%% primal_dual
[optiX, optiLambda, total_iteration] = solve_problem_primal_dual(x, lambda, c, A, b, multiplier_mu);

%% effect of mu
total_its = zeros(38, 1);
for i = 3:40
    mu = i;
    [optiX, optiLambda, total_its(i-2)] = solve_problem_primal_dual(x, lambda, c, A, b, mu);
end
mu_candidate = (3:40);
%% plot effect of mu
plot(mu_candidate, total_its);
%% evaluate result