]> gitweb.michael.orlitzky.com - octave.git/commitdiff
Place the 'omega' parameter to successive_over_relaxation() first -- a more natural...
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 7 May 2013 17:56:20 +0000 (13:56 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 7 May 2013 17:56:20 +0000 (13:56 -0400)
iterative/gauss_seidel.m
iterative/successive_over_relaxation.m

index a844142a73ae8be1a67223d0c3b68e4a49c583e2..62826fb215ada0c4f8a43935b6a44451d1bcb883 100644 (file)
@@ -13,9 +13,9 @@ function [x, iterations, residual_norms] = ...
 
   if (nargout > 2)
     [x, iterations, residual_norms] = ...
 
   if (nargout > 2)
     [x, iterations, residual_norms] = ...
-      successive_over_relaxation(A, b, omega, x0, tolerance, max_iterations);
+      successive_over_relaxation(omega, A, b, x0, tolerance, max_iterations);
   else
     [x, iterations] = ...
   else
     [x, iterations] = ...
-      successive_over_relaxation(A, b, omega, x0, tolerance, max_iterations);
+      successive_over_relaxation(omega, A, b, x0, tolerance, max_iterations);
   end
 end
   end
 end
index 2bb96f8f1a2ca6f41f9828ba1df10a01a2367c8e..71b702db271c07ac4e0e74349b0ed39e70251337 100644 (file)
@@ -1,5 +1,5 @@
 function [x, iterations, residual_norms] = ...
 function [x, iterations, residual_norms] = ...
-        successive_over_relaxation(A, b, omega, x0, ...
+        successive_over_relaxation(omega, A, b, x0, ...
                                    tolerance, max_iterations)
   %
   % Solve the system,
                                    tolerance, max_iterations)
   %
   % Solve the system,
@@ -26,14 +26,14 @@ function [x, iterations, residual_norms] = ...
   %
   % INPUT:
   %
   %
   % INPUT:
   %
+  %   ``omega`` -- The relaxation factor.
+  %
   %   ``A`` -- The n-by-n coefficient matrix of the system.
   %
   %   ``b`` -- An n-by-1 vector; the right-hand side of the system.
   %
   %   ``x0`` -- An n-by-1 vector; an initial guess to the solution.
   %
   %   ``A`` -- The n-by-n coefficient matrix of the system.
   %
   %   ``b`` -- An n-by-1 vector; the right-hand side of the system.
   %
   %   ``x0`` -- An n-by-1 vector; an initial guess to the solution.
   %
-  %   ``omega`` -- The relaxation factor.
-  %
   %   ``tolerance`` -- (optional; default: 1e-10) the stopping tolerance.
   %                    we stop when the relative error (the infinity norm
   %                     of the residual divided by the infinity norm of
   %   ``tolerance`` -- (optional; default: 1e-10) the stopping tolerance.
   %                    we stop when the relative error (the infinity norm
   %                     of the residual divided by the infinity norm of