function [ optiX, total_iteration, each_inner_loop_iteration ] = solve_problem( x, c, A, b, init_t, mu )
%SOLVE_PROBLEM Summary of this function goes here
%   Detailed explanation goes here

% init
tol = 1e-3;
inner_loop_counter = zeros(100, 1);
[system_dim, m] = size(A);
t = init_t;
% outer loop
for i = 1:100
   %inner loop
    for j = 1:100
        gradient = evaluate_gradient(x, c, A, b, t);

        H = evaluate_hessian(x, c, A, b, t);
        dir = -H\gradient;
        if (-gradient'*dir < tol^2)
            break;
        end        %dir = - gradient;
        step_size = line_search(x, dir, c, A, b, t);
        x = x + step_size * dir;
        
        inner_loop_counter(i) = inner_loop_counter(i) + 1;
    end
    
    if (m/t < tol)
        break;
    end
    t = t * mu;
end

optiX = x;
each_inner_loop_iteration = inner_loop_counter(1:i);
total_iteration = sum(each_inner_loop_iteration);

end

