ian matrix.
%
% Convergence check:
% LS_nnls checks for each of the nnls subproblem if a certain accuracy is
% reached. It does that no like usually by checking the norm of the
% gradient, but by guessing the convergence curve from the difference
% between two consecutive iterative solutions (Consec_error).
% It performs a linear fit of the log of Consec_error for opts.sample
% previous iterates and if the error between the linear fit and the log of
% the consecutive error is smaller than opts.tol_ the algo