~ubuntu-branches/ubuntu/wily/julia/wily

« back to all changes in this revision

Viewing changes to test/perf/lapack/factorizations.jl

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-11-17 19:32:52 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20131117193252-tkrpclguqqebqa35
Tags: 0.2.0+dfsg-3
testsuite-i386.patch: loosen the numerical precision for yet another test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function svdtest(n, iter)
 
2
    A = rand(n,n)
 
3
    B = svdfact(A)
 
4
    for i = 1:iter-1
 
5
        B = svdfact(A)
 
6
    end
 
7
    B
 
8
end
 
9
 
 
10
function schurtest(n, iter)
 
11
    A = rand(n,n)
 
12
    B = schurfact(A)
 
13
    for i = 1:iter-1
 
14
        B = schurfact(A)
 
15
    end
 
16
    B
 
17
end
 
18
 
 
19
function choleskytest(n, iter)
 
20
    A = rand(n,n)
 
21
    A = A'*A
 
22
    B = cholfact(A)
 
23
    for i = 1:iter-1
 
24
        B = cholfact(A)
 
25
    end
 
26
    B
 
27
end
 
28
 
 
29
function qrtest(n, iter)
 
30
    A = rand(n,n)
 
31
    B = qrfact(A)
 
32
    for i = 1:iter-1
 
33
        B = qrfact(A)
 
34
    end
 
35
    B
 
36
end
 
37
 
 
38
function lutest(n, iter)
 
39
    A = rand(n,n)
 
40
    B = lufact(A)
 
41
    for i = 1:iter-1
 
42
        B = lufact(A)
 
43
    end
 
44
    B
 
45
end
 
46
 
 
47
problemsizes = [(2, 20000, "tiny"), (2^4, 1000, "small"), (2^6, 100, "medium"), (2^8, 5, "large"), (2^10, 1, "huge")]
 
48
qr_problemsizes = [(2, 100000, "tiny"), (2^4, 5000, "small"), (2^6, 500, "medium"), (2^8, 5, "large"), (2^10, 1, "huge")]
 
49
lu_problemsizes = [(2, 100000, "tiny"), (2^4, 10000, "small"), (2^6, 1000, "medium"), (2^8, 100, "large"), (2^10, 2, "huge")]
 
50
testdata = [(choleskytest, "choleskytest", "Cholesky factorization", problemsizes),
 
51
            (schurtest, "schurtest", "Schur factorization", problemsizes),
 
52
            (svdtest, "svdtest", "Singular value decomposition", problemsizes),
 
53
            (qrtest, "qrtest", "QR factorization", qr_problemsizes),
 
54
            (lutest, "lutest", "LU factorization", lu_problemsizes)]
 
55
include("../perfgeneric.jl")
 
56