You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

deig.m 870 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/octave --silent
  2. nfrom = 128 ;
  3. nto = 2048;
  4. nstep = 128;
  5. loops = 1;
  6. arg_list = argv();
  7. for i = 1:nargin
  8. switch(i)
  9. case 1
  10. nfrom = str2num(arg_list{i});
  11. case 2
  12. nto = str2num(arg_list{i});
  13. case 3
  14. nstep = str2num(arg_list{i});
  15. case 4
  16. loops = str2num(arg_list{i});
  17. endswitch
  18. endfor
  19. p = getenv("OPENBLAS_LOOPS");
  20. if p
  21. loops = str2num(p);
  22. endif
  23. printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
  24. printf(" SIZE FLOPS TIME\n");
  25. n = nfrom;
  26. while n <= nto
  27. A = double(rand(n,n));
  28. start = clock();
  29. l=0;
  30. while l < loops
  31. [V,lambda] = eig(A);
  32. l = l + 1;
  33. endwhile
  34. timeg = etime(clock(), start);
  35. mflops = ( 26.33 *n*n*n ) *loops / ( timeg * 1.0e6 );
  36. st1 = sprintf("%dx%d : ", n,n);
  37. printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg );
  38. n = n + nstep;
  39. endwhile