function samplemodel_out = prepare_samplemodel_LRRS(prob,samplemodel)
%prepare_samplemodel_LRRS This function computes key quantities of the
%sampling model.
samplemodel_out = samplemodel;
% if not(isfield(prob.graphmodel,'r'))
%         prob.graphmodel.r = prob.n;
% end
[df_LR,df_JS,df_combined,df_s_squared,df_combined_RIP_1,df_combined_RIP_2,...
    m_LR,m_JS,m_combined] = degfreedom(prob.n1,prob.n2,prob.K1,prob.n2,prob.r);

% deg_freedom = compute_degfreedom_matrix(prob.n,prob.n,prob.graphmodel.r,prob.operatorHermitian);
nentries = prob.n1*prob.n2;
% samplemodel_out.l = floor(1.*length(prob.powers));

% if strcmp(samplemodel.mode,'random_fully_uniform') || strcmp(samplemodel.mode,'random_adaptive_probs')
%     m_total = floor(samplemodel.oversampling*deg_freedom);
%     if strcmp(samplemodel.mode,'random_fully_uniform')
%         samplemodel_out.m_total = m_total;  % total number of sampled entries
%     elseif strcmp(samplemodel.mode,'random_adaptive_probs')
%         samplemodel_out.m_total_expected = m_total;
%     end
% elseif strcmp(samplemodel.mode,'random_fixed_sensors') ||  strcmp(samplemodel.mode,'random_indep_sensors')
samplemodel_out.m = ceil(samplemodel.oversampling*df_combined);
%samplemodel_out.m =
%min([ceil(samplemodel.oversampling*df_combined),nentries]);   % use this
%line if number of measurements shall be capped at number of entries of
%ground truth.
samplemodel_out.deg_freedom = df_combined;
samplemodel_out.deg_freedom_LR = df_LR;
samplemodel_out.deg_freedom_JS = df_JS;
samplemodel_out.nentriesX = nentries; %nentriesA
end

