Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use drawtol as parameter for performance_profile() #52

Closed
lrsantos11 opened this issue Apr 1, 2021 · 0 comments
Closed

use drawtol as parameter for performance_profile() #52

lrsantos11 opened this issue Apr 1, 2021 · 0 comments

Comments

@lrsantos11
Copy link
Contributor

I wish to consider a tolerance, namely, drawtol::Float64, for setting two solvers results as draw.
For instance, if the tolerance is 5%, a solver A is draw with a solver B, whenever the results have relative distance of 5%.
The following function in matlab does that

function PerformanceProfile(PP)

draw = 1.05; 

[np,na] = size(PP)

colors  = {'k','k','k','k','k','k'};
lines   = {'-','-','-','-','-','-'};
markers = {'none','o','+','*','d','x'};

minP = min(PP');

for i = 1:np
    if ( minP(i) ~= isnan(PP) )
        PP(i,:) = PP(i,:)/minP(i);
    end
end

maxPP = max(max(PP));

PP(find(isnan(PP))) = 2 * maxPP;

clf;

for i = 1:na
    x = sort(PP(:,i));
    y = [1:np]'/np;
    
    for j = 1:np
        if ( x(j) <= draw )
            x(j) = 1;
        else
            break
        end
    end
    
    n1 = histcounts(x,[1 1]);
    
    if ( n1 == 0 )
        x = [1 ; x];
        y = [0 ; y];
    else  
        x([1:n1-1]) = [];
        y([1:n1-1]) = [];
    end
    
    x = [x ; 2 * maxPP];
    y = [y ; y(length(y))];
    
   
    [xb,yb] = stairs(x,y);
    p = plot(xb,yb); 
    p.LineWidth = 2;
    p.Color     = colors{i};
    p.LineStyle = lines{i};
    p.Marker    = markers{i};
    
    hold on   
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants