Guest User

Untitled

a guest
Mar 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. function [] = spdTesting()
  2.  
  3. [A, b] = spdGenerator(5);
  4. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  5. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  6. fprintf('SORiter: %d. \n',iter);
  7. fprintf('SORerr : %1.3e\n', err );
  8. [A, b] = spdGenerator(10);
  9. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  10. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  11. fprintf('SORiter: %d. \n',iter);
  12. fprintf('SORerr : %1.3e\n', err );
  13. [A, b] = spdGenerator(50);
  14. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  15. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  16. fprintf('SORiter: %d. \n',iter);
  17. fprintf('SORerr : %1.3e\n', err );
  18. [A, b] = spdGenerator(100);
  19. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  20. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  21. fprintf('SORiter: %d. \n',iter);
  22. fprintf('SORerr : %1.3e\n', err );
  23. [A, b] = spdGenerator(500);
  24. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  25. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  26. fprintf('SORiter: %d. \n',iter);
  27. fprintf('SORerr : %1.3e\n', err );
  28. [A, b] = spdGenerator(1000);
  29. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  30. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  31. fprintf('SORiter: %d. \n',iter);
  32. fprintf('SORerr : %1.3e\n', err );
  33. [A, b] = spdGenerator(1500);
  34. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  35. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  36. fprintf('SORiter: %d. \n',iter)
  37. [A, b] = spdGenerator(2000);
  38. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  39. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  40. fprintf('SORiter: %d. \n',iter);
  41. fprintf('SORerr : %1.3e\n', err );
  42. [A, b] = spdGenerator(2500);
  43. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  44. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  45. fprintf('SORiter: %d. \n',iter);
  46. fprintf('SORerr : %1.3e\n', err );
  47. [A, b] = spdGenerator(3000);
  48. tic, [x, err, iter] = successiveOverRelaxation(A, b); timeSuccessiveOverRelaxation = toc;
  49. fprintf('SORtime: %1.3e sec.\n',timeSuccessiveOverRelaxation);
  50. fprintf('SORiter: %d. \n',iter);
  51. fprintf('SORerr : %1.3e\n', err );
Add Comment
Please, Sign In to add comment