-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ae13da
commit e812548
Showing
2 changed files
with
30 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.