% Example script for running ILS_concave_cuts

n = 50;
A = randn(2*n, n) / 10; b = randn(2*n, 1);

xcts = A\b;
lb0 = norm(A*xcts - b)^2; % simple lower bound

tic;
[lb1, lb2, ub, xhat] = ILS_concave_cuts(A, b);
elapsed = toc;

fprintf('Elapsed time: %.5f seconds\n', elapsed);
fprintf('Simple lower bound         : %.5f\n', lb0);
fprintf('SDP lower bound            : %.5f\n', lb1);
fprintf('SDP lower bound (with cuts): %.5f\n', lb2);
fprintf('Upper bound                : %.5f\n', ub);
fprintf('2-norm of the suboptimal solution: %.5f\n', norm(xhat));
