Last active
July 5, 2017 00:25
-
-
Save ryanrhymes/53b1235d4aacf198a8504426ed7ed2db to your computer and use it in GitHub Desktop.
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
function f00() | |
x = rand(1000, 2000) | |
t0 = time() | |
LinAlg.LAPACK.gesvd!('A','A',x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f00() | |
x = rand(4000, 4000) | |
t0 = time() | |
u, s, vt = LinAlg.svd(x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f01() | |
x = rand(2000, 1000) | |
t0 = time() | |
Q, R = LinAlg.qr(x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
(* for the following three, julia is faster *) | |
function f00() | |
x = rand(1000, 1000) | |
t0 = time() | |
LinAlg.LAPACK.geevx!('B','V','V','B',x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f01() | |
x = rand(1000, 1000) | |
t0 = time() | |
LinAlg.eigvals(x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f02() | |
x = rand(1000, 1000) | |
t0 = time() | |
LinAlg.LAPACK.geevx!('B','N','N','N',x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f03() | |
x = rand(2000, 2000) | |
t0 = time() | |
v, w = LinAlg.eig(x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f04() | |
x = rand(4000, 4000) | |
t0 = time() | |
v = cov(x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f05() | |
x = rand(4000, 4000) | |
t0 = time() | |
v = cumsum(x,2) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f05() | |
x = rand(4000, 4000) | |
t0 = time() | |
v = sum(x,1) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
function f06() | |
x = rand(4000, 4000) | |
t0 = time() | |
v = sin(x) | |
t1 = time() | |
@printf "time:\t\t%.8f\n" (t1 -t0) | |
end | |
(* ocaml code *) | |
Mat.(p *@ q =~ x);; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment