!--
##### SOURCE BEGIN #####
function [X, G] = LS_nnls(A, Y, opts, G, x)
%% LS_NNLS  Solver for large non-negative least-squares problems
%
% Solves argmin_{x>=0}||y-A(x)||_2^2
%
% Input:
% A              Matrix corresponding to A in the formula above.
% x              Matrix of solution vectros of the above problem. LS_nnls
%                   solves multiple nnls problems in parallel.
% Y              Matrix of inhomogenities, each row represents one nnls
%                   problm.
% struct opts
% opts.d