Skip to content

Commit

Permalink
Add benchmark script
Browse files Browse the repository at this point in the history
  • Loading branch information
eeshan9815 committed May 15, 2018
1 parent 8ae13da commit e812548
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
30 changes: 30 additions & 0 deletions perf/linear_eq.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using IntervalArithmetic, StaticArrays, BenchmarkTools, Compat

include("../src/linear_eq.jl")

function randVec(n::Int)
a = randn(n)
A = Interval.(a)
sA = MVector{n}(A)
return A, sA
end

function randMat(n::Int)
a = randn(n, n)
A = Interval.(a)
sA = MMatrix{n, n}(A)
return A, sA
end

function benchmark(max=10)
for n in 1:max
A, sA = randMat(n)
b, sb = randVec(n)
println("For n = ", n)
t1 = @btime gauss_seidel_interval($A, $b)
println("Array: ", t1)
t2 = @btime gauss_seidel_interval_static($sA, $sb)
println("MArray: ", t2)
println()
end
end
17 changes: 0 additions & 17 deletions src/benchmark.jl

This file was deleted.

0 comments on commit e812548

Please sign in to comment.