function srd = srdMaster(data, options)
% Do SRD calculations for a given CV type and repack srd results
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

%--------------------------------------------------------------------------
% Compute SRD values and get associated statistics
%
switch options.fusionMeth
	case 'srd'
		switch options.cv
			case 'none'
				srd = srdMatrix(data.A, data.T, options.exact);
			case 'classic'
				srd = srdClassicCV(data, options);
			case 'lmo'
				srd = srdLMOCV(data, options);
		end
		
	case 'wf'
		switch options.cv
			case 'none'
				srd=struct();
				srd = srdFusion(srd, data.A, options);
			case 'classic'
				srd = srdClassicCV(data, options);
			case 'lmo'
				srd = srdLMOCV(data, options);
		end
		
	case 'both'
		switch options.cv
			case 'none'
				srd = srdMatrix(data.A, data.T, options.exact);
				srd = srdFusion(srd, data.A, options);
			case 'classic'
				srd = srdClassicCV(data, options);
			case 'lmo'
				srd = srdLMOCV(data, options);
		end
end
%--------------------------------------------------------------------------
% Re-package fields of SRD
%
srd = srdRepack(srd, data);
srd.options = options;

%==========================================================================
end

