linpack_bench_backslash, a MATLAB code which carries out the LINPACK Benchmark, using the "backslash" operator for greater efficiency.
The LINPACK benchmark is a test problem used to rate the performance of a computer on a simple linear algebra problem.
The test problem requires the user to set up a random dense matrix A of size N = 1000, and a right hand side vector B which is the product of A and a vector X of all 1's. The first task is to compute an LU factorization of A. The second task is to use the LU factorization to solve the linear system
A * X = B.
The number of floating point operations required for these two tasks is roughly
ops = 2 * N*N*N / 3 + 2 * N * N,therefore, the "MegaFLOPS" rating, or millions of floating point operations per second, can be found as
mflops = ops / ( cpu * 1000000 ).
The following table compares the "backslash" version ("LINPACK_BENCH_BACKSLASH") against the MATLAB version ("LINPACK_BENCH") which is a straight translation of the original FORTRAN code.
Language | Precision | Type | Machine | Comment | MegaFLOPS |
---|---|---|---|---|---|
MATLAB | Double | Real | DHCP95 (Apple G5) | LINPACK_BENCH_BACKSLASH | 1857 |
MATLAB | Double | Real | DHCP95 (Apple G95) | LINPACK_BENCH | 20 |
linpack_bench_backslashor
linpack_bench_backslash nto specify the matrix size (default n = 1000 ), or
linpack_bench_backslash n ldato specify the matrix size and the leading dimension (default lda = n+1);
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
linpack_bench_backslash is available in a MATLAB version and an Octave version.
linpack_bench, a MATLAB code which measures the time taken by LINPACK to solve a particular linear system.
memory_test, a MATLAB code which declares and uses a sequence of larger and larger vectors, to see how big a vector can be used on a given machine and compiler.
timer_test, a MATLAB code which demonstrates how to measure CPU time or elapsed time.