File: mat.m

package info (click to toggle)
libnarray-ruby 0.5.9-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 564 kB
  • ctags: 564
  • sloc: ansic: 4,620; ruby: 1,513; python: 70; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# mesuring performance of Octave

n = 500;

a = linspace(0,n*n-1,n*n);
a = rem(a, n+1) + 1;
a = reshape(a,n,n);

b = linspace(0,n*n-1,n*n);
b = rem(b, n-1) + 1;
b = reshape(b,n,n);

printf ("executing product of %ix%i Matrix...\n",n,n);
printf ("c=a*b\n");

[t1, u1, s1] = cputime ();
c = a*b;
[t2, u2, s2] = cputime ();

printf (" Time: %f\n", u2 - u1);
# Time: 7.280000
# GNU Octave, version 2.0.16 (sparc-sun-solaris2.7).
exit