rithm can use
% this information to accurately estimate the true error. If the true error
% is below opts.tol the algorithm stops for the nnls-sub-problem in
% question and puts the current solution into the output array.

%% Set default values for parameters not set by user
if nargin<3
    opts =struct;
end

if ~isfield(opts,'display')
    opts.display = false;
end

if ~isfield(opts,'use_std')
    opts.use_std = false;
end

if ~isfield(opts,'lambda')
    opts.lambda = 0;
end

if ~isfield(opts,'gpu_id')
   