File: solve.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 (18 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# mesuring performance of Octave
n = 500;
m = linspace(0,n*n-1,n*n);
m = rem(m, n+1) + 1;
m = reshape(m,n,n);
x = reshape(linspace(1,n*n,n*n),n,n);

printf ("solving %ix%i matrix...\n",n,n);
[t1, u1, s1] = cputime ();

y = m \ x;

[t2, u2, s2] = cputime ();
printf (" Time: %5.2f sec\n", u2 - u1);

#  Time:  6.87 sec, GNU Octave, version 2.0.16 (sparc-sun-solaris2.7).
#y
exit