A simple matrix benchmark test has indicated that Revolution Analytics R 2.13.2
s
LU decomposition is nearly 5 times slower than matrix multiplication.
Theory and many years of practice show that LU should be 1/3 to 2/3 the time for A*A
.
Revo R and Matlab are using Intel s Math Kernel for this test.
R 2.14.1
is not using a kernel. Everything is 64-bit.
异常情况见下表2。 表1 还有其他(表面)异常现象,但民族解放军是最引人注目的。
Table 1 (secs)
A*A LU A Det Inv
----------------------------------------------------
R 2.14.1 0.757 0.43 0.45 0.20 1.11
Revo R 2.13.2 0.063 0.35 0.11 0.03 0.14
Matlab 2011b 0.062 0.08 0.10 0.07 0.16
----------------------------------------------------
Averaged over 20 runs on a 1000x1000 random matrix
Table 2 (normalized)
A*A LU A Det Inv
----------------------------------------------------
R 2.14.1 1 0.57 0.19 0.26 1.47
Revol R 2.13.2 1 4.67* 1.58 1.33 2.17
Matlab 2011b 1 0.67 1.72 0.61 1.68
----------------------------------------------------
Note: x = A in Matlab is x <- solve(A,b) in R.
www.un.org/Depts/DGACM/index_spanish.htm 我遵循了Simon Urbanek的建议,并替换了<代码>LUP = 扩展((lu(Matrix(A));>lu(A); Revo R rows现在是
Revol R 2.13.2
A*A LU A Det Inv
---------------------------------
time 0.104 0.107 0.110 0.042 0.231
norm time 1.000 1.034 1.060 0.401 2.232
时间段
Dell Precision 690, 2 x Intel® Xeon® E53405 CPU @ 2.33GHz,
16GB ram, 2 Processors, 8 Cores and 8 Threads,
Windows 7 Prof., 64-bit
载有表格和所用代码的工作进度报告如下:http://www.scribd.com/doc/78367129/OConnor-X220-Benchmarks”rel=“nofollow”>。
<><>UPDATE 2
我修改了矩阵基准,仅测试Matrix Decompositions。 这些是建立所有其他矩阵算法的基础,如果这些算法是摇摇摇摇篮,那么所有其他算法也会动摇。
我已改为品牌
Lenovo ThinkPad X220, Intel Core i7-2640M CPU @ 2.80GHz,
8GB ram, 1 Processor, 2 Cores and 4 Threads
Windows 7 Professional, 64-bit.
These changes will, I hope, make the results more useful.
Table 3. Times(secs)
A*A chol(A) lu(A) qr(A) svd(A) eig(A) Total
-----------------------------------------------------------------------------
R 2.14.1 0.904 0.157 0.260 0.568 4.260 6.967 13.11
Revol R 2.13.2 0.121 0.029 0.062 0.411 1.623 3.265 5.51
Matlab 2011b 0.061 0.014 0.033 0.056 0.342 0.963 1.47
-----------------------------------------------------------------------------
Times(secs) averaged over 20 runs
Table 4. Times(normalized)
A*A chol(A) lu(A) qr(A) svd(A) eig(A) Total
----------------------------------------------------------------------------
R 2.14.1 1.000 0.174 0.288 0.628 4.714 7.711 14.52
Revol R 2.13.2 1.000 0.237 0.515 3.411 13.469 27.095 45.73
Matlab 2011b 1.000 0.260 0.610 0.967 5.768 16.774 25.38
----------------------------------------------------------------------------
Times(secs) averaged over 20 runs
我们可以从表4中看到,假冒的反常行为已经消失,所有制度都是按理论预测的。
Table 5. Times/Matlab Times
A*A chol(A) lu(A) qr(A) svd(A) eig(A) Total
----------------------------------------------------------------------------
R 2.14.1 15 11 8 10 12 7 9
Revol R 2.13.2 2 2 2 7 5 3 4
----------------------------------------------------------------------------
Rounded to the nearest integer