%% Initialize
clear

%%% Start options for table testing, test type, and file name
numProbs = 5;    % number of problems

% type of test:
% use 'Msize' for varying m
% use 'Nsize' for varying n
% use dense for varying density 

% option to save structs
opts.savestructs = true;

for j = 1:3
    for i = 1:3  
        %%% To determine which parameter to vary 
        if     j == 1
            teststr = 'sizeM'; 
        elseif j == 2
            teststr = 'sizeN'; 
        elseif j == 3
            teststr = 'dense'; 
        else
            fprintf('Invalid j entered')
            keyboard
        end
        
        %%% To determine which stopping tolerance to use 
        if     i == 1
            opts.tol = 1e-2;
        elseif i == 2
            opts.tol = 1e-4;
        elseif i == 3
            opts.tol = 1e-14;
        else
             fprintf('Invalid i entered')
            keyboard
        end

        % file number
        numstr = num2str(i);
        % file name
        filename = strcat(teststr,numstr,'.tex');
    
        % Options for run-file
        opts.verbose= true;
    
        nn = [];
        mm = [];
        PP = [];   % density
    
        switch teststr
            case 'sizeM'
            %%% Small problems, increasing size with respect to m
            mm = (100:500:2000)'; % density remain the same
            nn = ones(length(mm),1); % size of each problem not change
            nn = 3000*nn;
            PP = ones(length(mm),1); % density of each problem not changed
            PP = 0.0081*PP;
            
            case 'sizeN'
            %%% Small problems, increasing size with respect to n
            nn = (3000:500:5000)'; % density remain the same
            mm = ones(length(nn),1); % size of each problem not change
            mm = 200*mm;
            PP = ones(length(nn),1); % density of each problem not changed
            PP = 0.0081*PP;
            
            case 'dense'
            %%% Small problems, increasing density
            PP = (0.01:0.05:1)'; % density is changing
            nn = ones(length(PP),1); % size of each problem not change
            nn = 1000*nn;
            mm = ones(length(PP),1); % size of each problem not change
            mm = 300*mm;
            otherwise
                fprintf('Entered incorrect case value, make sure str is equal to one of [Msize;Nsize;dense]')
                keyboard
        end

        %% Run tests
        run_table_tests_deg_Semism(nn, mm, PP, numProbs, filename, teststr, numstr, opts);
    end
end