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

Corrections for Julia 0.6.0 #13

Merged
merged 7 commits into from
Jul 20, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
julia 0.5
Plots

julia 0.6
Plots, NaNMath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just add NaNMath to the list on line 3.

2 changes: 1 addition & 1 deletion src/BenchmarkProfiles.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module BenchmarkProfiles

import Plots
import Plots, NaNMath

export performance_ratios, performance_profile
export data_ratios, data_profile
Expand Down
10 changes: 5 additions & 5 deletions src/performance_profiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ function performance_ratios(T :: Array{Float64,2}; logscale :: Bool=true)

(np, ns) = size(T); # Number of problems and number of solvers.

T[isinf(T)] = NaN;
T[isinf.(T)] = NaN;
T[T .< 0] = NaN;
minperf = minimum(T, 2); # Minimal (i.e., best) performance per solver
minperf = Base.minimum(T, 2); # Minimal (i.e., best) performance per solver

# Compute ratios and divide by smallest element in each row.
r = zeros(np, ns);
for p = 1 : np
r[p, :] = T[p, :] / minperf[p];
end

logscale && (r = log2(r));
max_ratio = maximum(r);
logscale && (r = log2.(r));
max_ratio = NaNMath.maximum(r)

# Replace failures with twice the max_ratio and sort each column of r.
failures = isnan(r);
failures = isnan.(r);
r[failures] = 2 * max_ratio;
r = sort(r, 1);
return (r, max_ratio)
Expand Down